An LLM API for authorized pentesting: setup, scope, reporting
Most AI pentesting tools have two parts: an agent loop that runs commands, and a model that decides what the loop does next. The agent is usually open source and takes an OpenAI-compatible base URL. The model is the part
Most AI pentesting tools have two parts: an agent loop that runs commands, and a model that decides what the loop does next. The agent is usually open source and takes an OpenAI-compatible base URL. The model is the part that refuses. A general assistant often declines at the word "exploit" even when the target is in scope and the paperwork is signed, and an agent that hits a refusal mid-run stops or wanders.
PentestLLM sells that second part: security-tuned, abliterated and uncensored open-weight builds on one prepaid key, for systems you own or have written permission to test. Prices are from the live catalog on 2026-11-20.
Setup
The API speaks the OpenAI and Anthropic wire formats, so any client that takes a base URL works: the OpenAI SDK, PentestGPT, Claude Code, OpenCode, Cursor, Cline, aider, or a Kali MCP client.
| Setting | Value |
|---|---|
| OpenAI-compatible base URL | https://api.pentestllm.ai/v1 |
| API key |
sk-ptl-... from the console |
| Model |
auto/security, or a fixed id from the models page
|
A first request:
curl https://api.pentestllm.ai/v1/chat/completions \
-H "Authorization: Bearer sk-ptl-live-..." \
-H "Content-Type: application/json" \
-d '{
"model": "auto/security",
"messages": [{"role": "user", "content": "Rank these scanner findings by severity and say what to verify first."}]
}'
auto/security lets the router pick a fast, balanced or frontier security build per request, billed at that build's price with no router fee. Where a tool needs a fixed id, the setup guides use Gemma 4 26B A4B Cybersecurity (gemma-4-26b-a4b-it-cybersecurity, 262,144 tokens of context), which takes tool calls.
Choosing a build comes down to three things:
- Context window. A full scan export or a long source file needs room; the largest security build takes 1M tokens.
- Tool calling. An agent needs a build that takes tool calls; each model page lists the parameters it supports.
- Price. Agent work is mostly input, because every turn resends the conversation, the tool results and the files in view. Input prices for security builds start at $0.40 per million tokens.
Agent setup pages: Claude Code, Cursor, Cline, OpenCode, and the rest under pentestllm.ai/guides.
Where it fits in an engagement
The model reads, ranks and drafts; the tester decides what runs. It works next to the tools you already use rather than replacing them:
- Burp Suite: paste or export a request, response or issue list and ask for a summary, a severity read or a retest note. Burp stays the tool that touches the target.
- Nuclei: feed the JSON results of a scan you ran in scope; the model groups duplicates, ranks by likely impact and lists what to confirm by hand.
- Proof of concept: it drafts a PoC for a confirmed finding, run first against your own lab copy of the target.
Scope first
Put the scope document and the rules of engagement where the agent can read them, at the top of the system prompt: the in-scope assets, the test window and any exclusions. Ask the model to point out notes that mention assets it cannot match to that list.
It can miss one. Checking every action and every finding against the scope stays a human job.
The key is for systems you own or are authorized in writing to test. Reduced refusals do not widen that. The acceptable use policy says a key may be suspended until proof of authorization is shown, and a signed engagement letter is that proof.
Reporting
Reporting is where a model saves the most time. From your notes it drafts:
- Findings: title, affected assets, description and the evidence you collected.
- Impact: what the issue means for this client, in plain terms.
- Remediation: a fix, a short-term mitigation and how to confirm the fix worked.
- Executive summary: one page for readers who will not open the technical section.
- Severity wording: it walks a CVSS vector with you and says which metrics are arguable.
Two rules keep it honest:
- Redact before it leaves. Agree with the client what may go to an outside model. Most reporting work does not need real values: replace hostnames, IPs, user names and credentials with placeholders like HOST-01 or USER-A, keep the mapping locally, and restore the real values in the final document. On this API, request and response bodies are not retained by default; a key can opt in to seven days of retention for replay, which you should leave off for client work unless the client agrees.
- The reviewer signs, not the model. With thin notes, a model writes fluent text about things that did not happen. Treat every draft as a junior colleague's first pass, remove anything you did not observe, and confirm each CVSS vector yourself. Asking the model to mark each sentence it inferred rather than read from the notes makes review much faster.
The full reporting walkthrough is at pentestllm.ai/use-cases/pentest-reporting.
Cost
Credit is prepaid from $10 by card, WeChat Pay or Alipay, with no subscription. A non-streamed response carries its settled charge in the x-uplink-charge header, so a short trial on your own inputs tells you what an engagement day costs.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.