Red Teaming Your Agent
RedTeamAgent is a drop-in replacement for the user simulator that runs structured, multi-turn adversarial attacks against your agent — plugged into the same scenario.run() loop, the same JudgeAgent, and the same CI pipeline. Your security tests live right next to your functional ones.

Why multi-turn wins
Most red-teaming tools fire thousands of single-turn prompts and score each in isolation. Real attackers don’t — they build rapport, reframe rejected requests, and escalate gradually until the agent drifts out of its guardrails. Agents that hold at turn 1 often break by turn 20.Crescendo escalation
A planner tailors an attack to your target, then escalates across phases instead of firing blind.
Per-turn scoring
Each response is scored 0–10 and the next turn adapts — pushing harder or switching technique.
Refusal detection + backtracking
Hard refusals are caught and the attacker drops the dead end and retries a new angle.
Reports dashboard
scenario redteam-report opens findings, transcripts, severity, and prioritized fixes.How Crescendo escalates
| Phase | Turns | Approach |
|---|---|---|
| Warmup | 0–20% | Rapport-building. Maps capabilities without revealing intent. |
| Probing | 20–45% | Hypothetical framing, “what if” scenarios, academic curiosity. |
| Escalation | 45–75% | Authority claims, roleplay, urgency, social engineering. |
| Direct | 75–100% | Encoding tricks (Base64, ROT13), prompt injection, multi-vector. |
Get it running
New to Scenario? Start with Getting Started to write your agent’scall() adapter, then swap in an attacker instead of the user simulator.
Swap the user simulator for an attacker
target describes what success looks like for the attacker. marathon_script() builds the multi-turn attack loop for you — the rest is a normal scenario.run().- Python
- TypeScript
Run it
Run it alongside your test suite. We recommend 50 turns for thorough coverage — agents that hold early often break under sustained pressure. With
LANGWATCH_API_KEY set, every adversarial turn shows up in the Simulations dashboard, and scenario redteam-report opens the findings dashboard with severity and prioritized fixes.Dig into the full docs
Red teaming quick start
Try it against your agent without writing code.
Full reference
Every parameter, check function, and CI pattern.
GOAT strategy
Per-turn dynamic technique selection for hardened agents.
Reports dashboard
Analyze findings, severity, and prioritized fixes.