Skip to content

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.

shell
git clone https://github.com/GreyDGL/PentestGPT.git
cd PentestGPT
make install
Patch cables in a network switch

Steps

  1. Install PentestGPT

    PentestGPT’s README asks for Python 3.12 or newer and the uv package manager. Clone the repository and install.

    shell
    git clone https://github.com/GreyDGL/PentestGPT.git
    cd PentestGPT
    make install
  2. Put the endpoint and key in .env

    PentestGPT reads provider settings from the environment or from a .env file in the directory you run it from. Its .env.example lists OPENAI_BASE_URL as 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/v1
  3. Add 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 one ModelSpec entry. 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"),
  4. 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-test
  5. Start 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.

BuildInputOutput
Qwen3.8 27B Cybersecurity$0.40$2.40
Gemma 4 26B A4B Cybersecurity$0.4224$1.3376
GLM-5.3 Flash Cybersecurity$0.5093$1.6975
Red Team (Flash)$0.90$3.00
Red Team (Pro)$1.50$6.00
OrcaCyber MiniMax M3.1 Flash$2.00$4.00
OrcaCyber Qwen3.8 Flash Next$2.00$4.00
Cyber Frontier$5.25$15.75
OrcaCyber Zero 1.5$7.50$18.75

Full price list and tool fees · Every model · API docs

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

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.

Get a key

usage, 1,000 agent turns on Qwen3.8 27B Cybersecurity
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
output price per million tokens, 9 builds

$1.3376 Gemma 4 26B A4B CybersecurityOrcaCyber Zero 1.5 $18.75