Run PentestGPT on PentestLLM
PentestGPT’s interactive mode, pentestgpt-legacy, can run on PentestLLM: set OPENAI_BASE_URL to https://api.pentestllm.ai/v1 and OPENAI_API_KEY to your key, add one model entry to PentestGPT’s registry, and start it with that model. PentestGPT’s autonomous mode drives the Claude Code or Codex CLI and documents no base URL setting, so this guide covers the interactive mode only.
git clone https://github.com/GreyDGL/PentestGPT.git
cd PentestGPT
make install
Steps
Install PentestGPT
PentestGPT’s README asks for Python 3.12 or newer and the
uvpackage manager. Clone the repository and install.shell git clone https://github.com/GreyDGL/PentestGPT.git cd PentestGPT make installPut the endpoint and key in .env
PentestGPT reads provider settings from the environment or from a
.envfile in the directory you run it from. Its.env.examplelistsOPENAI_BASE_URLas an optional override for the OpenAI provider. Create a key in the PentestLLM console and set both values..env OPENAI_API_KEY=sk-ptl-live-… OPENAI_BASE_URL=https://api.pentestllm.ai/v1Add a security build to the model registry
PentestGPT only accepts model ids that are in its registry,
pentestgpt_legacy/llm/registry.py, and its README says adding a model is oneModelSpecentry. Add this line inside_MODEL_LIST. The arguments are the id, the provider whose connector and key to use, the context window, and a tier label; the window is this build’s figure from the live catalog.pentestgpt_legacy/llm/registry.py ModelSpec("gemma-4-26b-a4b-it-cybersecurity", "openai", 262144, "balanced", notes="PentestLLM security build"),Confirm PentestGPT sees the model
List the registry. The new id should appear under OpenAI, shown as configured because the key is set. The smoke test sends a live request to every configured model and prints a pass or fail for each.
shell pentestgpt-legacy --list-models pentestgpt-legacy --smoke-testStart a session on the security build
Start the interactive assistant with the build for its reasoning and parsing sessions. You run the commands yourself and paste results back, which is how this mode is designed.
shell pentestgpt-legacy --reasoning-model gemma-4-26b-a4b-it-cybersecurity --parsing-model gemma-4-26b-a4b-it-cybersecurity
What we verified and what we did not
Every PentestGPT detail on this page was read from its repository on 11 November 2026: the README, .env.example, and the registry, settings and factory modules of the legacy mode. Those show that the OpenAI provider reads OPENAI_API_KEY and an optional OPENAI_BASE_URL, and that an unknown model id is rejected unless it is in the registry.
We have not published a tested configuration for PentestGPT’s autonomous pipeline. Its README says that mode uses the authenticated Claude Code or Codex CLI and reads no API key from the .env file, and it documents no way to change the endpoint. If you want an autonomous agent on a security build today, use OpenCode or Claude Code directly.
Without editing the registry
If you would sooner not change PentestGPT’s code, create a PentestLLM key with its auto router option set to auto/security. A key set that way routes every chat request as the router id whatever model name the client sends. PentestGPT can then be started with one of the stock OpenAI ids already in its registry, and the API will answer with a security build. Check the model field of a response, or the usage page in the console, to see which build answered.
What each setting does
OPENAI_API_KEY- The credential PentestGPT’s OpenAI connector sends. Your PentestLLM key.
OPENAI_BASE_URL- Overrides the OpenAI provider’s endpoint.
https://api.pentestllm.ai/v1. ModelSpec(...)- Makes an id selectable. The provider
"openai"reuses the OpenAI-compatible connector and the two variables above. --reasoning-model- The model for planning and the task tree.
--parsing-model- The model that summarizes tool and web output. A fast, low-priced build is enough here.
--base-url- A command-line override of the base URL for the selected models’ provider, as an alternative to
.env.
Why change the model under PentestGPT
PentestGPT’s interactive mode asks its model to reason about a penetration test step after step. On a general model some of those steps are declined. The security builds on PentestLLM are tuned or abliterated to answer security questions other models decline, so the task tree keeps growing. That is reduced refusals, not zero.
Costs are per token; the parsing session handles the bulk of the text, so a low input price there keeps a long session cheap. The table below has the live price of every security build on 2026-11-11.
Authorized use
PentestGPT’s README carries a disclaimer that it is for educational purposes and authorized security testing only, and the same holds here: PentestLLM is for systems you own or have written permission to test, under the acceptable use policy. The PentestGPT alternative page explains how the two fit together.
9 security builds, priced per token
Read from the live catalog on 2026-11-11. Prices are US dollars per million tokens, paid from a prepaid balance that starts at $10. The id auto/security has no price of its own: each request is billed at the build that answered.
| Build | Input | Output | Context |
|---|---|---|---|
| Qwen3.8 27B Cybersecurity | $0.40 | $2.40 | 262,144 |
| Gemma 4 26B A4B Cybersecurity | $0.4224 | $1.3376 | 262,144 |
| GLM-5.3 Flash Cybersecurity | $0.5093 | $1.6975 | 1,048,576 |
| Red Team (Flash) | $0.90 | $3.00 | not published |
| Red Team (Pro) | $1.50 | $6.00 | not published |
| OrcaCyber MiniMax M3.1 Flash | $2.00 | $4.00 | 261,632 |
| OrcaCyber Qwen3.8 Flash Next | $2.00 | $4.00 | 261,632 |
| Cyber Frontier | $5.25 | $15.75 | 1,048,576 |
| OrcaCyber Zero 1.5 | $7.50 | $18.75 | 999,488 |
Questions
Its interactive mode can. The repository’s .env.example lists an optional OPENAI_BASE_URL override, and the CLI has a --base-url flag. The model id must also exist in PentestGPT’s registry.
PentestGPT rejects model ids that are not in its registry. Its README says adding a model is one ModelSpec entry, and OpenAI-compatible providers reuse one connector.
We do not publish a setup for it. In November 2026 its README says the autonomous pipeline drives the Claude Code or Codex CLI and reads no API key from .env, and it documents no endpoint setting.
A stronger build for reasoning and a fast, low-priced one for parsing. Add a ModelSpec line for each id you want to select.
PentestGPT is free software. Model usage on PentestLLM is per token; on 2026-11-11 input prices for security builds start at $0.40 per million tokens, prepaid from $10.
Read next
- All agent guidesThe same three values in every supported client.
- PentestGPT alternativeThe model endpoint to run PentestGPT on, or to use in place of a chat subscription.
- OpenCodeThe opencode.json provider block for the security builds.
- Kali MCPmcp-kali-server on Kali, driven by a security build through an MCP client.
- Claude CodeTwo environment variables point Claude Code at the Messages endpoint.
Facts about other products and tools on this page were read from their own pages on 11 November 2026: PentestGPT README, PentestGPT .env.example, PentestGPT model registry. They change; check the source before relying on a figure.
One key, from $10
PentestLLM is for systems you own or have written permission to test. The acceptable use policy says what is not allowed.
- Input, 8,000 tokens at $0.40 per million
- $0.0032
- Output, 1,000 tokens at $2.40 per million
- $0.0024
- One turn
- $0.0056
- 1,000 turns
- $5.60