- Home
- AI agents
- Evaluation and testing
- Red teaming AI agents
Operate · Evaluation and testing
How do you red team an AI agent?
Red teaming an AI agent means attacking it on purpose, before an outsider does, to see whether it can be made to take a prohibited action, leak data it holds, follow instructions hidden in a document or tool result, or drift from its task. Automated scanners generate the attacks at scale; people add the creative, multi-turn ones.
In this guide: 83 pages
Key takeaways
- An agent red team tests actions, not only words. The categories that matter are prohibited actions, sensitive data leakage, task adherence and indirect prompt injection through the documents and tool results the agent reads.
- Automated scanners (Foundry’s AI Red Teaming Agent on PyRIT, garak, promptfoo) run thousands of attacks and report an attack success rate. Microsoft’s own position is that the effective approach combines automated tools with expert human analysis.
- Know the scanner’s blind spots. Foundry’s agentic tests were single-turn and English-only, with synthetic data and mock tools, and did not cover function tool calls or non-Foundry agents on 2 Nov 2026.
- Attack success rate is not comparable across tools or papers without a shared threat model, and judge-based scoring is non-deterministic. Use it to track your own agent over time, and fix with tool permissions and policy before you fix with prompts.
What does an agent red team test that a model red team does not?
A model red team asks whether the model will say something harmful. An agent red team asks whether the agent will do something harmful: call a tool it should not, reveal data it can reach, obey an instruction planted in a web page or a tool result, or quietly stop doing the task it was given.
Microsoft’s AI Red Teaming Agent names the agentic risk categories as prohibited actions, sensitive data leakage and task adherence, and it tests indirect prompt injection (sometimes written XPIA, cross-prompt injection attack), where the attack arrives through content the agent reads rather than through the user. Its illustrative taxonomy for actions has three tiers: prohibited actions are never allowed; high-risk actions such as financial transactions or medical decisions are allowed with human-in-the-loop confirmation; irreversible actions such as file deletions or system resets are allowed with disclosure plus confirmation. Your boundaries criterion from the acceptance criteria is the first tier written down, and the red team’s job is to cross it.
The catalogue for scoping is the OWASP Top 10 for Agentic Applications, published 9 Dec 2025, which organises the threats an agent faces by what it can reach: tools, memory, other agents, the user’s identity. Pair it with the agent’s own registry record, which lists the tools, data and identity it holds, and you have the attack surface: every tool is a target for misuse, every data source a channel for injection, every hand-off a chance to pass a poisoned instruction along.
Model robustness is one layer and not the control. Google reports, for its own models, that Gemini 4 Carbon reached 0.0% attack success against 0.7% for Gemini 4 Argon on the Gray Swan indirect prompt-injection benchmark (28 Oct 2026, vendor-reported). A better model lowers the rate; tool permissions, policy and approval gates decide what a successful attack can do. The Security threats to agents topic covers the attacks in detail.
Which automated tools run the attacks?
Four open tools and one managed service cover most of the automated layer. The scanners generate adversarial prompts from a library of strategies and score the agent’s response, often with a model as judge; the last two rows evaluate rather than attack. The table lists them as their pages showed on 2 Nov 2026.
Automated red-teaming tools for agents, as of 2 Nov 2026.
| Tool | What it does | Scope and limits | Licence and status |
|---|---|---|---|
| Microsoft Foundry AI Red Teaming Agent | Runs PyRIT attack strategies (Base64, Flip, Crescendo, Multi turn, Indirect Jailbreak and others) against a Foundry agent and reports attack success rate per category; results appear on the Agent Monitoring Dashboard | Agentic categories run in the cloud in East US 2, France Central, Sweden Central, Switzerland West and North Central US; supports Foundry prompt and container agents with Azure tool calls; workflow agents, non-Foundry agents and function tool calls not supported; single-turn, English-only, synthetic data and mock tools | Pages carry the preview banner and a preview API version; treat as preview |
| PyRIT | The open toolkit under Foundry’s agent: attack strategies, converters, scorers; usable against any endpoint | You write the target and the scoring | Microsoft, MIT |
| garak | Vulnerability scanner with probes (DAN, encoding injection and others) and detectors | Model and endpoint focused; agent tools need a custom harness | NVIDIA-hosted, Apache-2.0 |
| promptfoo | Red teaming and evaluations from one CLI, with CI checks and pull-request scanning | Any HTTP target; agent tool calls through custom providers | MIT; announced it is joining OpenAI on 9 Mar 2026 and says it stays open source |
| Inspect | Evaluation framework with sandboxing (Docker, Kubernetes, Modal), custom and MCP tools, and bridges to Claude Code, Codex CLI and Gemini CLI | Built for agent evaluations with real tools in a sandbox | UK AI Security Institute and Meridian Labs |
| AgentCore Evaluations safety evaluators | Safety, harmfulness and stereotyping evaluators over agent traces | Scores responses; does not generate attacks | AWS, GA 31 Mar 2026 |
AWS and Google document safety evaluators and guardrails (Bedrock Guardrails and AgentCore Policy; Model Armor through Agent Gateway) but we found no managed agent red-teaming service in the AWS or Google documentation we read on 2 Nov 2026, so on those clouds the open tools run against the agent’s endpoint.
What do human testers add, and where do they run?
People add the attacks a scanner cannot: multi-turn conversations that build trust, attacks that use your real tools and data, and the social tricks that arrive through the channel the agent lives in. Microsoft’s wording is that the most effective strategies combine automated tools that surface potential risks with expert human analysis.
Give the human testers the registry record and the acceptance criteria. The never list tells them what to aim for; the tool list tells them which tool results to poison; the data list tells them what a leak looks like. The best testers are often the fraud team, the help-desk lead or the people who already know how customers try to game the process, not security specialists alone.
Run the attacks in what Microsoft calls a purple environment: non-production, with production-like resources, real tool interfaces and realistic but not real data, and no live write access. Foundry’s cloud scans use mock tools and synthetic data for the agentic categories, which is safe and also why they miss what a real tool result can carry. Your human round is where the agent reads a real-shaped document with an instruction hidden in it, or a tool returns a record with a payload in a free-text field.
Test the approval path too. An attack that gets a high-risk action past the approver is a success for the attacker, so include cases where the request shown to the approver looks routine and the arguments are not. The Human in the loop sub-page covers why the approval screen must show the exact tool, arguments and target.
How do you read an attack success rate, and what do you fix?
Read it per category, over time, for your own agent, and never as a number to compare with a vendor’s or a paper’s. Fix with permissions and policy first, prompts second, and keep every successful attack as a case in the evaluation set.
Attack success rate is the share of attack attempts that achieved their goal, as judged by a scorer. Microsoft notes that scoring by generative models can be non-deterministic and that there is always a chance of false positives, so rerun the scan and read the flagged cases before you act on the number. promptfoo published a note on 12 Dec 2025 arguing that attack success rate is not comparable across jailbreak papers without a shared threat model: the attacker’s budget, the categories and the judge all change the figure.
Targets differ by category. Prohibited actions and data leakage should be at zero on the attacks you know about, because each success is an incident the agent could have in production. Task adherence and jailbreak categories are a trend to drive down. A release gate that blocks on any prohibited-action success and on a rise in the other categories is the usual shape.
Fixes go in order of strength. First, tool permissions and policy: an agent that cannot call the payment tool cannot be made to; AgentCore Policy (GA 3 Mar 2026) writes that as a Cedar rule, Google enforces it at Agent Gateway, and Foundry guardrails check tool calls and tool responses (preview). Second, guardrails on input and output, such as Prompt Shields on Azure, Bedrock Guardrails and Model Armor. Third, prompts and instructions, which help and which an attacker reads around. Then add each successful attack to the golden dataset, re-scan, and keep the scan in the gate so a model or tool change cannot reopen the hole.
How do Microsoft, AWS and Google implement it?
Red teaming and the controls that fix findings, as the vendor pages showed on 2 Nov 2026.
Capability, Microsoft, AWS, Google
| Capability | Microsoft | AWS | |
|---|---|---|---|
| Managed red teaming | AI Red Teaming Agent on PyRIT; agentic categories in five regions; treat as preview | None found in the docs we read; safety and harmfulness evaluators in AgentCore Evaluations | None found in the docs we read; safety_v1 criterion in ADK evaluation |
| Scope | Foundry prompt and container agents with Azure tool calls; single-turn, English-only, mock tools | Open tools (PyRIT, garak, promptfoo, Inspect) against the AgentCore endpoint | Open tools against the Agent Runtime endpoint |
| Fix with policy | Foundry agent guardrails on tool calls and responses (preview); Entra Conditional Access for agents | AgentCore Policy, Cedar rules on tool calls, GA 3 Mar 2026 | Agent Gateway policies with Model Armor integration |
| Fix with guardrails | Azure AI Content Safety Prompt Shields (GA since Aug 2024) | Bedrock Guardrails, including Automated Reasoning checks (GA 6 Aug 2025, detect only, English) | Model Armor |
Foundry’s red-teaming pages carry a generic preview banner and the samples use a preview API version; Microsoft states no explicit GA, so this page calls it preview.
Frequently asked questions
Is red teaming an AI agent the same as a penetration test?
No. A penetration test attacks the infrastructure and the application code. An agent red team attacks the agent’s behaviour: whether it can be talked, tricked or injected into a prohibited action or a leak. You need both, and the agent red team needs the people who know the business process as much as it needs security specialists.
How often should we red team an agent?
Before the first release, after every change to tools, permissions, knowledge sources or the model, and on a schedule for agents in the highest risk tier. The automated scan belongs in the release gate so it runs every time; the human round is periodic and after any incident.
Can Foundry’s AI Red Teaming Agent test a Copilot Studio or AgentCore agent?
Not the agentic categories, on 2 Nov 2026: Microsoft lists non-Foundry agents, workflow agents and function tool calls as not supported. For agents on other platforms, run PyRIT, garak or promptfoo against the agent’s endpoint, or use Inspect with the real tools in a sandbox.
What is a good attack success rate for an AI agent?
There is no number to borrow. Prohibited actions and data leakage should be zero on the attacks you know about; the other categories should fall release over release on your own threat model. Rates from vendors and papers use different attackers, categories and judges, so they do not transfer.
Do we need a red team if the model vendor already did one?
Yes. The vendor tested the model against general harms; your agent has your tools, your data and your approval screens, none of which the vendor saw. Vendor robustness lowers the rate; your tool permissions and policies decide what a successful attack can reach.
More in Evaluation and testing
Sources
Each source was read on 2 November 2026. The date shown is the date on the page, or the page’s ms.date for Microsoft Learn; an undated page shows the date it was read.
- AI Red Teaming Agent
- Run AI red teaming in the cloud
- PyRIT: Python Risk Identification Toolkit
- garak: LLM vulnerability scanner
- promptfoo
- promptfoo blog, including the note on comparing attack success rates
- Inspect evaluation framework
- OWASP Top 10 for Agentic Applications for 2026
- Evaluations for Amazon Bedrock AgentCore
- Amazon Bedrock AgentCore adds quality evaluations and policy controls for deploying trusted AI agents
- Evaluate agents with the Agent Development Kit
- Introducing Gemini 4 Carbon
- Overreliance on AI: a framework
Planning an AI program?
Talk to the team that builds it and runs it after launch.
- Built to SOC 2, HIPAA and GDPR standards
- EU AI Act-aligned delivery
- Microsoft Solutions Partner