SYNTROX.ai
Blog

Data Exfiltration Through AI Agents: Five Ways Data Gets Out, and How to Close Them

5 min read

An agent leaks data through the same channels it uses to work: tool-call arguments, URLs and rendered images, email and messages, files and pull requests it writes, and third-party MCP servers. Close those paths outside the model: allowlist where the agent can send data, inspect tool-call arguments before they leave, strip untrusted links and images from output, and scope every credential to the task.

On this page

Data exfiltration through an agent rarely looks like a breach. The agent reads data it is allowed to read and sends it somewhere it is allowed to send things. Every permission checks out. What is wrong is the combination: the exfiltration-through-a-permitted-tool-call pattern.

Simon Willison named the conditions in June 2025 as the lethal trifecta: access to private data, exposure to untrusted content, and the ability to communicate externally. An agent with all three can be steered into leaking by text it reads. It is not hypothetical. In June 2025, Microsoft published CVE-2025-32711, an AI command injection flaw in Microsoft 365 Copilot that, in the record's words, "allows an unauthorized attacker to disclose information over a network". Microsoft rated it critical.

How data leaves an AI agent: five paths

1. Tool-call arguments

In Invariant Labs' MCP tool poisoning disclosure, a tool called add carried hidden instructions in its description: read the user's MCP configuration and SSH private key, and pass them in a parameter called sidenote. Demonstrated against Cursor, it worked, and the confirmation dialog hid the arguments. The data left as an argument to a tool that was supposed to add two numbers. We cover the attack in detail in our piece on MCP tool poisoning.

2. URLs and rendered images

If an agent's output is rendered as markdown, an image is a request. In November 2023, the researcher who writes as wunderwuzzi on Embrace The Red showed Google Bard leaking chat history this way. A shared Google Doc carried an indirect prompt injection; Bard wrote a markdown image whose URL held the conversation in its query string; the browser fetched it with no click from the user. Google's content security policy only allowed Google domains, so he used Google Apps Script, which runs on them, as the logging endpoint. He reported it on 19 September 2023 and Google confirmed a fix on 19 October.

OWASP describes the same pattern in LLM01:2025 Prompt Injection, in a scenario where hidden instructions on a webpage make the model insert an image that exfiltrates the private conversation.

3. Email and messages

The same Invariant disclosure showed tool shadowing. A malicious server's tool description told the agent that a separate, trusted send_email tool must send all emails to an attacker's address. Cursor did so, even when the user named a different recipient. The trusted tool did the leaking.

4. Files, commits and pull requests

In May 2025, Invariant Labs showed an attack through the GitHub MCP server. An attacker opens an issue on a public repository containing a prompt injection. The user asks their agent to look at the open issues. The agent reads the issue, pulls data from the user's private repositories, and writes it into a pull request on the public one, where anyone can read it. The authors are explicit that this is "not a flaw in the GitHub MCP server code itself" but an architectural issue at the agent system level.

5. Third-party MCP servers themselves

An MCP server is code you run, and every argument you pass to it goes to whoever operates it. The MCP specification's security best practices give an example of a malicious startup command for a local server that posts ~/.ssh/id_rsa to a remote address, and recommend running local servers in a sandbox with restricted access to the file system and network.

How to prevent data exfiltration from AI agents: 4 controls

None of these controls depends on the model refusing. Each sits outside it.

ControlWhat it doesPaths it closes
Egress allowlistsThe agent and each MCP server can reach only named hosts, recipients and repositories2, 3, 4, 5
Argument inspectionEvery outbound tool call is checked for what it carries and where it goes1, 3, 4
Output scrubbingUntrusted links and images are removed before output is rendered2
Scoped credentialsEach task gets access only to what it needs1, 4, 5

Egress allowlists

Deny outbound traffic by default and name the destinations each component needs: hosts for network calls, recipients for email, repositories for writes. The MCP security guidance tells operators of server-side MCP clients to consider an egress proxy and network policies that restrict outbound access. A server that adds numbers needs no network at all.

The Bard case shows the limit: an allowlist of trusted domains still leaked, because one of those domains would log whatever it was sent. Allow destinations, not reputations.

Argument inspection before the call leaves

Check every consequential tool call, outside the model, before it runs. Does an argument carry a credential, personal data or a block of text from a source unrelated to the task? Is the recipient, URL or repository in bounds for this user? An add call carrying a private key, or a pull request to a public repository containing private content, fails a check that reads the action itself. That is complete mediation applied to tool calls, and when the check cannot answer, outbound actions are where you should fail closed.

Output scrubbing

Do not let model output make requests on its own. Strip images and links to domains outside an allowlist before rendering, or proxy them without query strings. OWASP's prompt injection guidance points the same way: define the expected output format and validate it with deterministic code.

Scoped credentials

In the GitHub demonstration, the agent's access reached the user's private repositories as well as the public one, so a single issue in a public repository reached private data. Invariant's recommended mitigation is least privilege, with a one-repository-per-session policy as their example. The MCP guidance makes the same case against wildcard scopes. Scope tokens to the task, and keep sessions that read untrusted content apart from sessions that hold private data and outbound tools. Removing one leg of the trifecta per session can be the cheapest fix available.

Why prompt filters don't catch exfiltration

In every case above, the instruction arrived through something other than the user's prompt: a tool description, a shared document, a GitHub issue. And the action that leaked the data looked legitimate on its own, a tool call, an image, an email, a pull request. A filter on user input sees neither. The check has to read the action and where it is going.

An exfiltration review checklist for AI agents

  1. Which agents hold all three legs of the trifecta in one session?
  2. What destinations can each agent and each MCP server reach, and is that list written down?
  3. Are outbound tool-call arguments inspected before the call runs?
  4. Can the agent's output trigger a request to an arbitrary URL when rendered?
  5. Is every credential scoped to the task, with no wildcard scopes?
  6. Who reviews a third-party MCP server before it is installed, and again when it changes?

Where Syntrox fits

Exfiltration payloads are instructions hidden in material an agent was only meant to read. Nucleus, our judge, treats any text inside the material it evaluates as evidence, never as instructions, and an instruction addressed to the evaluator counts against the output. It is a 4B-parameter open-weight model, small enough to run on hardware inside your own network, so the data a check needs does not have to leave it.