AI pentesting
AI penetration testing that stays in scope
CommentLLM is a model API for authorized AI pentesting. Bind a key to an engagement, and each tool call the model asks for is checked against the targets your client authorized, before your agent receives it. When the test ends, you get a sealed record your client can verify.
- From $0.15 per million input tokens
- Credit from $10
- Written permission to test required
How an engagement key holds the scope
The scope of a penetration test is a contract. A host outside it belongs to someone who has not agreed to be tested, and an agent can end up there by mistyping an address, following a redirect or obeying text on a page it reads. An engagement key puts the limit in the API, where the model cannot change it.
- 01
Write down the engagement
Enter what your rules of engagement already say: the client, the authorization reference, the dates, the targets, what is excluded and the other hosts the agent may reach.
- 02
Bind a key to it
The key works only while the engagement is active and inside its dates. Closing the engagement stops it.
- 03
Let the agent read the scope
The agent kit, an MCP server, returns the scope and says whether a host, address or URL is in it, so the agent can ask before it acts.
- 04
Each tool call is checked
The gateway reads every tool call the model asks for. A call the check finds outside scope is not delivered, and the agent is told why.
- 05
Seal the record
Closing the engagement seals what was checked and blocked, as counts, with a digest of each finding. Your client confirms it at commentllm.com/verify, without an account.
Where a scope rule can live
Agentic pentesting lets a model choose the next command, so the rule has to sit somewhere the model cannot argue with. Use more than one of these together.
| Where | What it is good for | What to watch |
|---|---|---|
| The system prompt | Easy to write. | It is a request. A model can drift from it over a long session, and a page the agent reads can contradict it. |
| The agent's approval prompts | A person sees each command. Keep them on. | Someone has to read every one, and each machine is set up separately. |
| The sandbox's network rules | Stops traffic whatever the model does. Use them where you can. | They are set up for each test, apart from the record of what the agent asked for. |
| The API gateway | One place, outside the model, for every agent that uses the key. | It reads the call the model asked for, not what a tool did once it ran. |
What we tested
We ran an engagement key against the live API on 26 November 2026, with real models, by script and from three coding agents. The post has the details.
| What we did | Result |
|---|---|
| Requests with an engagement key, in all three API formats, on two models | 24 requests, 19 tool calls checked |
| Tool calls that named an address in scope | 8, all delivered |
| Tool calls that named an address outside scope, or an excluded one | 11, none delivered |
| Claude Code 2.1.332, Codex CLI 0.172.0 and opencode 1.19.6, in a sandbox | Each showed the reason after one request and did not run the command |
| The key, after the engagement was closed | Refused, with engagement_not_active |
| The sealed record, at commentllm.com/verify | Reported as sealed |
| A copy of the record with one decision changed | Reported as changed |
Set up your agent: Claude Code, Codex CLI or opencode. Run it in a sandbox that can reach only the test's targets.
What the frontier vendors offer pentesters
Anthropic, OpenAI and Google each run a program for approved security teams. Anthropic's help center lists penetration testing among the requests to Claude Opus 5 and 5.5 that may fall back to an older model. These are the programs, as each vendor's page described them on 3 December 2026.
| Program | Who can join | What its page says |
|---|---|---|
| Anthropic: Cyber Verification Program | Red Team Access is for organizations, on Enterprise and API plans. | Covers authorized penetration testing and red teaming. Work for customers needs a separate approval. Data retention is required, with an exemption some organizations hold for internal use. |
| OpenAI: Daybreak | Daybreak Red is for eligible organizations. | Gives access to specialized cyber models for authorized security testing, in the Codex app, the CLI and the API. |
| Google: Fairwind Program | Approved partners. Governments and partners most critical to society come first. | Gives some partners Gemini for cyber models, for defensive use. Permitted tasks include authorized threat simulation. |
If your organization qualifies for one of these, apply: it gives approved teams the vendor's own models for this work. CommentLLM serves abliterated open-weight models instead, to organizations that accept its Acceptable Use Policy. Use them only on systems you own or have written permission to test. The scope check applies to models served through CommentLLM.
What the check does not do
- It reads tool calls, not outcomes. It sees the call the model asked for, not what a tool did once it ran.
- It reads an address only when it is unambiguous. IP addresses, URLs, names under a domain you listed and bare names with a common ending are read. A script the agent wrote earlier and runs by its file name is not.
- Record-only mode blocks nothing. A failing call is flagged and still delivered.
- It covers this engagement's keys only. Work done with another key, another model or by hand is not in the record.
- It is not your authorization. You still need signed rules of engagement.
Questions
What is AI pentesting?
Penetration testing in which a language model does part of the work: it plans steps, calls tools, reads their output and drafts the report, inside a scope the system's owner has authorized. People also use the term for testing AI systems themselves, such as how a chatbot handles prompt injection. This page is about the first, and links to guides for the second.
Can AI do a penetration test on its own?
It can do parts of one. A person still agrees the scope, approves risky steps, confirms each finding and answers for the report. Models make mistakes, so treat what one reports as a lead until a tester has reproduced it.
Is AI pentesting legal?
Only with the permission of whoever owns the system, the same as any penetration test. Testing without permission is a crime in many countries. Get the permission in writing, with the targets and the dates, before an agent starts. This is general information, not legal advice.
How do you keep an AI pentesting agent in scope?
Give the agent the scope before it acts, and check each tool call somewhere the model cannot change. With CommentLLM, the agent kit gives the agent the scope, and an engagement key checks each tool call at the API gateway against the authorized targets, exclusions and ports. A call the check finds outside scope is not delivered, unless the engagement is set to record only. Run the agent in a sandbox and keep its approval prompts on as well.
Which LLM can I use for authorized penetration testing?
Vetted programs such as Anthropic's Cyber Verification Program and OpenAI's Daybreak give approved organizations frontier models for this work. CommentLLM serves abliterated GLM, DeepSeek and Kimi models, which refuse far fewer requests than standard models, and can hold an agent to an engagement's scope. Its Acceptable Use Policy allows security content only against systems you own or have written permission to test.
Can I use Claude or ChatGPT for pentesting?
With approval. On 3 December 2026 Anthropic's help center listed penetration testing among the requests that may fall back from Claude Opus 5 or 5.5 to an older model, and described Red Team Access for approved organizations. OpenAI's Daybreak page offered Daybreak Red to eligible organizations for authorized security testing. Check each vendor's page for its current terms.
What does my client get?
A record of the engagement: what it authorized, the models used, how many tool calls were checked and what was blocked, as counts, and a digest of each finding your agent recorded. Closing the engagement seals the record. Your client can confirm at commentllm.com/verify that it has not been changed, without an account. The record covers only requests made with the engagement's keys.
Does CommentLLM store what the agent sends?
Not the prompts, responses or tool calls. They pass through the gateway and go to an external inference provider to generate the answer. CommentLLM stores the scope you entered and metadata such as times, token counts and policy outcomes. The addresses a blocked call named are not kept.
Does it replace written authorization?
No. An engagement records the reference to your authorization and holds the agent to the scope you entered. You still need signed rules of engagement, and you must be able to show your permission when asked.
What does it cost?
You pay per token at the model's rate, from prepaid credit of $10 or more. Engagement keys, the scope checks, the agent kit and the record are included with every account.
Bring your rules of engagement.
Create an account, describe the engagement and bind a key to it.

