pensar pentest
Overview
The pensar pentest command runs a full autonomous penetration test from the command line without launching the TUI. This is ideal for CI/CD pipelines, scripting, and headless environments.
Usage
Options
Examples
Custom HTTP Headers
Headers passed via --header (repeatable) and --headers-from are sent on every
in-scope request issued by the agent — http_request, supported execute_command
tools (curl, nuclei, ffuf, gobuster, httpx, feroxbuster, dirb, wfuzz, wpscan,
sqlmap, nikto), and Playwright browser navigation.
Headers are applied only to in-scope hosts. Out-of-scope hosts (CVE writeups, vendor docs, etc.) never see configured headers.
Precedence (later wins on collision): global defaults (from pensar config headers)
< --headers-from file < --header CLI flags. Pass --no-global-headers to skip
the global snapshot.
The --headers-from file can be either a JSON object ({"X-API-Key": "abc"}) or
a newline-separated Name: Value file (with # comments).
Guiding the Pentest
The --prompt and --threat-model flags let you steer the pentest agent with additional context.
Both flags accept inline text or an @file reference. Prefix a file path with @ to read its contents instead of passing the path as a literal string.
When --threat-model is used, the content is automatically wrapped with guidance explaining how the agent should use it — prioritizing attack paths by severity, following pentest guidance sections, and verifying control gaps.
How It Works
- Apex creates a session (named “Blackbox Pentest” or “Whitebox Pentest” depending on whether
--cwdis provided) - The AI agent swarm is deployed against the target
- Progress and tool calls are streamed to stdout in real time
- On completion, a summary is printed with the number of findings and paths to the findings file, POCs directory, and report
Output
Default Model
When --model is not provided, Apex uses the default model for your highest-priority configured provider. See pensar models for the priority order.
Authorization Required: Only test systems you own or have explicit authorization to test.