CLI Reference
scan
Run a security scan against a target endpoint.
Usage
bash
agentprey scan --target <url> --category prompt-injection --html-out ./scan.htmlFlags
| Flag | Type | Default | Notes |
|---|---|---|---|
| --type | enum | http | Target type. Use http for endpoint scans or openclaw for local project path scans. |
| --target | string | none | Target HTTP endpoint URL or local OpenClaw project path. Required unless [target].endpoint is present in --config. |
| --header | repeatable string | [] | Additional request header in KEY: VALUE format. Repeat the flag for multiple headers. |
| --request-template | json string | none | Custom JSON request body with a {{payload}} marker for injection point. Use this for non-OpenAI formats. |
| --timeout-seconds | u64 | 30 | Per-request timeout in seconds. |
| --vectors-dir | path | vectors | Directory containing vector YAML files. |
| --category | string | none | Optional category filter, for example prompt-injection. |
| --json-out | path | none | Write scan JSON output to this path. |
| --html-out | path | none | Write scan HTML output to this path. |
| --upload | bool flag | disabled | Upload the completed scan artifact to the AgentPrey cloud after the local scan finishes. |
| --config | path | none | Load .toml project config. CLI flags still override config values. |
| --retries | u32 | 2 | Retry attempts for transient request failures. |
| --retry-backoff-ms | u64 | 250 | Base retry backoff in milliseconds. |
| --max-concurrent | usize | 2 | Maximum vectors executed concurrently. Values below 1 are clamped to 1. |
| --rate-limit-rps | u32 | 10 | Global request rate limit (requests per second). Values below 1 are clamped to 1. |
| --redact-responses | bool flag | enabled by default | Explicitly enable response redaction in output artifacts. |
| --no-redact-responses | bool flag | disabled | Disable response redaction in output artifacts. Conflicts with --redact-responses. |
| --ui | enum | plain | Scan 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.htmlCommon Workflows
Baseline scan
bash
agentprey scan --target http://127.0.0.1:8787/chat --category prompt-injectionScan 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.htmlOpenClaw local-path scan
bash
agentprey scan --type openclaw --target ./path/to/openclaw-projectScan in TUI mode
bash
agentprey scan --target http://127.0.0.1:8787/chat --category prompt-injection --ui tuiUpload a completed scan
bash
agentprey auth activate --key <KEY>agentprey vectors sync --proagentprey scan --type openclaw --target ./path/to/openclaw-project --uploadScan 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.jsonConfig-driven scan with CLI overrides
bash
agentprey scan --config .agentprey.toml --target https://override.example/api --rate-limit-rps 5Resilience 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