AI red teaming for LLM apps requires testing the full stack: model, retrieval pipeline, tools, and gateway layer. Learn structured methods, team composition, and tooling.
Teams red team the model. They probe for jailbreaks, test for harmful outputs, maybe run a few prompt injection attempts. Then they ship.
The gateway layer, the retrieval pipeline, the tool integrations, the system prompt that stitches it all together: untested.
That gap is where real attacks land. AI red teaming is an evaluation methodology to discover flaws and vulnerabilities in AI systems, and for LLM applications, those flaws increasingly live outside the model itself. AI agents now have tools, memory, RAG pipelines, MCP connections, and direct access to internal systems, and every one of those surfaces is a potential vector for data exfiltration or privilege escalation. A complete AI red teaming program treats model, application layer, retrieval pipeline, and gateway as co-equal attack surfaces.
The term red teaming has extended beyond traditional cybersecurity to describe many kinds of probing, testing, and attacking of AI systems. The core concept remains adversarial: testers dynamically try to break the system to learn about how resilient its defenses are against producing negative outcomes. It is interactive and iterative. Each round of probing reveals new weaknesses, which inform the next round.
What makes AI red teaming distinct from traditional security testing is the nature of the system under test. Traditional security testing (SAST, DAST, pen testing) assumes deterministic systems with code paths. AI systems are non-deterministic and language-driven. Attacks happen at the prompt and conversation level. A SQL injection scanner will never find a prompt injection vulnerability. A DAST crawler will never discover that your agent hands over its system prompt when asked in Mandarin.
LLMs also produce harmful outputs under conditions that traditional security models do not cover. Both benign and adversarial usage can produce potentially harmful outputs, including hate speech, incitement of violence, or sexual content. A well-meaning user can trigger failures that look nothing like an attack, which means red teaming must account for both intentional exploitation and accidental misuse.
Red teaming is a best practice in the responsible development of systems and features using LLMs. It helps uncover harms and enables measurement strategies to validate the effectiveness of mitigations. It complements systematic measurement; one does not substitute for the other.
Red teaming is only useful if you're testing the actual application: the system prompt, the retrieval pipeline, the tools, and the guardrails. Testing the underlying model behind an API key tells you about the model's safety properties. It tells you nothing about whether your application's specific configuration, context, and integrations introduce new vulnerabilities.
Microsoft recommends testing at multiple layers: the LLM base model with its safety system in place, your application, and both the LLM base model and your application before and after mitigations are in place. This layered approach matters because mitigations themselves can introduce blind spots. A content filter tuned to block explicit language might miss a multi-turn social engineering attack that never uses a flagged word.
The attack surface for modern LLM applications extends far beyond the model. Consider what a typical production agent looks like: it reads and writes emails, queries internal databases, calls external APIs, retrieves documents from a vector store, and maintains conversation memory across sessions. Each of those surfaces is a potential entry point. Red teaming that stops at the model boundary misses most of them.
For teams running AI firewalls or gateway layers, there is a further distinction. Pre-deployment red teaming validates application behavior before release. Runtime defense (the gateway intercepting live traffic) requires its own testing regimen. Both need coverage, with different methods and at different cadences.
The threat model bounds the scope of the red teaming evaluation: what kinds of tests are fair game, and how resulting system behavior should be interpreted.
Skipping the threat model, or building a shallow one, is where programs derail. Without clear scope, teams default to testing whatever their tool supports, which may not align with their actual risk profile. Inappropriate tools can obscure evaluation results and lead to false conclusions about security posture. A team that runs only single-turn jailbreak probes and declares the system secure has left the most dangerous attack patterns untested.
A concrete example makes this tangible. Consider an enterprise AI assistant integrated with a company's email system. The assistant has the ability to read, write, and send emails, plus access to private company data. Attackers with some knowledge of the AI system could manipulate the AI to follow hidden instructions, access company data, and send it to attackers. The company's finances, customer records, and strategic plans could be exfiltrated through the assistant's own email capabilities. Without this scenario spelled out in the threat model, no one writes the test for it.
The broader problem: red teaming practices vary widely, and there are few established standards or best practices. Even organizations that have adopted red teaming (including Anthropic's Responsible Scaling Policy, Google DeepMind's Frontier Safety Framework, and OpenAI's Safety & Responsibility documents) approach it differently. The threat model is what anchors your program to your specific risks rather than someone else's checklist.
The OWASP Top 10 for LLM Applications provides the standard taxonomy. The project has grown to over 600 contributing experts from more than 18 countries and nearly 8,000 active community members, making it the most broadly vetted classification of LLM-specific risks.
The ten categories cover the attack surface systematically:
| # | Category | What Red Teams Probe |
|---|---|---|
| LLM01 | Prompt Injection | Crafted inputs that lead to unauthorized access, data breaches, and compromised decision-making |
| LLM02 | Insecure Output Handling | Unvalidated LLM outputs that lead to code execution, compromising systems and exposing data |
| LLM03 | Training Data Poisoning | Tampered training data impairing models, leading to compromised security, accuracy, or ethical behavior |
| LLM04 | Model Denial of Service | Resource-heavy operations causing service disruptions and increased costs |
| LLM05 | Supply Chain Vulnerabilities | Compromised components, services, or datasets undermining system integrity, causing data breaches and system failures |
| LLM06 | Sensitive Information Disclosure | Failure to protect against disclosure of sensitive information in LLM outputs, resulting in legal consequences or loss of competitive advantage |
| LLM07 | Insecure Plugin Design | Plugins processing untrusted inputs with insufficient access control, risking severe exploits like remote code execution |
| LLM08 | Excessive Agency | Unchecked autonomy leading to unintended consequences, jeopardizing reliability, privacy, and trust |
| LLM09 | Overreliance | Failing to critically assess LLM outputs, leading to compromised decision making, security vulnerabilities, and legal liabilities |
| LLM10 | Model Theft | Unauthorized access to proprietary large language models, risking theft, competitive advantage, and dissemination of sensitive information |
Three of these deserve special attention for application-layer red teaming: prompt injection, excessive agency, and insecure plugin design. These are the categories most likely to slip through when teams test only the base model.
Single-prompt tests catch the obvious failures. Production attacks are rarely that simple. Modern attacks rarely land in a single prompt. Crescendo-style escalations, conversation hijacking, progressive jailbreak chains, and context poisoning through retrieved documents all require multi-turn adversarial simulation. A single-turn probe cannot surface these failure modes.
Agentic systems fail through tool misuse, indirect injection via tool outputs, unauthorized actions, and excessive agency. These vectors require multi-turn simulation to detect. If your agent can call a database query tool, red teamers need to test whether an adversarial prompt can coerce the agent into running queries it should not. If your agent retrieves documents from a vector store, red teamers need to plant poisoned documents and see whether the agent follows injected instructions embedded in retrieved content.
For deeper coverage of how these vectors map to AI agent security architecture, and how guardrails interact with red teaming findings, those are separate concerns that feed into the same threat model.
Tool selection matters, but the team running the tools matters more. Microsoft recommends assembling a diverse group of red teamers with experience, demographics, and expertise across disciplines: experts in AI, social sciences, security, and domain-specific fields. If you are building a healthcare chatbot, medical experts should be on the red team. If you are building a financial assistant, someone who understands AI risk management regulations should be involved.
Role-specific assignments sharpen results. Security subject matter experts should probe for jailbreaks, meta prompt extraction, and content related to cyberattacks. Social scientists can test for bias, toxicity, and culturally specific failure modes. Domain experts catch the subtle errors that security testers miss because they do not know what "wrong" looks like in a specialized context.
A practical team structure for a production LLM application:
Small teams can cover multiple roles per person, but the diversity of perspective is non-negotiable. A team of five security engineers will find security bugs. They will miss the bias failures, the domain-specific hallucinations, and the subtle social engineering vectors that require different mental models to conceive.
The tooling landscape splits into open-source frameworks and commercial platforms.
On the open-source side, DeepTeam (Apache-2.0) is the most actively maintained LLM-specific red teaming framework, covering 50+ vulnerabilities, 20+ attack vectors, multi-turn and agent support, with built-in alignment to the OWASP Top 10 for LLMs and NIST AI RMF.
Commercial platforms layer workflow, reporting, and integration on top of adversarial testing capabilities. The differentiator worth evaluating: what happens after the test. Most AI security vendors stop at adversarial testing and hand back a PDF. The findings sit in a report that never reaches the engineering team fixing them. Look for platforms where failing adversarial traces become regression tests, get monitored in production, and surface alerts if similar patterns recur.
The CI/CD integration question is equally important. Failing adversarial campaigns should block releases when severity thresholds are crossed. Red teaming that runs quarterly but never gates a deployment is an audit exercise. Integration with pytest or equivalent testing frameworks means red teaming runs alongside regular tests in deployment pipelines.
One gap the tools do not solve on their own: runtime defense. Pre-deployment red teaming finds vulnerabilities before release. A runtime AI gateway or firewall intercepts attacks against the live system. Teams that need inline prompt-injection defense at the API layer need a separate runtime guard product alongside their red teaming toolchain. Red teaming validates that the guard works. It does not replace the guard.
Red teaming that runs once before launch and never again is a checkbox. The minimum cadence: before every major release, and on a monthly or quarterly schedule for production systems. OWASP Top 10 for LLM Applications, NIST AI RMF, MITRE ATLAS, ISO/IEC 42001, GDPR, and the EU AI Act are the standard checkpoints for enterprise programs in 2026.
A practical integration looks like this:
The connection between red teaming and AI governance is structural. Red teaming produces evidence. Governance frameworks require evidence. When EU AI Act compliance or GDPR requirements demand documentation of risk assessment, red teaming reports are the artifact that satisfies the requirement, provided they test the right things against a well-defined threat model.
Teams that keep red teaming separate from their testing and evaluation pipeline end up duplicating effort. The adversarial prompts used in red teaming overlap with the edge cases used in evaluation. The metrics tracked in red teaming (attack success rate, bypass rate, data leakage rate) feed into the same dashboards that track LLM output quality. Unifying these workflows reduces overhead and increases coverage.
shim sits in the request path between your applications and every LLM provider, redacting PII before it reaches the model, enforcing policy in real time, and logging every transaction so the vulnerabilities your red team finds have a runtime control that closes them.