CLI Reference

scan

Run a security scan against a target endpoint.

Usage

bash
agentprey scan --target <url> --category prompt-injection --html-out ./scan.html

Flags

FlagTypeDefaultNotes
--typeenumhttpTarget type. Use http for endpoint scans or openclaw for local project path scans.
--targetstringnoneTarget HTTP endpoint URL or local OpenClaw project path. Required unless [target].endpoint is present in --config.
--headerrepeatable string[]Additional request header in KEY: VALUE format. Repeat the flag for multiple headers.
--request-templatejson stringnoneCustom JSON request body with a {{payload}} marker for injection point. Use this for non-OpenAI formats.
--timeout-secondsu6430Per-request timeout in seconds.
--vectors-dirpathvectorsDirectory containing vector YAML files.
--categorystringnoneOptional category filter, for example prompt-injection.
--json-outpathnoneWrite scan JSON output to this path.
--html-outpathnoneWrite scan HTML output to this path.
--uploadbool flagdisabledUpload the completed scan artifact to the AgentPrey cloud after the local scan finishes.
--configpathnoneLoad .toml project config. CLI flags still override config values.
--retriesu322Retry attempts for transient request failures.
--retry-backoff-msu64250Base retry backoff in milliseconds.
--max-concurrentusize2Maximum vectors executed concurrently. Values below 1 are clamped to 1.
--rate-limit-rpsu3210Global request rate limit (requests per second). Values below 1 are clamped to 1.
--redact-responsesbool flagenabled by defaultExplicitly enable response redaction in output artifacts.
--no-redact-responsesbool flagdisabledDisable response redaction in output artifacts. Conflicts with --redact-responses.
--uienumplainScan output mode. Use tui for the terminal UI.

Core flag example

bash
agentprey scan   --target https://my-agent.com/api   --category prompt-injection   --request-template '{"input":"{{payload}}"}'   --html-out ./scan.html

Common Workflows

Baseline scan

bash
agentprey scan   --target http://127.0.0.1:8787/chat   --category prompt-injection

Scan with multiple output artifacts

bash
agentprey scan   --target http://127.0.0.1:8787/chat   --category prompt-injection   --json-out ./scan.json   --html-out ./scan.html

OpenClaw local-path scan

bash
agentprey scan   --type openclaw   --target ./path/to/openclaw-project

Scan in TUI mode

bash
agentprey scan   --target http://127.0.0.1:8787/chat   --category prompt-injection   --ui tui

Upload a completed scan

bash
agentprey auth activate --key <KEY>agentprey vectors sync --proagentprey scan   --type openclaw   --target ./path/to/openclaw-project   --upload

Scan with custom headers

bash
agentprey scan   --target https://your-agent.example/api   --header "Authorization: Bearer token"   --header "X-Environment: staging"

Scan with a custom request template

--request-template accepts a JSON string with a {{payload}} marker that defines where each test payload is injected. Use this to test non-OpenAI agent request formats.

bash
agentprey scan   --target https://my-agent.com/api   --category prompt-injection   --request-template '{"input":"{{payload}}"}'   --json-out ./scan.json

Config-driven scan with CLI overrides

bash
agentprey scan   --config .agentprey.toml   --target https://override.example/api   --rate-limit-rps 5

Resilience controls

bash
agentprey scan   --target http://127.0.0.1:8787/chat   --retries 3   --retry-backoff-ms 300   --max-concurrent 2   --rate-limit-rps 8

AgentPrey docs are intentionally calmer than the marketing site. Product flair stays on the homepage.