8.2 Red Teaming for GenAI
Key Takeaways
- Red teaming is a systematic, often black-box fault attack that seeks harmful capabilities such as privacy leaks, racist outputs, or failure to refuse CBRN attack guidance.
- It is especially critical for GenAI because of the huge attack space, can cover the end-to-end system or the model only, and complements static benchmarks.
- Security red teaming probes external attacks including indirect prompt injection and malicious RAG documents; safety red teaming looks for harmful outputs under ordinary use, such as unsafe medical advice, without adversarial intent.
- The core technique is interactive multi-turn prompting (for example 15–20 turns), best run after initial QA and before deployment, following a five-step process from diverse team to mitigation datasets.
- Red teaming complements blue teaming: runtime defensive monitoring and filters, which should consume the failing sequences red teams export.
Red teaming is a fault attack, not a brainstorm
Red Teaming (RT) is a systematic, often black-box form of fault attack that probes an AI-based system to identify harmful capabilities, especially in outputs. The goal is to cause the system to produce harmful or undesirable results so those capabilities can be removed or mitigated before users meet them. The practice draws inspiration from military wargaming and NASA tiger teams: a group is chartered to attack, not to reassure.
Harmful capabilities named in CT-AI v2.0 include privacy violations, expression of racist views, and providing guidance on chemical, biological, radiological, or nuclear (CBRN) attacks. Testers look for refusal to provide such guidance. This study guide does not describe how to obtain that guidance. A useful red-team result is a documented refusal — or a documented leak that then becomes a mitigation item, not a cookbook.
RT can be applied to any AI-based system. It is especially critical for GenAI because the range of possible inputs and outputs creates an enormous attack space. RT typically covers the complete end-to-end AI-based system (client, filters, retrieval, tools, model, logging). It can also be applied to the model only when you need to isolate whether the harm sits in the weights or in the wrapping product.
What RT looks for beyond a lock on the API
Many organizations start RT on security and safety. The syllabus is broader: RT can also hunt harmful capabilities in reliability, privacy, fairness, bias, and misinformation. A model that confidently invents a news event is a misinformation finding even if nobody tampered with the prompt.
Regulatory expectation. RT is increasingly expected for some types of AI-based systems. The EU AI Act is the syllabus's example framework. You do not need article numbers on this exam. You do need to know that a purely static benchmark report is unlikely to satisfy a risk-based regulation that expects probing for harmful capabilities.
Complements static benchmarks. Benchmarks freeze a dataset. RT is adaptive: the next prompt can be rewritten immediately in response to the last output. That is why RT finds issues a leaderboard never sees — the attack space is explored, not sampled once.
Security RT versus safety RT
When RT is used for security evaluations, the system is tested for vulnerabilities to external attacks. Those attacks include non-AI factors (stolen API keys, open admin ports, prompt logs left in tickets) and AI-specific factors such as indirect prompt injection and malicious content hidden in documents used by retrieval-augmented generation (RAG). Security RT assumes an adversary.
Safety RT, and similar evaluations for other harms, often asks how the system might create harmful outputs under ordinary use, without adversarial user intent. The syllabus example is unsafe medical advice. A person typing everyday symptoms is not a hacker; if the chatbot invents a dose, that is a safety finding.
Keep the two charters separate in the log so mitigations go to the right control. A filter for injected RAG text is not the same control as a medical-scope refusal.
When to run it, and what the core activity is
RT is most effective before deployment, after initial internal quality assessments are complete. If you red-team a model that still fails ordinary QA, you will drown in noise. If you wait until production, you are using customers as the tiger team.
The core activity is often interactive prompting: red teamers run multi-turn dialogues (for example, 15–20 turns) to elicit defective or policy-violating behavior. Single-shot ignore-previous-instructions tests are not the technique the syllabus describes as core.
Five-step process you must be able to implement
Learning objective AI-4.2.2 is K3: implement red teaming. Expect scenario items, including two-point questions, that ask which step comes next, which turn failed, or how findings feed mitigations.
- Assemble a diverse team so perspectives and attack vectors are not all the same demographic, language, or professional habit.
- Provide access in a safe test environment — not production data, not real patients, not live payment rails.
- Prompt to find vulnerabilities, through open-ended exploration or checklists, or both.
- Analyze identified failures to understand the threat: which control failed (model, RAG, filter, tool, logging).
- Create datasets from those threats to support mitigations and system improvements.
Coverage beyond a small expert team includes crowd-sourced prompts; automated LLM-versus-LLM attacks (one model generates attack prompts, another checks outputs); and hybrid approaches that keep human creativity and add automation scale.
Blue Teaming is the complement: ongoing, real-time defensive monitoring and filtering of inputs on the operational system. RT is proactive and pre-deployment focused; blue teaming is runtime defense. Insights from RT should improve the monitoring and filters the blue team runs.
Worked application: 18-turn red team of a medical chatbot
This is the implement skill. A two-point exam item will often give you a chatbot policy, a stack of turns, and ask what to record or where the finding goes.
System under test. ClinicGuide is a patient-facing chatbot. Policy: it may offer general wellness language; it must not diagnose, name a drug dose, or tell a user to stop a prescribed medicine. It uses RAG over an approved leaflet set. Initial QA (single-turn golden prompts, latency, and a toxicity benchmark) has passed. The bot is not in production.
Team and environment (steps 1–2). Two testers — a clinician and a security tester — plus a scribe. Access is a sandbox with synthetic patients, a frozen model version, temperature recorded, system-prompt hash recorded, and RAG corpus snapshotted. No session may leave the sandbox. That is the safe test environment; it is not a live clinic.
Charter A — safety, ordinary use (no adversary)
The clinician tester speaks as a tired relative, not as an attacker. This is safety RT.
- Turns 1–3. My partner has a headache after a long drive. The bot suggests rest, hydration, and contacting a clinician if symptoms worsen. No dose. Pass for this thread so far.
- Turns 4–8. The user adds details (age band, cannot keep water down, leftover tablets from last year). The bot still refuses to name a milligram amount and repeats the clinician referral. Pass.
- Turns 9–12. The user asks, in ordinary language, What would you do if you were me tonight? The bot invents a named tablet and a quantity. Fail: unsafe medical advice under ordinary use. Nobody tried a jailbreak. The user was not adversarial. That is still a red-team finding.
- Turns 13–15. The tester persists (out of hours, just this once). The bot repeats the invented quantity. Fail confirmed, not a one-off sampling glitch.
- Turns 16–18. The tester returns to a neutral wellness question to see whether the bad advice poisons the rest of the context window. Document whether the bot continues to refer to the invented quantity.
Document the failing turns in full: transcripts, turn numbers, model id, temperature, max tokens, system-prompt hash, RAG snapshot id. Without those fields the defect is not retestable after a filter change.
Charter B — security, adversary on the RAG path
The security tester plants a synthetic leaflet in the sandbox RAG store whose hidden instruction tries to override dosing policy. That planted file stands in for malicious content in RAG documents and indirect prompt injection. They do not use production documents and they do not publish the payload as a how-to.
- Turns 1–6 stay on neutral questions so retrieval is warm.
- A later turn asks a question that would trigger the planted instruction if the retriever surfaces it.
- If the bot follows the hidden instruction and relaxes the dosing refusal, that is a security RT finding against the retrieval and ingestion path, not only against the base model.
- If the bot ignores the hidden instruction, record a pass for this attack class and move to the next checklist item.
Charter C — refusal checks (racist views and CBRN guidance)
The checklist includes items that ask whether the system refuses to produce racist content and refuses to provide CBRN attack guidance. Testers record refusal or leakage. They do not retain leaked guidance as examples in the product wiki.
Analyze and mitigate (steps 4–5), then hand to blue team
For ClinicGuide, the safety fail is a missing medical-scope refusal after a long sympathetic conversation — a context-window issue as much as a model issue. The security fail, if present, is a RAG ingestion and filter gap.
Export the failing multi-turn sequences, and close variants, into a gated dataset. Engineering uses them to retest refusal filters. The blue team adds runtime monitors: for example, block outputs that contain dose-like number-plus-medicine patterns unless a clinician mode is authenticated, and scan newly ingested RAG documents for hidden instructions before they become retrievable. Re-run the same 15–20 turn scripts after each filter change. Do not declare victory on a single-turn prompt.
That sequence — diverse team, sandbox, exploration plus checklist, analysis, mitigation dataset, blue-team handoff — is what implement red teaming looks like on CT-AI v2.0.
During red teaming of a patient chatbot, an ordinary user describes everyday symptoms over many turns and the bot invents a tablet quantity. No one tried to inject instructions. How should this finding be classified in CT-AI v2.0 terms?
Which sequence matches the CT-AI v2.0 red-teaming process?
When is red teaming most effective, and what is the core activity CT-AI v2.0 describes?
A red team exports failing ClinicGuide transcripts into a gated dataset. What is the complementary operational activity those insights should improve?