opfor hunt runs an autonomous red-team campaign. Instead of a fixed suite, you give it an objective and a multi-agent system does the rest — reconnaissance, strategy, adaptive multi-turn attacks, self-judging, and a full report.
It’s powered by the Claude Agent SDK, so it needs an Anthropic-compatible key (direct or via OpenRouter) to drive the agents.
Quickstart
--ui to watch the attack tree unfold in a live dashboard.
Set
ANTHROPIC_API_KEY (or OPENROUTER_API_KEY) for the agents that drive the campaign. --target-key-env points to the key for the target you’re attacking — they’re separate.How it works
Three agent roles divide the work, each on a model tier suited to its job:| Agent | Role | Default model |
|---|---|---|
| Commander | Orchestrates strategy, dispatches operators, interprets results | sonnet |
| Operator | Executes multi-turn attack threads with personas + strategies | sonnet |
| Scout | Fingerprints the target with benign recon probes | haiku |
Options
- Target
- Models
- Limits
- Output
| Option | Description |
|---|---|
--endpoint <url> | Target HTTP endpoint (required) |
--objective <text> | Attack objective |
--objective-file <path> | Read objective from a file |
--target-key-env <var> | Env var holding the target API key |
--target-key <key> | Target API key directly |
--name <name> | Display name for the target |
--target-model <id> | Model value sent in requests |
--stateless / --stateful | How conversation history is handled |
Driving the agents with OpenRouter
To run the agents through OpenRouter instead of Anthropic directly, point the base URL at OpenRouter and supply a token:What it probes
The agents draw on a built-in library of vulnerability classes, personas, and strategies, and combine them adaptively.| Category | Examples |
|---|---|
| Vulnerability classes | jailbreak · prompt-injection · system-prompt-leak · sensitive-disclosure · harmful-content · tool-misuse · business-integrity · misinformation · bias |
| Personas | naive-user · journalist · security-auditor · frustrated-developer · entitled-customer · fellow-ai |
| Strategies | fictional-framing · authority-escalation · gradual-trust · instruction-override · encoding-obfuscation · context-overload |
Troubleshooting
Model not found
Model not found
Check
ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL are set correctly for the agent models.Rate limited
Rate limited
Lower
--max-operators or --budget-usd to reduce concurrency and total calls.Programmatic equivalent
The same campaign is available as
hunt() in the SDK, with progress streaming.