Skip to content

Pentest agent Since v0.2 ​

An administrator can add PentAGI, an autonomous pentest agent that runs as a separate service, as one more stage (agent) of an assessment's direct pass. It runs after the scanners. It is off by default and is never implied by a plain scan.

Its scope is prompt text only

The agent runs real tools from its own sandbox, which does not go through this product's scan gateway. Nothing in the product can stop a tool container from sending packets. Use it only on targets you own or are authorized to test, and restrict its network with your firewall.

Before you begin ​

  • Role: global administrator. Other roles do not see the tab or the panels, and the API answers 403.
  • A running PentAGI release of at least 2.2.0, reachable over https. A source checkout installs one with make pentagi (scripts/pentagi.sh install; see below). It is for your own use and is never shipped, because its licence forbids distributing it.
  • A scan target that is a test copy.
  • The agent's network can resolve and reach the target's URL (see Networking).

Precautions ​

RiskWhat is trueWhat you and the product do
It attacks whatever it can reachIts scope is text in the prompt only; its tool containers do not use the scan gateway.Off by default, administrators only, a switch and a typed host confirmation per target, scope in the prompt, a dedicated Docker network whose outbound traffic you restrict to the target. We record what it ran. We cannot guarantee it stays in scope.
Destructive actionsIt runs real exploitation tools.The prompt says non-destructive, no denial of service, no state changes. List state-changing paths (password change, CSRF demo pages, resets) in the target's Paths never requested. Use test copies only. Not enforceable.
Data leaves your networkIt sends prompts, tool output and target data to its LLM (cloud or local) and to web search.Declare where the model runs. A cloud model needs a second agreement. Credentials and card numbers are masked in what we send. Your declaration is the control.
TelemetryIt reports to its vendor's update server every 3 hours by default.The installer sets the interval to 0. Check the logs.
Host takeoverGiving its containers the Docker API (DOCKER_INSIDE=true) is dangerous; versions up to 2.1.0 had a CVE.The installer keeps it false and pins 2.2.0 or later.
Default login and self-signed certificateadmin@pentagi.com / admin on a fresh install.passwd changes it. We accept only a pinned fingerprint or a CA file, never skip verification. The listener is loopback only.
Findings are LLM outputQuality varies.Imported as reported, labelled Agent (unverified), shown with its own evidence, never confirmed.
Outside web-application scopeIt can also use network tools.The prompt limits it to the web application, which we cannot enforce.

Configure the agent ​

text
1. Open System > Settings > Autonomous agent and read the risk panel.
2. Turn the agent on and enter the address, and the CA file or certificate fingerprint.
3. Choose the model provider, "Agent runs on" (local model or cloud provider;
   a cloud model also needs the second agreement), the longest run,
   and the authorized-use agreement.
4. Under the API token field, store the token. Select Test connection.
5. Select Preview changes, then Apply.
sh
waap assess pentagi providers
waap assess pentagi set -dry-run -url https://127.0.0.1:8443 -fingerprint AB:CD:... -provider ollama -llm-where local -ack-authorized-use=true -enabled=true
waap assess pentagi set -m "enable agent" -url https://127.0.0.1:8443 -fingerprint AB:CD:... -provider ollama -llm-where local -ack-authorized-use=true -enabled=true
waap assess pentagi token -stdin < token-file
waap assess pentagi test
yaml
# assess.pentagi in the configuration
assess:
  pentagi:
    enabled: true
    base_url: https://127.0.0.1:8443
    fingerprint: "ab:cd:..."     # or ca_file: /abs/ca.pem (one is required)
    provider: ollama
    llm_where: local             # a cloud provider must be declared cloud
    max_minutes: 60
    answer_minutes: 15
    idle_minutes: 0
    token: pentagi
    ack:
      authorized_use: true
      cloud_opt_in: false        # also required when llm_where is cloud

Settings reference ​

SettingWhat it doesDefaultAllowed valuesApplies in
enabledTurns the agent feature on.offon, offall
base_urlPentAGI's address.nonehttps address onlyall
fingerprint or ca_filePins PentAGI's certificate. One is required.noneSHA-256 fingerprint, or an absolute PEM pathall
providerThe LLM back end PentAGI is configured with.nonean id from waap assess pentagi providersall
llm_whereYour declaration of where the model runs.nonelocal, cloudall
max_minutesThe agent is stopped at this limit.none1 to 1440all
answer_minutesHow long its question waits for your answer.151 to 240all
idle_minutesHow long a flow whose tasks ended stays open for a follow-up task.00 to 240all
tokenName of the stored API token. The token itself is never configuration.pentagitextall
ack.authorized_useAgreement that it is used only on authorized targets.offon, offrequired to enable
ack.cloud_opt_inSecond agreement that prompts and target data go to a cloud provider.offon, offllm_where: cloud

Only administrators can change any of these settings, on every route (form, apply, import, rollback).

Store the API token ​

The token sits in the write-only credential store under the name in token. It is never in the configuration, a response or a log, and reads say only whether it is stored. In the console, the field is never filled in: Store token replaces it, Remove token deletes it, and the page says only "Token set". Other ways: waap assess pentagi token -file FILE or PUT /v1/assess/pentagi/token. Test connection (or waap assess pentagi test) checks the certificate pin and the token through PentAGI's version endpoint. No flow is created and nothing is sent to any target.

Allow the agent on a target ​

text
1. Open Security testing > Scan targets, edit the target, Autonomous agent tab.
2. Turn on the allow switch, and enter the scope notes and any follow-up tasks.
3. Select Save.
4. Type the target's host exactly as shown, then select Confirm.
   The tab shows who confirmed and when, with Revoke.
sh
waap assess pentagi target -m "allow agent" -name shop-uat -allow=true -scope "UAT copy; never the payment pages"
waap assess pentagi authorize -target shop-uat -host shop-uat.example
waap assess pentagi revoke -target shop-uat
yaml
scan_targets:
  - name: shop-uat
    url: https://shop-uat.example/
    allow_agent: true
    agent_scope: "UAT copy; never the payment pages"   # secrets in it are masked before sending
    agent_follow_ups:                                  # at most 10, given one after another
      - "Check the order history pages for access by another account's order number"
  • Typed confirmation. Type the target's host exactly. For https://shop-uat.example:8443/ that is shop-uat.example:8443, with the port. The configuration records who confirmed and when (agent_authorization). If the target's address later changes to another host, the agent refuses until someone confirms again.
  • Send the stored login secret to the agent is off by default. Turned on, the password, cookie, header value or token goes into the prompt, to PentAGI and to its LLM provider (a cloud service if you declared a cloud model). Use a test account. Under policy.logging.mask: pci of the linked application it is never sent, whatever the switch. With it off, the agent is told no secret is provided and reports what needs a login as not tested. Changing the switch is audited.
  • Allow intrusive tests that change data (test copies only) is off by default (agent_allow_state_changes, -allow-state-changes=true). Off, the agent shows a CSRF weakness (the missing token) without submitting the form, and reports a stored XSS without storing it. On, it may submit a CSRF request, store an XSS and create or change test data. It must list every change (what, where, how to undo it) in its report. It is still told never to deny service, delete data in bulk, lock or delete accounts, change any credential of its login, or touch another host. These are instructions, not enforced: use a copy you can restore. Paths never requested stay a hard rule: to let it test CSRF on a page, also remove that path from the target's exclusions.

What the agent is told ​

All of it comes from the target's settings, none of it attack instructions: the target and scope notes; the login method (type, login path, username, field names, check path, other login fields, cookies, header name); starting URLs, OpenAPI descriptions and GraphQL endpoints; other in-scope host names; Paths never requested as hard rules; and up to 50 findings of the scanners that ran before it (attack and exposure first, by severity: class, name, method, path, parameter, severity, no evidence) as leads to verify or rule out. OpenAPI files on the control node are only named as unavailable, not uploaded. The whole text is capped at 32 KiB, the lowest leads are dropped first, and the prompt says how many. The target's stored login secrets and anything that looks like a credential, cookie, token or card number are masked first, whatever the application's logging mask.

Run an assessment with the agent ​

The agent stage is chosen per run.

text
1. Open Security testing > Assessments, Start assessment, pick the target, Plan.
2. Tick Include the autonomous agent stage and the confirmation that
   real tools run.
3. Start the scan.
sh
waap assess start -target shop-uat -confirm-uat -agent -confirm-agent

The plan names where its model runs, who confirmed the host, and whether intrusive tests are allowed. When a gate refuses, the box is disabled and a warning says why, with a button to where it is fixed.

The gates ​

Checked in code at every run: enabled; address, certificate pin and provider set; ack.authorized_use; the cloud opt-in when llm_where is cloud; the target's allow_agent; the confirmation for the current host; and a stored token. When one refuses, the assessment still runs its scanners and the pass lists pentagi / agent: skipped with the reason. The audit log records assess.agent.refuse with the gate.

Read what the agent did ​

The agent row shows not counted under Requests, never 0: the agent reaches the target directly, so this product does not see its traffic.

In the assessment's overview, an "Autonomous agent" section shows what the agent waits for and summary tiles: tasks, tool calls, duration, tokens (in, out, cached) and cost as PentAGI prices it. Tabs show what PentAGI's own flow screen shows, read about every 10 seconds while the agent runs and once more when it ends, then kept with the assessment.

TabWhat it shows
ActivityOne step per entry: time, tool, the agent's one-line reason, the command in a box, and other arguments. Filter by kind and search.
TerminalThe commands it typed ($ ...) and their output.
TasksIts tasks and subtasks with status and results.
AgentsLLM usage by model and provider and by agent type, and the hand-overs between agents.
Web searchesLookups on a search engine, with a short result. Identical consecutive searches show once with a count.
MemoryPentAGI's long-term memory: lookups (shown by default) and saved entries. PentAGI replaces secrets and addresses with its own markers, shown as "(hidden by PentAGI)" chips.
Findings so farWhat it reported in its task reports, parsed as it goes, marked unverified.

All of it is the agent's text, shown as text only, bounded, and masked (the target's secrets always, everything sensitive under mask: pci). Code appears in code boxes with syntax colours and a Copy button, cut to its first lines with "Show all N lines".

Reload from PentAGI (finished runs only) reads the flow from PentAGI again and keeps it in place of the stored view, for a run stored before line breaks were kept. It is disabled, with the reason, while the agent runs, when PentAGI is not configured or its token is not stored, and it says so when PentAGI no longer has the flow. Each reload is audited (assess.agent.reload). CLI: waap assess pentagi view -id ID -reload.

sh
waap assess pentagi activity -id ID
waap assess pentagi report -id ID

Agent findings ​

What the agent reports is imported into the assessment's findings (and, where it names a place, into the issue list), marked Agent (unverified). They are leads, not facts: the status is always reported, and nothing ever sets confirmed. The class comes from the CWE the agent named, otherwise the finding is unclassified. If its report has no findings block, its whole text is kept as one informational finding (not an issue). An agent finding at the same place, parameter and class as a scanner finding is not added twice: the scanner finding is marked "also reported by the agent" and keeps its own status. Agent findings are exposures, never counted as attacks that were prevented. Check one yourself before acting on it.

The agent is asked for each finding's requests in a fixed shape. The product writes them out as numbered steps ("Before you start", one block per request, "Expected") with a curl command per request, each value single-quoted. Read it before running it, because the agent's text is untrusted. A session value that changes per login is shown as <session>.

PentAGI's own final report is kept with the assessment (up to 256 KiB, marked cut beyond that) with the target's secrets masked, under "PentAGI's own report". It adds no findings beyond the findings block. waap assess pentagi report -id ID prints it (-raw, -json).

Talk to the agent while it runs ​

PentAGI can stop and ask a question, and a flow whose tasks ended can take another task. This product never answers for you.

  • Answer its question. When a task waits, "The agent asks" shows the question and the time it waits until (answer_minutes). Write the answer and select Send to the agent. No answer in time: the flow stops and the run notes say why.
  • Give it a follow-up task. List tasks on the target (Follow-up tasks on its Autonomous agent tab, or agent_follow_ups). Each is given when the previous task ends. With idle_minutes above 0, an ended flow also stays open that long so you can type one more.
  • See what it cost. After the run, the activity shows tokens, cost and a table per model. The cost is empty for a local model or one PentAGI has no price for.
  • A message typed while the agent is busy is kept (at most 5) and sent at its next wait.
sh
waap assess pentagi message -id ID -text "The test account is user2"
waap assess pentagi target -m "tasks" -name shop-uat -follow-up "Check the export feature"
waap assess pentagi set -m "waits" -answer-minutes 30 -idle-minutes 10

What you send goes to PentAGI and its LLM provider. It is masked first. Every message sent is listed under "Messages sent to the agent" with who sent it and when, kept with the assessment, and audited (assess.agent.input).

Networking for the agent (production) ​

The agent does not use the scan gateway or the target's Connect to address. Its tools run in PentAGI's sandbox containers on PentAGI's own Docker network (DOCKER_NETWORK in PentAGI's .env), and they connect to the scan target's URL exactly as written.

  • That network must resolve the URL's host name and route to it: DNS the sandbox can use, a route, and the port open from the sandbox host. A name that exists only in your hosts file or on another Docker network does not resolve inside the sandbox.
  • Restrict the sandbox network's outbound traffic with your firewall to the authorized targets and to the LLM provider and search services PentAGI needs. The prompt tells the agent never to scan other hosts, subnets or the gateway, but your firewall is the control.
  • The agent's first action is one request to the target URL. If that fails, it stops and the agent row shows failed with target unreachable from the agent's sandbox: <error>. The audit log records assess.agent.unreachable, and any finding it reported anyway is dropped.

Install PentAGI (source checkout, your own use) ​

make pentagi runs scripts/pentagi.sh install. It is not part of make build, make demo or make vuln-up, and nothing starts it for you. Subcommands: make pentagi CMD=... with install, start, stop, status (settings, password state and the certificate fingerprint to put in fingerprint), passwd, fingerprint, logs, and uninstall [--purge]. The script pins a release of at least 2.2.0, writes .tools/pentagi/.env with update checks off, no Docker access for the agent's containers, the listener on 127.0.0.1 only, generated secrets, and a dedicated Docker network for the agent's tool containers.

Audit ​

Runs are recorded as assess.agent.start, .finish, .stop (canceled, time limit, or the agent asked for input) and .fail. Every configuration change to these settings names them in the apply's audit record.

API ​

Global administrators only; viewer and operator get 403.

RoutePurpose
GET/PUT /v1/assess/pentagiSettings.
PUT/DELETE /v1/assess/pentagi/tokenStore or remove the token.
POST /v1/assess/pentagi/testTest the connection.
PUT /v1/scan-targets/{name}/agentPer-target settings.
POST/DELETE /v1/scan-targets/{name}/agent/authorizationTyped confirmation.
GET /v1/assess/runs/{id}/agentThe agent's activity.
POST /v1/assess/runs/{id}/agent/messagesSend a message.

The start request has agent and confirm_agent.

Limits ​

LimitValue
Run timemax_minutes, 1 to 1440
Follow-up tasks per target10
Messages kept while the agent is busy5
Messages in one run20, each at most 4000 characters
Prompt text32 KiB
Activity kept2,000 steps, 16 MiB per run; one command or script 256 KiB, its other arguments 64 KiB
A finding's evidence or reproduction64 KiB
Terminal entriesthe latest 2,000, 16 KiB each, 4 MiB in all
Agent notes in a report4000 characters

Anything that reaches a limit is marked as cut, and steps beyond the limits are counted as "not kept".