Prompt injection is the top risk for AI agents because an agent cannot reliably tell the difference between your instructions and text it reads along the way. Prompt injection sits at LLM01 in the OWASP Top 10 for LLM Applications 2025, the first entry on the list. When the model can also send email, open pages, or call tools, a hidden line of text becomes an action instead of a bad answer.
The numbers from public tests are not reassuring. In the AgentDojo benchmark from June 2024, targeted attacks succeeded about 48% of the time against an undefended GPT-4o agent. In August 2025, Anthropic measured a 23.6% attack success rate for its browser agent before new mitigations and 11.2% after them.
Below are the two main types of injection, the incidents that made the risk concrete, why agents raise the stakes, which defenses cut success rates, and a checklist you can run before an agent touches real data. If you are building your controls from scratch, pair it with our overview of AI agent guardrails.
Direct and Indirect Prompt Injection Work in Different Ways
Direct prompt injection happens when a user types input that changes how the model behaves. The classic version is “ignore your previous instructions.” It can be deliberate or accidental, and it targets the chat box you control.
Indirect prompt injection is the bigger problem for agents. Here the model reads outside content, such as a web page, email, PDF, code issue, or tool result, and that content carries instructions. The user never sees the attack. The agent picks it up while doing a normal task.

| Type | Where the Attack Lives | Who Triggers It | Typical Goal |
|---|---|---|---|
| Direct | The user prompt | The attacker typing into the app | Jailbreak, leak the system prompt, bypass rules |
| Indirect | Web pages, emails, files, issues, tool output | A normal user asking a normal question | Steal data, send messages, take actions as the user |
| Multimodal | Images or screenshots with hidden text | Any user who shares the file | Same as indirect, harder to spot |
| Obfuscated | Base64, other languages, emoji encodings | Either | Slip past keyword filters |
The OWASP scenarios include payload splitting and adversarial suffixes too. Payload splitting breaks a malicious prompt into pieces across a document, so no single piece looks dangerous. A practical takeaway: any filter that checks one chunk at a time will miss some attacks, so do not treat input scanning as your only control.
Four Incidents That Made the Risk Real
Research teams have turned prompt injection from a theory into working exploits against shipped products. Each case below used content the victim never wrote.
| Incident | Date | Target | What Leaked or Happened |
|---|---|---|---|
| EchoLeak (CVE-2025-32711) | June 2025 | Microsoft 365 Copilot | Data from prior Copilot chats and the current context sent to an attacker server |
| GitHub MCP toxic flow | May 2025 | GitHub MCP server with Claude 4 Opus | Private repo details, including a salary and relocation plans, posted in a public pull request |
| Comet summarize attack | August 2025 | Perplexity Comet browser | User email address and one-time password, enough for account takeover |
| Browser agent red teaming | August 2025 | Claude for Chrome | 23.6% attack success across 123 test cases before mitigations |
EchoLeak in Microsoft 365 Copilot
Aim Security disclosed EchoLeak in June 2025, and Microsoft rated it critical. The attacker sends a crafted email, and the victim does not need to open it. When the user later asks Copilot about a topic the email mentions, Copilot follows the hidden instructions and sends sensitive context to the attacker. The attack bypassed cross prompt injection classifiers, link redaction, and Content Security Policy. Microsoft fixed it server side.
The GitHub MCP Toxic Agent Flow
In May 2025, Invariant Labs demonstrated an attack on the GitHub MCP server, which had about 14,000 stars. An attacker opens an issue in a public repo. The user asks the agent to review open issues. The agent reads the injected text, pulls data from private repos, and leaks it in a pull request. The flaw sits in the agent architecture, not in one model, so a server patch alone cannot close it.
Comet and Agentic Browsers
Brave hid instructions in a Reddit comment behind a spoiler tag in July 2025. When a user clicked “summarize” in Perplexity Comet, the agent opened account settings, grabbed the email, requested a one time password, read it from Gmail, and posted both as a reply. Brave flagged the bug to Perplexity on July 25, 2025, and Perplexity shipped a first fix two days later. That fix proved incomplete, and Brave raised the issue again after public disclosure on August 20.
Why Agents Raise the Stakes Compared to Chatbots
A chatbot that falls for an injection writes a bad answer. An agent that falls for one acts. The lethal trifecta is a useful test: an agent is exposed when it has access to private data, exposure to untrusted content, and a way to communicate externally. EchoLeak, the GitHub MCP flow, and the Comet attack each combined all three.
- Tools turn text into actions. Email, file writes, pull requests, payments, and API calls all become attack outputs.
- Browsing widens the input surface. Every page, comment, and ad an agent reads is a possible instruction.
- Memory makes attacks persist. An instruction saved into long term memory can steer future sessions.
- Connectors stack trust. An MCP server or plugin added for convenience can bring both private data and an exit path.
The practical move is to map each agent against those three legs. If you cannot remove one leg, add a human approval step before any action that sends data out. Our post on AI agent data leakage walks through the exit paths attackers use most.
Read also: Gemini CLI vs Claude Code: Access, Pricing and MCP Compared
AgentDojo and Browser Tests Put Numbers on the Risk
AgentDojo, released in June 2024, is the most cited benchmark for this problem. It has 97 user tasks and 629 security test cases across workspace, Slack, travel, and banking environments. GPT-4o completed 69% of tasks with no attack and 50% under attack.
The same benchmark measured how defenses change the picture. Tool filtering, which only gives the agent the tools a task needs, dropped attack success to 7.5% for GPT-4o. A prompt injection detector cut success to about 8% but had many false positives and hurt utility.

| Test | Date | Setup | Attack Success Rate |
|---|---|---|---|
| AgentDojo | June 2024 | GPT-4o, no defense | 47.7% |
| AgentDojo | June 2024 | GPT-4o, tool filter | 7.5% |
| Claude for Chrome | August 2025 | 123 cases, before mitigations | 23.6% |
| Claude for Chrome | August 2025 | With mitigations, autonomous mode | 11.2% |
| Browser specific challenge set | August 2025 | Before mitigations | 35.7% |
| Browser specific challenge set | August 2025 | With mitigations | 0% |
| Spotlighting tests | March 2024 | GPT family models | Above 50% to below 2% |
An 11.2% success rate still means about one in nine attacks lands. Treat model level mitigations as one layer and plan for the attacks that get through.
Design Patterns That Limit the Blast Radius
The most promising defenses change the architecture instead of asking the model to be careful. CaMeL, a design published in March 2025 by researchers including Google authors, extracts the control flow from the trusted user query so untrusted data cannot change what the program does. It then attaches capabilities to data and checks them before tool calls. On AgentDojo, CaMeL solved 77% of tasks with provable security, against 84% for an undefended system.
CaMeL builds on the dual LLM idea. A privileged model plans and calls tools but never reads raw untrusted text. A quarantined model reads the untrusted text but has no tools. Data passes between them as references, not as instructions.
- Least privilege. Enforce least privilege access and handle privileged functions in code, not in the prompt.
- One scope for each session. Restrict an agent to one repository in each session so it cannot carry private data into a public repo.
- Human approval for high risk actions. Anthropic’s browser agent asks before publishing, purchasing, or sharing personal data.
- Isolation. Isolate agentic browsing from regular browsing so the agent cannot reach logged in sessions by default.
- Deterministic output checks. Validate tool arguments and output formats in code before execution.
For approval flows that do not slow every task, see human in the loop orchestration. Gate only actions that send data out, spend money, or change permissions.
Spotlighting and Input Separation Help but Do Not Close the Gap
Spotlighting marks untrusted content so the model can tell it apart from instructions. In Microsoft tests from March 2024, spotlighting cut indirect injection success from above 50% to below 2% on GPT family models with minimal impact on task performance. Methods include delimiters, datamarking with special characters between words, and encoding the content.
Azure Prompt Shields now offers spotlighting as a preview option that base64 encodes document content so the model treats it as lower trust. It is off by default, raises token counts, and works only with Chat Completions models. Large documents can exceed input limits once encoded.
Use spotlighting as cheap insurance on every untrusted input, then back it with privilege limits. Attackers adapt to delimiters over time, while a missing tool permission cannot be talked around.
Guardrail Products for Prompt Injection Detection
Detection products scan inputs, and sometimes tool outputs, for attack patterns. They are useful as a tripwire and for logging. Check carefully which inputs each one actually inspects, because tool results are where indirect attacks live.
| Product | What It Detects | Indirect Injection Coverage | Watch Out For |
|---|---|---|---|
| Amazon Bedrock Guardrails | Jailbreaks, prompt injection, prompt leakage (Standard tier) | Tool results and tool definitions are not assessed | Untagged input skips prompt attack checks with InvokeModel |
| Azure Prompt Shields | User prompt attacks and document attacks | Document attacks scanned at tool response for supported agent tools (preview) | Document attacks off by default in Foundry, up to five documents in each request |
| Lakera Guard | Prompt attacks, data leakage, content violations | Covers RAG data and MCP server traffic | Pricing not published, now part of Check Point |
The Bedrock gap matters for agent builders. Content in toolResult blocks is not assessed for prompt attacks, and with InvokeModel you must wrap user input in guard tags or no prompt attack filtering happens. If you use Amazon Bedrock Guardrails, run a separate scan on retrieved documents and API responses.

Check Point agreed to acquire Lakera in September 2025. Lakera supports more than 100 languages, which matters because Prompt Shields models are trained and evaluated mainly on English. Compare more options in our prompt injection detection directory.
A Prompt Injection Testing Checklist for Agent Teams
Regular adversarial testing and attack simulations is one of the core OWASP mitigations, and AgentDojo gives you a ready open benchmark. Run this checklist before launch and after any new tool or connector.
- Map every input source: user chat, web pages, email, files, tickets, repo issues, tool outputs, and memory.
- Mark which tools can send data out: email, HTTP requests, comments, pull requests, image URLs, and file shares.
- Plant hidden instructions in each input type, including white text, HTML comments, spoiler tags, and screenshots.
- Test encoded payloads: base64, other languages, and instructions split across two documents.
- Try exfiltration through rendered images and links, since OWASP includes an image URL exfiltration scenario.
- Check that high risk actions trigger a human approval prompt every time.
- Confirm guardrail scans cover tool results, not just the user prompt.
- Test memory poisoning: inject an instruction, end the session, and see if it returns.
- Run AgentDojo or a similar suite and track attack success rate across releases.
- Log every tool call with its triggering context so you can trace an incident.
Score results as an attack success rate, then rerun after each fix. Our AI agent deployment checklist adds the monitoring and rollback steps that belong next to these tests.
Questions Security Teams Ask About Prompt Injection
Can Prompt Injection Be Fully Prevented?
No current method stops it completely. Prevention may not be foolproof given the stochastic way generative models work. Architecture choices like CaMeL and tight tool scopes reduce what an attack can do, which is a more reliable goal than blocking every attack.
What Is the Difference Between Jailbreaking and Prompt Injection?
Jailbreaking aims to get a model past its safety training, usually through the user prompt. Prompt injection aims to override the developer or user instructions, often through outside content. Bedrock Guardrails and Prompt Shields detect both, but under separate categories.
Are AI Browsers Safe to Use With Logged In Accounts?
They carry more risk than a normal browser because any page can carry instructions. Use a separate profile without email or banking sessions for agent tasks, and require confirmation before the agent sends or buys anything.
Does a Better Model Solve Prompt Injection?
Newer models help, but they do not remove the risk. The GitHub MCP attack worked against Claude 4 Opus, and its authors trace the flaw to the agent system rather than any single model.
Which Defense Should a Small Team Start With?
Start with least privilege and human approval on outbound actions. Both are cheap and do not depend on detection accuracy. Then add spotlighting and a detection product on tool outputs.
Related AI Agents
Read also: Best AI Agents for Healthcare Call Centers: 6 HIPAA-Ready Picks







