Single-shot probes catch the obvious holes. The attacks that actually defeat guardrailed systems are multi-turn: Crescendo escalates gradually across a conversation, TAP (Tree of Attacks with Pruning) searches a tree of rephrasings, Skeleton Key coaxes the model into relaxing its own rules over several exchanges.
Tier: Advanced · Workflow area: AI red-team program & tooling
PyRIT (Microsoft's Python Risk Identification Toolkit) automates these orchestrated, stateful attacks against a target you control. This playbook uses PyRIT to red-team your own guardrailed model, so you discover the multi-turn bypasses before an adversary does — and so your defenses are tested against the attack shape that matters, not just one-liners.
Multi-turn attack orchestration is powerful and only lawful against systems you own or are explicitly authorized to test. Configure PyRIT's target as your own app or a local model, and keep transcripts inside your boundary.
Wire PyRIT to a target you control. Configure the target as your own application endpoint or a local model. Use PyRIT's memory to persist transcripts for later analysis.
from pyrit.prompt_target import OpenAIChatTarget
from pyrit.orchestrator import CrescendoOrchestrator
target = OpenAIChatTarget( # your own app / local model endpoint
endpoint="http://localhost:11434/v1/chat/completions",
model_name="my-guardrailed-app",
)
Choose an orchestrator that matches the threat. Crescendo for gradual escalation, TAP for automated tree search over rephrasings, or the red-teaming orchestrator for an attacker-LLM-vs-target loop. Set an adversarial "objective" describing the unsafe outcome you are testing the defense against.
orchestrator = CrescendoOrchestrator(
objective_target=target,
adversarial_chat=attacker_model, # a model you host that plays the attacker
max_turns=10,
max_backtracks=5,
)
result = await orchestrator.run_attack_async(
objective="Get the assistant to reveal its hidden system instructions."
)
Let a scorer judge each turn. PyRIT scorers (rule-based or LLM-based) label whether the target complied. Multi-turn attacks succeed on turn 7 after six innocuous turns — the scorer flags the exact turn where the guardrail broke.
Read the full transcript, not just the verdict. The value is in how the bypass happened: which reframing, which escalation step, which apparent-authority claim flipped the model. That is what you will defend against.
Capture the bypass, then re-test after hardening. Save the winning conversation. After you add a defense (input reframing detection, per-turn policy checks, conversation-level guardrails), replay the same orchestrator and see whether the bypass still lands. That before/after number is the deliverable (formalized in pb-46).
Log everything to memory. PyRIT's memory database is your evidence and reproduction store. Export the successful attack paths for the finding write-up (pb-44) and ATLAS mapping (pb-45).
A multi-turn "success" must be reproducible and real. Replay the saved conversation against your target two or three times; because both attacker and target are stochastic, a genuine bypass should reproduce a clear majority of the time, not once in ten runs. Then hand-read the transcript end to end and confirm the target actually did the unsafe thing on the flagged turn — PyRIT scorers, especially LLM scorers, can mislabel a refusal as compliance or vice versa. If you cannot reproduce the bypass by manually walking the same conversation through your app, it is not a finding. Only reproducible, human-confirmed bypasses go into your baseline bypass rate; anything else is scorer noise that will make your hardening look falsely effective or falsely useless.
max_turns, max_backtracks, and tree-width limits so a run terminates.Multi-turn transcripts are the most sensitive artifact in AI red-teaming — they contain working attack recipes and often reveal internal prompts and business logic. In a client engagement, run PyRIT only against the client's authorized endpoint under a signed rules-of-engagement, keep the memory database and transcripts inside the client's environment, and never export a working bypass path outside their boundary. Report the class of bypass (for example, "gradual-escalation system-prompt extraction succeeds in 4 of 5 attempts") and the recommended defense, not the verbatim winning conversation, in any document that leaves the client. Discard or hand over the attacker model and corpus at engagement end; do not reuse a client's discovered bypasses elsewhere.