Skip to content

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
Checked on each tool callTargets, exclusions and ports
Works withOpenAI and Anthropic formats
For your clientA sealed record they can verify
Not storedPrompts, responses and tool calls

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.

  1. 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.

  2. 02

    Bind a key to it

    The key works only while the engagement is active and inside its dates. Closing the engagement stops it.

  3. 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.

  4. 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.

  5. 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.

WhereWhat it is good forWhat to watch
The system promptEasy 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 promptsA person sees each command. Keep them on.Someone has to read every one, and each machine is set up separately.
The sandbox's network rulesStops 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 gatewayOne 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 didResult
Requests with an engagement key, in all three API formats, on two models24 requests, 19 tool calls checked
Tool calls that named an address in scope8, all delivered
Tool calls that named an address outside scope, or an excluded one11, none delivered
Claude Code 2.1.332, Codex CLI 0.172.0 and opencode 1.19.6, in a sandboxEach showed the reason after one request and did not run the command
The key, after the engagement was closedRefused, with engagement_not_active
The sealed record, at commentllm.com/verifyReported as sealed
A copy of the record with one decision changedReported 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.

ProgramWho can joinWhat its page says
Anthropic: Cyber Verification ProgramRed 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: DaybreakDaybreak 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 ProgramApproved 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.

Testing an AI system instead?

"AI penetration testing" also means testing a chatbot, an agent or a model of your own. We ran four AI red-team tools with a CommentLLM model against a test application of our own. Each guide has the configuration, the results and the cost.

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.