AI red teaming
Also known as: red teaming of AI systems
Testers attack an AI system on purpose, before and after release, to find ways it can be tricked into harmful or unsafe behaviour.
Draft - this entry has not been reviewed yet.
Formal
A structured, authorised exercise in which people, often helped by automated tools, act as attackers against an AI model or product to find harmful output, prompt injection, rule breaking, data leaks and other failures, and report them so they can be fixed.
In plain English
Like hiring clever troublemakers to spend a week trying to talk a new shop assistant into breaking every rule, so you learn where the training falls short before real customers do.
In practice
Before a municipality opens a chat assistant for citizens, a team spends two weeks trying to make it reveal other citizens' case details, give wrong advice about benefits or ignore its rules, and each trick found is blocked.
Why it matters
AI systems fail in ways ordinary functional tests never try, and the EU AI Act requires this kind of attack testing for the largest general-purpose models, whose failures could cause harm across society.
How to put it into practice
The usual steps, in order. Adapt them to your organisation.
- Get written approval from the system owner with scope, rules of engagement, test accounts and a stop contact, and agree which environment may be attacked.
- Write a threat model and a list of harms for this particular deployment, such as leaking other users' data, wrong advice, unsafe tool actions and ignored rules, using MITRE ATLAS and the OWASP LLM Top 10 as checklists.
- Put together a mixed team with security testers, domain experts and ordinary users who did not build the system, and give each of them harms or features to focus on.
- Test the deployed configuration with its system prompt, tools, retrieval sources and guardrails, not only the base model, and include indirect attacks through documents, web pages and emails the system reads.
- Start with an open-ended manual round, then turn what you found into a harms list for guided rounds, and add automated tools such as PyRIT, garak or promptfoo to run large attack sets.
- Log every attempt with date, input, output, model version and settings, and report results as attack success rates over many runs rather than single screenshots.
- Give the owner a report with the top issues, their severity and suggested fixes, and track each fix to closure.
- Turn each confirmed finding into a regression test and a guardrail or permission change, and red team again whenever the model, system prompt, tools or connectors change, and at least yearly.
Common pitfalls
- Testing only the base model through its API, while the real risk sits in the deployed system prompt, tools and retrieval.
- Treating a passed exercise as proof of safety, when it only shows what this team found in the time it had.
- Running one exercise before launch and never again, although prompts, model versions and connectors change every few weeks.
- Reporting single dramatic screenshots instead of reproducible success rates, so nobody can tell whether a fix worked.
Good guides
- OWASP GenAI Red Teaming Guide(opens in a new tab) · OWASP
- MITRE ATLAS(opens in a new tab) · MITRE
- NIST AI 600-1 - Artificial Intelligence Risk Management Framework, Generative Artificial Intelligence Profile(opens in a new tab) · NIST
- Planning red teaming for large language models (LLMs) and their applications(opens in a new tab) · Microsoft
- The General-Purpose AI Code of Practice(opens in a new tab) · European Commission
Technical deep dive
AI red teaming borrows the military and security term but covers a broader failure space than a conventional penetration test. The targets are the model (harmful content, jailbreaks, bias, hallucination, memorised training data, dangerous capabilities such as chemical, biological or cyber uplift), the application around it (system prompt leakage, direct and indirect prompt injection, insecure handling of model output, excessive agency in tools and agents), and the infrastructure (model endpoints, retrieval stores, supply chain). The OWASP GenAI Red Teaming Guide (2025) structures the work along these layers, and MITRE ATLAS provides an ATT&CK-style matrix of adversarial ML tactics and techniques that can be used to scope and report findings.
A typical engagement starts with a threat model and a harm taxonomy: which actors, which assets, which content categories and actions are unacceptable for this deployment. Testers then combine manual probing - role-play, persona and hypothetical framing, multi-turn escalation, encoding tricks, low-resource languages, poisoned documents placed where a RAG pipeline will retrieve them - with automated generation and scoring. Open-source harnesses such as Microsoft PyRIT, NVIDIA garak and promptfoo send large attack corpora, mutate prompts with an attacker LLM and grade responses with classifiers or an LLM judge. Because outputs are stochastic, results should be reported as attack success rates over many samples at fixed decoding settings, not as single screenshots.
For EU providers of general-purpose AI models with systemic risk, EU AI Act Art. 55(1)(a) requires model evaluation "including conducting and documenting adversarial testing" with a view to identifying and mitigating systemic risks, and the General-Purpose AI Code of Practice (July 2025) describes how signatories evidence this in its Safety and Security chapter. For high-risk systems, Art. 15 requires resilience against attempts to alter use or performance by exploiting vulnerabilities, including adversarial examples and data poisoning, which red teaming helps demonstrate. NIST AI 600-1 lists red teaming among the suggested actions for measuring generative AI risks.
Common pitfalls: testing only the base model and not the deployed configuration with its system prompt, tools and retrieval; treating a red-team pass as proof of safety rather than a lower bound on what an attacker finds; running a one-off exercise before launch while model versions, prompts and connectors change weekly; and failing to feed findings into regression test suites and guardrail rules. Microsoft's 2025 report on red teaming over 100 generative AI products stresses that many real failures come from simple techniques and system integration, not from gradient-based attacks. Red teaming complements, and does not replace, benchmark evaluation, a conventional penetration test of the surrounding infrastructure, and monitoring in production.
What to learn first
Everything this builds on, foundations first.
- Artificial intelligence (AI)
- →AI red teaming
Relationships
- Requires
- Artificial intelligence (AI)
- Don't confuse with
- Penetration test
- Mitigates
- Prompt injection
- Mandated by
- EU AI Act
- Used with
- Jailbreak
Sources & further reading
Standards & official texts
Reference works
- OWASP GenAI Red Teaming Guide · OWASP
Where this data comes from
This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.
See the review queueSuggest a correction on GitHubThis term as JSON
Check yourself
Loading…