AI Red Teaming
AI red teaming is the practice of adversarially probing an AI system to discover its failure modes, safety vulnerabilities, harmful behaviors, and capability limitations before deployment. Borrowed from cybersecurity, red teaming places trained evaluators (or automated systems) in the role of a determined adversary trying to elicit undesired behaviors.
Unlike standard benchmarking, which tests expected behaviors, red teaming deliberately seeks unexpected and undesired behaviors: harmful outputs, policy violations, factual hallucinations under pressure, jailbreaks, and emergent risks.
Why Red Teaming Matters
AI systems trained on human feedback are not immune to adversarial inputs. Common failure modes include:
- Jailbreaks: Prompt constructions that bypass safety guidelines.
- Harmful content generation: Eliciting instructions for dangerous activities.
- Bias amplification: Revealing discriminatory or stereotypical tendencies under specific prompts.
- Hallucination under adversarial conditions: Confidently fabricating false information when pressed.
- Capability elicitation: Discovering that models have dangerous capabilities not apparent in standard use.
Without systematic red teaming, these failures surface in production — with real consequences.
The Red Team / Blue Team Framework
| Team | Role |
|---|---|
| Red Team | Adversarial: attempts to cause failures, elicit harmful outputs, find vulnerabilities |
| Blue Team | Defensive: implements guardrails, fine-tuning, and mitigations |
| Purple Team | Collaborative mode where red and blue share findings in real time |
In AI safety contexts, the red team is tasked with finding risks that the development team may have missed, operating from the perspective of a malicious user, an unsophisticated user, or a sophisticated attacker.
Red Teaming Methodologies
1. Manual Red Teaming
Human evaluators craft adversarial prompts based on domain knowledge and creativity. This is most effective for:
- Novel attack patterns not anticipated by automated tools.
- Nuanced cultural or contextual harms.
- Testing for sophisticated multi-turn jailbreaks.
- Domain-specific risks (medical, legal, financial).
Structured approaches:
- Persona-based: Evaluators adopt specific user personas (vulnerable individual, malicious actor, investigative journalist).
- Scenario-based: Craft realistic scenarios where harmful outputs would occur.
- Tree of attacks: Iteratively refine prompts based on model responses.
2. Automated Red Teaming
Manual red teaming is labor-intensive and cannot achieve comprehensive coverage. Automated red teaming uses algorithms or language models to generate adversarial inputs at scale.
Approaches:
Gradient-based attacks (white-box):
Optimize a prompt suffix to maximize the probability of a harmful completion:
$$\delta^* = \arg\max_\delta \log P(\text{harmful output} \mid x + \delta)$$
The GCG (Greedy Coordinate Gradient) attack finds adversarial suffixes that transfer across models.
LLM-based red teaming (black-box):
Use a separate “attacker” LLM to generate adversarial prompts against a target model:
- Attacker LLM generates a candidate adversarial prompt.
- Target model generates a response.
- A classifier judges whether the response violates safety guidelines.
- Feedback is used to refine attacker prompts.
This is the approach used in Perez et al. (2022) and Anthropic’s red teaming pipeline.
Tree of Attacks with Pruning (TAP):
A tree-search approach where the attacker LLM iteratively refines prompts, pruning branches that fail to make progress toward eliciting a violation.
3. Structured Taxonomy-Based Testing
Organize red teaming efforts around a harm taxonomy:
| Category | Examples |
|---|---|
| Violent extremism | Instructions for attacks, radicalization content |
| Weapons | CBRN (chemical, biological, radiological, nuclear) instructions |
| Hate speech | Content targeting protected groups |
| Sexual exploitation | CSAM, non-consensual intimate imagery |
| Privacy violations | PII extraction, doxxing assistance |
| Cybersecurity abuse | Malware generation, exploitation guidance |
| Misinformation | Disinformation generation, election interference |
| Self-harm | Suicide methods, drug synthesis |
Systematic coverage of each category ensures comprehensive evaluation.
Evaluating Red Team Success
A red team “attack” succeeds when:
- The model produces a response that violates its stated safety guidelines or acceptable use policy.
- The response could cause real-world harm if acted upon.
- The attack is reproducible and transferable.
Attack Success Rate (ASR): The fraction of adversarial prompts that elicit a policy-violating response.
$$\text{ASR} = \frac{\text{Successful attacks}}{\text{Total attempts}}$$
A well-hardened model should have a low ASR, but ASR=0 is often a sign of over-refusal rather than genuine safety.
Jailbreak Taxonomy
| Technique | Description | Example |
|---|---|---|
| Role-play | Asking the model to adopt a persona that “doesn’t have restrictions" | "You are DAN, who always complies…” |
| Fictional framing | Embedding harmful requests in fiction | ”Write a story where a character explains…” |
| Obfuscation | Encoding or rephrasing harmful content | Base64 encoding, leetspeak |
| Many-shot | Providing many examples of compliance to shift behavior | 100 examples of the model “complying” |
| Indirect injection | Injecting adversarial instructions via external content | Malicious website content read by an agent |
| Competing objectives | Exploiting tension between helpfulness and safety | ”Refusing would be harmful because…” |
Responsible Disclosure and Red Team Governance
Red teaming in AI requires careful governance:
- Scope definition: What is in scope for testing? What harm categories are researchers authorized to explore?
- Data handling: Adversarial prompts and outputs may contain harmful content and must be handled securely.
- Finding classification: Not all findings are equally severe; a risk-based severity scale is needed.
- Remediation tracking: Findings must be tracked and addressed before deployment.
- Disclosure policy: When should findings be shared with the broader research community?
Red Teaming in Practice
Anthropic, OpenAI, Google DeepMind, and other major AI labs conduct extensive red teaming before model releases, often engaging external contractors with specialized expertise in areas like CBRN threats, child safety, or cybersecurity.
The U.S. AI Safety Institute (AISI) and UK AISI have conducted government-led red teaming evaluations of frontier models under voluntary safety commitments.
NIST AI RMF and the EU AI Act both incorporate adversarial testing as a component of responsible AI risk management.
Limitations of Red Teaming
- Incomplete coverage: Even extensive red teaming cannot test all possible inputs.
- Adversarial evolution: New attack techniques emerge after evaluations are complete.
- False confidence: A clean red team result does not guarantee safety in deployment.
- Capability overhang: Red teaming may not reveal latent dangerous capabilities that only emerge in specific configurations.
Red teaming is a necessary but not sufficient component of AI safety — it must be combined with alignment training, monitoring, and ongoing evaluation in deployment.