scan

Run a security scan against a target endpoint.

Usage

bash
agentprey scan --target <url> --category prompt-injection

Flags

FlagTypeDefaultNotes
--targetstringnoneTarget HTTP endpoint URL. Required unless [target].endpoint is present in --config.
--headerrepeatable string[]Additional request header in KEY: VALUE format. Repeat the flag for multiple headers.
--timeout-secondsu6430Per-request timeout in seconds.
--vectors-dirpathvectorsDirectory containing vector YAML files.
--categorystringallOptional category filter, for example prompt-injection.
--json-outpathnoneWrite JSON scan artifact to this path.
--html-outpathnoneWrite HTML scan artifact to this path.
--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.

Common Workflows

Baseline scan

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

Scan with JSON + HTML artifacts

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

Scan with custom headers

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

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