AI agent data leakage happens when an agent moves private data to a person or place that should never see it. It almost always needs three things at once. The agent can read private data. It also reads text that an outsider wrote. And it has some way to send data out, such as an email, a link, an image or a pull request. Take away any one of the three and the leak path breaks.
We broke down five public AI data leaks for this guide. Only one involved stolen credentials. In the other four, the AI tool or its user already had legitimate access, and that access did the damage.
How AI Agent Data Leakage Differs From a Normal Breach
A classic breach starts with an intruder who gets in. An agent leak often starts with nobody getting in at all. The attacker writes some text, and the agent reads it while doing its normal job. That text can sit in an email, a support ticket, a web form or a GitHub issue.
The agent then follows the planted instructions with its own permissions. So your firewall sees nothing odd, and the request comes from a trusted account. The data leaves through a channel the agent was allowed to use.
That is why OWASP puts Sensitive Information Disclosure second on its Top 10 for LLM Applications. Its newer Top 10 for Agentic Applications goes further. Goal hijack, tool misuse and identity abuse fill the first three spots, and each one can end in a leak.
Six Causes of AI Agent Data Leakage
Each cause opens one of the three doors: access to private data, exposure to outside text or a path out. Most real incidents chain two or three of them.
Prompt Injection Hidden in Content the Agent Reads
Indirect prompt injection is the top cause. The attacker never talks to the agent. Instead, they plant instructions in content the agent will later read. The model cannot reliably tell your request apart from text inside a document, so it may obey both.
Many teams miss one point here. A system prompt rule such as “never reveal customer data” can be bypassed by prompt injection. So it should never be your only control.
Over-Broad Permissions and Long-Lived Tokens
An agent that can read every repository, mailbox or CRM record turns any small trick into a big leak. Broad OAuth scopes make it worse. If a token for an AI integration is stolen, the attacker gets everything that token can reach.
Wildcard scopes such as files:* or admin:* are a named risk in the Model Context Protocol security best practices. They expand the blast radius of a stolen token. They also make revocation painful, because pulling one broad token breaks every workflow at once.
Tool Outputs That Carry Data Out
Agents need tools, and many tools write somewhere. A tool that sends email, opens a pull request or fetches a URL can also carry data out. Even a chat reply can leak data. A markdown image whose URL holds stolen text sends that text to the attacker’s server the moment the image loads.
Memory That Keeps What It Should Forget
Long-term memory lets an agent recall facts across sessions. It also lets a planted instruction survive past one chat. Memory and Context Poisoning is ASI06 in the OWASP agentic list. A poisoned memory entry can steer later sessions toward sharing data, long after the original attack text is gone. For how memory stores work, see our guide on AI agent state across sessions.
Logs and Traces That Store Raw Prompts
Observability tools often save full prompts, tool arguments and outputs. So a log store can become the biggest pile of sensitive data in your stack. Amazon Bedrock Guardrails offers a sharp example. Its PII masking changes only the text sent to and returned from the model. The CloudWatch invocation log still keeps the original input, and the trace field holds the raw PII value.
Shadow AI Outside IT Control
Staff paste code, contracts and customer lists into public AI tools to save time. None of that passes through your agent controls. In April 2023, Samsung engineers uploaded internal source code to ChatGPT. Samsung then barred one division from using generative AI tools while it built safeguards. In an internal survey taken a month earlier, about 65% of staff saw ChatGPT as a serious security threat.
Five Documented AI Data Leaks and What Broke
Each of these cases is public and was confirmed by the vendor or by detailed research. The table shows which door each one used.
| Incident | AI system | How data got out | Root cause |
|---|---|---|---|
| Samsung source code | ChatGPT, used by staff | Engineers pasted internal code into a public chatbot | Shadow AI with no policy or DLP |
| EchoLeak | Microsoft 365 Copilot | A crafted email made Copilot gather data and send it to an outside server | Indirect prompt injection with zero clicks |
| GitHub MCP toxic flow | Claude Desktop with the GitHub MCP server | A public issue told the agent to copy private repo data into a public pull request | Prompt injection plus access to every repo |
| ForcedLeak | Salesforce Agentforce | A Web-to-Lead form entry sent CRM email addresses to a remote server | Prompt injection plus an expired trusted domain |
| Salesloft Drift tokens | Drift AI chat integration for Salesforce | Stolen OAuth tokens ran queries for passwords and keys in support cases | Long-lived tokens with wide CRM access |
EchoLeak is the cleanest example of a zero-click agent leak. Aim Security found it in Microsoft 365 Copilot. The attacker sends an email that reads like a normal note to the recipient, with no mention of AI. That wording slips past Microsoft’s cross-prompt injection classifiers. Later, the victim asks Copilot about a related topic, and Copilot pulls in the email. Then it collects data from earlier chats and sends it out, bypassing link redaction and the Content Security Policy. Microsoft rated it critical and fixed it with a server-side patch, so customers had nothing to do.
The GitHub case shows that no software bug is needed. Invariant Labs planted an issue in a public repo. The user then asked the agent to review open issues. The agent read private repos and leaked salary details and a relocation plan into a public pull request. Claude Desktop asks before each tool call by default. Many users switch on Always Allow, though, and that removes the last human check.
ForcedLeak, found by Noma Security, adds an infrastructure lesson. Salesforce had let a domain on its trusted list expire. An attacker could have bought it and received stolen data through a channel that looked safe. Salesforce took the domain back and now stops agent output from going to untrusted URLs.
The Drift case differs from the other four. Attackers breached Salesloft and stole the OAuth and refresh tokens of the Drift integration. Over ten days, they queried connected Salesforce orgs for AWS access keys, Snowflake tokens and passwords stored in support cases. Salesloft revoked every active Drift token with Salesforce’s help.
Read also: Agentic AI Statistics: Adoption, ROI, Jobs and Pricing Data
Prevention Controls Mapped to OWASP and NIST
Good prevention works on all three doors at once. The table maps each control to the cause it blocks and to the OWASP and NIST items it supports. NIST references use the four AI RMF functions: Govern, Map, Measure and Manage. They also point to two risks in the NIST AI 600-1 Generative AI Profile, Data Privacy and Information Security.
| Control | Cause it blocks | OWASP item | NIST AI RMF link |
|---|---|---|---|
| Scope each agent to the fewest records, repos and mailboxes it needs | Over-broad permissions | LLM06 Excessive Agency; ASI03 Identity and Privilege Abuse | Govern and Manage; Information Security risk |
| Treat retrieved text as data and require approval before outbound actions | Prompt injection | LLM01 Prompt Injection; ASI01 Agent Goal Hijack | Measure and Manage |
| Allowlist outbound domains and block images or links to unknown hosts | Tool output exfiltration | LLM05 Improper Output Handling; ASI02 Tool Misuse | Manage; Information Security risk |
| Review, expire and isolate memory per user | Memory | ASI06 Memory and Context Poisoning | Map and Manage; Data Privacy risk |
| Redact or encrypt prompts in logs and traces | Logging | LLM02 Sensitive Information Disclosure | Measure and Manage; Data Privacy risk |
| Approve AI tools and add endpoint DLP | Shadow AI | LLM02 Sensitive Information Disclosure | Govern; Data Privacy risk |
| Rotate short-lived tokens and watch integration logs | Token theft | ASI03 Identity and Privilege Abuse; ASI04 Supply Chain | Govern and Manage |
Shrink What the Agent Can Reach
Start the fix at access, because it limits every other failure. Give each agent its own identity and the narrowest scopes it needs. Invariant Labs showed a simple policy for the GitHub case: one repository per agent session. That single rule blocks the cross-repo leak, even if the injection succeeds.
Break the Path Out
Next, close the channels data can leave through. Keep a list of domains the agent may call or render, and block everything else. Strip or proxy markdown images in agent replies. Also audit your own trusted-domain lists, because ForcedLeak proved that an expired domain on that list becomes an attacker’s inbox.
Put a Human on Outbound Actions
Make sends, shares, posts and pull requests wait for a person. Keep that approval on, since Always Allow is what removed the last check in the GitHub case. Our guide to human-in-the-loop orchestration covers how to tier these approvals so reviewers do not drown.
Shorten Token Life and Watch Integrations
The Drift case needed no prompt at all. Long-lived refresh tokens gave the attackers the full reach of the integration. So set short token lifetimes and review connected apps every quarter. Alert on bulk queries from integration accounts as well. Also keep secrets out of support cases and CRM notes, because the Drift attackers searched exactly those fields for keys.
Clean Memory and Logs
Set a retention period for agent memory and let users see and delete entries. Then treat logs as sensitive stores. Turn on log data protection, limit who can read traces and keep raw prompts out of shared dashboards.
DLP Tools That Inspect AI Agent Traffic
Classic DLP watches files and email. Newer tools also scan prompts and model responses. Each one sees a different slice of agent traffic, so check the blind spots before you buy.
| Tool | What it scans | Actions | Blind spot to plan for |
|---|---|---|---|
| Microsoft Purview | Prompts and responses in Copilot and Microsoft AI apps, plus pastes into third-party AI sites | Warn or block on Windows endpoints, audit, retention, insider risk alerts | Endpoint blocking needs onboarded Windows devices |
| Amazon Bedrock Guardrails | Model inputs and outputs, with PII types and custom regex | Block, mask or detect, set apart for input and output | Tool call arguments and tool results are not checked |
| Cloudflare AI Gateway DLP | Prompts and provider responses passing through the gateway | Flag or block | Base64, external URLs and binary data are skipped; cache hits skip DLP |
Microsoft Purview for Copilot and Shadow AI
Purview is the natural pick for Microsoft 365 shops. DSPM for AI gives one place to find AI use and apply policies. Copilot honors sensitivity labels, so it will not return data a user cannot open. Endpoint DLP can warn or block users who paste card numbers or other sensitive data into third-party AI sites. The Risky AI usage policy in Insider Risk Management can flag prompt injection attempts too.
Amazon Bedrock Guardrails for Agents on AWS
Bedrock Guardrails filters PII such as names, emails, card numbers and AWS access keys. You can mask an email in the prompt and block it in the reply. However, it does not check tool call arguments, tool results or tool definitions. So an agent that pulls PII through a tool needs another control on that path. Our Amazon Bedrock Guardrails profile covers its other filters.

Cloudflare AI Gateway for Multi-Model Stacks
Cloudflare AI Gateway sits between your app and many model providers. Its DLP feature, in beta, scans prompts and responses with the same profiles as Cloudflare One. Streaming replies are buffered before scanning, which adds delay to the first token. You can scan requests only to avoid that. See our Cloudflare AI Gateway profile for routing and caching details.
For tools that catch injection before it reaches the model, browse our prompt injection detection agents. To spot exfiltration in network and identity logs, our threat detection agents are the next layer.
AI Agent Data Leakage Prevention Checklist
Run this list for every agent before launch and again each quarter. Each row has a test anyone on the team can repeat.
| Check | How to test it | Pass when |
|---|---|---|
| Agent has its own identity and narrow scopes | Read the token scopes and data sources it can reach | No wildcard scopes and no data the task does not need |
| Outside content is marked untrusted | Plant a harmless test instruction in an email or ticket | The agent ignores it or flags it |
| Outbound actions need approval | Ask the agent to email or post data to a new address | A human approval step appears |
| Domains are allowlisted | Ask it to render an image from an unknown host | The request is blocked |
| Memory has retention and a delete path | Store a fact, then delete it as the user | It no longer shows up in any session |
| Logs mask sensitive data | Send a fake card number, then read the logs | The number is masked or encrypted |
| Approved AI tools exist for staff | Paste test data into a public chatbot from a managed device | DLP warns or blocks |
| Integration tokens are short-lived | Check token age and refresh settings | Tokens expire and rotate on a schedule |
| Trusted domain lists are owned | Check renewal status for every domain on the list | All domains are active and owned by you |
| Incident steps exist | Run a tabletop on a leaked token | The team can revoke and rotate within an hour |
Pair this checklist with the filters in our AI agent guardrails guide. Guardrails catch bad inputs and outputs, while the checks here limit the damage when one slips through.
Questions Security Teams Ask About Agent Leaks
Can Prompt Injection Be Fully Blocked?
No tool blocks it fully today. In the GitHub test, a frontier model was still fooled, and many injection detectors missed the payload. So plan for injection to succeed sometimes, and limit what the agent can reach and send.
Is a System Prompt Rule Enough to Stop Data Leaks?
No. Limits written into a system prompt can be bypassed through prompt injection. Use them as one layer, backed by access limits, egress rules and DLP.
Does Masking PII in Prompts Also Protect the Logs?
Not by default. In Amazon Bedrock, masking changes only the text sent to and from the model. Invocation logs keep the original input, so turn on CloudWatch log data protection as well.
What Should We Fix First on an Agent Already in Production?
Cut its scopes to the minimum and turn on approval for every outbound action. Smaller scopes cap what any leak can expose. Approvals stop silent sends like the pull request in the GitHub case. Then add domain allowlists and log masking.
Related AI Agents
Read also: Hiring an AI Copywriter? Pick It by the Copy You Need Written
Explore Agent Categories
Related Articles
GuidesDuplicates, Typos and Broken Dates: Which AI Agent Should Clean Your Data?
GuidesAgentic AI Statistics: Adoption, ROI, Jobs and Pricing Data
GuidesSynthesia AI Video Usage Among Corporate Training Teams
GuidesBest CAMEL AI Alternatives and What They Cost
Guides100 AI Agent Statistics for Retail Companies
GuidesLLM or AI Agent? AI Search Engines and What They Actually Are





