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

$pensar pentest --target <url> [options]

Options

FlagDescription
--target <url>(required) Target URL, domain, or IP address
--cwd <path>Source code path — enables whitebox attack surface analysis
--mode <mode>Pentest mode: exfil (pivoting & flag extraction)
--model <model>AI model to use (defaults to your configured provider’s default)

Examples

$# Basic blackbox pentest
$pensar pentest --target https://example.com
$
$# Whitebox pentest with source code access
$pensar pentest --target https://example.com --cwd ./my-app
$
$# Specify a model
$pensar pentest --target https://example.com --model claude-sonnet-4-5
$
$# Exfil mode for CTF-style flag extraction
$pensar pentest --target https://example.com --mode exfil

How It Works

  1. Apex creates a session (named “Blackbox Pentest” or “Whitebox Pentest” depending on whether --cwd is provided)
  2. The AI agent swarm is deployed against the target
  3. Progress and tool calls are streamed to stdout in real time
  4. On completion, a summary is printed with the number of findings and paths to the findings file, POCs directory, and report

Output

============================================================
PENTEST ORCHESTRATION
============================================================
Target: https://example.com
Model: claude-sonnet-4-5
→ execute_command
✓ execute_command completed
→ http_request
✓ http_request completed
...
============================================================
RESULTS
============================================================
Findings: 3
Path: /home/user/.pensar/sessions/.../findings.json
POCs: /home/user/.pensar/sessions/.../pocs/
Report: /home/user/.pensar/sessions/.../report.md

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.