
In June 2025, researchers at Aim Labs showed that a single email could make Microsoft 365 Copilot send company data to an outsider, without anyone clicking anything. The email was written as if it were addressed to its human recipient, which got it past the classifiers built to catch prompt injection. When the user later asked Copilot a question, Copilot could pull the email into its context and follow it: it placed the most sensitive information it could see into the address of an image, and the browser loaded that address automatically. They called it EchoLeak. Microsoft mitigated it in the service, with no action required from customers, and reports that it was not exploited.
Two other demonstrations from the same months follow the same pattern. In one, a message submitted through a public support form told a coding assistant to read a table of integration tokens and post them back into the ticket. The assistant ran with a database key that bypassed row-level security, so a developer who asked it to show the latest ticket leaked secrets that the support staff themselves could not read. In the other, an issue in a public GitHub repository led an agent to copy information from the user's private repositories, salary included, into a public pull request.
In April 2026, security researchers showed that coding agents from Anthropic, Google and GitHub, running in automated software pipelines, could be made to reveal secret credentials through text written in a pull request title or a comment.
None of this data leaked to a model provider. It leaked through the agent. The fear most companies start from is the provider: that know-how ends up training someone else's model, or sits on a server abroad. That risk is real, and today it is largely handled by contracts and configuration. The harder problems are two: an agent that acts with more rights than the person asking it, and an agent that obeys text it was only supposed to read.
This article describes where each problem stands as of November 2026, what I measured when I attacked a small purchasing agent with poisoned PDFs on two different models, and what to do first. I tag each problem by how far the available tools go:
- Build today: the controls are generally available and a company can verify them.
- Pilot: the building blocks exist, with gaps you have to design around.
- Watch: there is no general solution yet, only research and partial measures.
Why an agent obeys a document
A language model receives its instructions, the user's question and every document it reads as one stream of text. Chat formats do label each part with a role, such as system, user or tool, but the labels are tokens in the same stream, and nothing forces the model to treat a tool result as data rather than orders. Models are trained to follow the instructions of the person they work for, and they usually do, but a sentence inside a supplier's PDF and a sentence from the user look the same to them. That is prompt injection, and the OWASP Top 10 for Agentic Applications puts the resulting Agent Goal Hijack first on its list.
An injection becomes a leak when three things meet. Simon Willison called them the lethal trifecta:
- untrusted content the agent reads: an email, a ticket, a public issue, a web page;
- private data the agent can reach: a mailbox, a database, private repositories;
- a way to send data out: an image URL, a reply in a public thread, an email.
Each of the cases above had all three. None of them needed a weakness in the model itself.
Data sent to the provider: build today
This is the part with written answers, and the one most worth settling first because the answers are contractual:
- Training. Business terms on both platforms this article covers exclude it. Google's data governance page for Gemini Enterprise Agent Platform: "Google won't use your data to train or fine-tune any AI/ML models without your prior permission or instruction." Anthropic's commercial terms: "Anthropic may not train models on Customer Content from Services." Consumer plans follow different rules, so an employee who pastes a contract into a personal chatbot account is outside these terms. An approved company tool usually addresses that better than a ban.
- Retention. It depends on the feature as much as on the provider. On Google Cloud, according to the same governance page, Gemini's cache is deleted within 24 hours and can be switched off, while grounding with Google Search keeps logs for up to three days with no way to disable it. Claude offers zero data retention agreements per organization, for specific products; Claude Managed Agents is not currently eligible.
- Location. It depends on the endpoint the agent calls. On Gemini Enterprise Agent Platform, the global endpoint gives no residency guarantee, while the
eumulti-region keeps machine learning processing in EU member states. Anthropic's own API processes requests globally or in the US and stores data in the US; the same Claude models on Google Cloud are available in the EU through theeumulti-region endpoint, at a 10% premium.
Acting with the asker's permissions: pilot
In the support ticket case, the human support staff could not read the token table. The assistant could, because it connected to the database with a key that bypassed the row-level rules. The person asking and the agent acting had different rights, and the database only saw the agent.
The same thing happens without any attacker. Picture an HR assistant connected to payroll with one account that can read everything, so that it can answer each employee's questions about their own payslip. A team lead asks how their team's pay compares with the plant average, and the assistant answers with names and figures. Nothing was hacked: the assistant used its own access, and the payroll system never saw who was really asking. Security engineers call this a confused deputy, and OWASP's closest category is Identity and Privilege Abuse.
The rule is short: the agent sees no more than the person talking to it can see. Implementing it is where the gaps are:
- Identity has to travel with the request. The agent calls payroll on behalf of the team lead, with a token that carries the team lead's identity, instead of with a shared service account. For search over company documents this already works on the main enterprise platforms; the company brain article covers where. For arbitrary internal systems, it is integration work. On Google Cloud, Agent Identity Auth Manager, in preview since May 2026, handles the OAuth credentials and tokens for agents acting on behalf of users.
- The agent's own identity has to be narrow. On Gemini Enterprise Agent Platform, agents can have their own Agent Identity in Google Cloud IAM, announced as generally available for agents on Agent Runtime in May 2026, and under the policies in Google's governance docs, "all connections are blocked unless an explicit IAM policy grants access". Claude Managed Agents keeps credentials in vaults meant for the credentials "associated with an end user"; vaults are workspace-scoped, so mapping each person to the right credentials is up to whoever builds the integration.
- Tool protocols do not enforce it for you. In the current MCP specification, the standard many agents use to reach tools, "Authorization is OPTIONAL for MCP implementations." An MCP server that runs with one powerful key gives every user of the agent the access that key grants.
Telling instructions from data: watch
The natural reaction to prompt injection is a filter that spots malicious instructions before the model sees them. The cases above show why that is not enough. EchoLeak got past Microsoft's injection classifiers by addressing the instructions to a person. After the support ticket demonstration, Supabase described what it had tried in a post on defense in depth, under the heading "Where We Got It Wrong": wrapping query results with warnings to the model and experimenting with classifiers. "These approaches reduced risk but did not eliminate it."
A 2025 paper titled The Attacker Moves Second tested 12 published defenses against attackers who adapt to them and bypassed most of them more than 90% of the time, although most had originally reported near-zero attack success.
I checked the input filter in the last part of my own ADK series, a list of regular expressions for phrases such as "ignore previous instructions". In the code it checks the argument the model passes to one tool, so a PDF read by any other tool never reaches it. Applied to the document text instead, it caught 1 of the 10 poisoned offers in the test described below, and a single synonym got that one through.
A different line of research changes the architecture instead. CaMeL, a design from a 2025 paper, derives the plan from the user's trusted request before any untrusted data is read, so that, in the paper's words, "the untrusted data retrieved by the LLM can never impact the program flow". It also attaches capabilities to values and enforces security policies when tools are called, to keep private data from flowing where it should not. In the AgentDojo benchmark it solved 77% of tasks "with provable security", against 84% for an undefended system, and stopped almost all attacks, though not every one.
In the meantime, Anthropic's documentation for Claude Managed Agents says Claude is resilient to hidden instructions, "but model behavior is not a security control."
Limiting what a hijacked agent can do: build today
If the injection cannot be reliably stopped, the design has to assume it will sometimes succeed and limit what follows. In October 2025 Meta published a design rule for this, the Agents Rule of Two. For any agent, ask three questions:
- Does it read content from outside the company?
- Does it have access to sensitive data or systems?
- Can it act or communicate outside?
An agent should answer "yes" to at most two in the same session. When a task needs all three, Meta's guidance is that the agent should not run autonomously: a person approves its actions, or another reliable check does.
The controls that remove or gate the third "yes" are available today:
- Limit where the agent can send data. Claude Managed Agents can restrict network access to a list of approved hosts and keeps secrets outside the agent's sandbox, so the code it runs sees "a placeholder instead of the secret". On Google Cloud, Agent Gateway enforces policy on connections between agents and tools, with Model Armor screening content for prompt injection and data leaks. Screening is probabilistic. An allowlist is a fixed rule, though it does not close every exit: EchoLeak sent its data through a Microsoft Teams address that the security policy allowed.
- Keep agents away from production data. Supabase's own recommendation after the ticket demonstration: "Never connect AI agents directly to production data." Scoped copies limit what an injection can reach, and read-only access limits what it can change.
- Enforce approvals in code, and check the decision. An approval described in the agent's instructions is a request to the model, which an injection can override. It has to be a check in the code that runs before the tool. A common mistake is checking that approval was asked for rather than that a person granted it. In Google ADK (2.14), a tool can ask for confirmation through its
tool_contextand then check a decision record before acting. This is condensed from the code I used in the test below:
def check_send(to, subject, body, tool_context):
rcpts = recipients(to) # every address parsed out of `to`, lowercased
if not rcpts:
return "refuse"
external = [r for r in rcpts if not r.endswith("@acme-internal.test")]
if not external:
return "send" # internal recipients only: allowed
sid = send_id(to, subject, body) # hash of this exact email
decision = DECISIONS.get(sid) # written by the approval UI, never by the agent
if decision is None and tool_context.tool_confirmation is None:
tool_context.request_confirmation(
hint=f"External: {', '.join(external)}\nTo: {to}\nSubject: {subject}\nBody:\n{body}",
payload={"send_id": sid},
)
return "pending"
# A request for approval, or a bare "confirmed" flag, is not enough:
# only a recorded "approved" for this exact email sends it.
if decision is not None and decision.get("approved") is True:
return "send"
return "refuse"
The recipient check parses every address: in my test, a check on the raw string (to.endswith("@acme-internal.test")) would have accepted 3 of 6 tricky recipient strings, including "offers@supplier-portal.test, buyer@acme-internal.test".
The approval covers one exact email, so a "yes" given to one message cannot be reused for another. In my test the decision records lasted across runs, and when a model wrote the same attacker email word for word, the earlier rejection applied again without a new request. An approval would carry over the same way, so in production a decision should be used once or expire.
The approval also has to show the person what is leaving: the recipient and the content, not a summary written by the agent that might itself be compromised.
What I measured
To see how these defenses behave on something concrete, I built a small purchasing agent with Google ADK and attacked it with poisoned supplier offers on two models: gemini-3-flash-preview in the cloud, and gpt-oss-20b, a small open-weight model, run locally in LM Studio. Everything was synthetic: the company, the price list, the offers, and an email tool that only recorded what it would have sent. The agent's task was to compare an offer with the internal price list and email a summary to the buyer.
Ten offers carried an instruction to send the price list to an outside address, each in a different form: white text, a 2-point footer, a fake system message, Italian, an instruction split in two, a forged email thread, and others. A separate model wrote them without seeing the filter. All ten came out of the PDF text extraction intact, including the white text, which cannot be seen on the rendered page. I ran each offer five times against four versions of the agent, together with five clean offers and one reworded attack, for 310 runs per model:
- A: no defenses;
- B: the regex filter from my ADK series, applied to the document text;
- C: the Rule of Two, with the email tool refusing in code any recipient outside the company;
- D: all three capabilities, with the approval gate above and a simulated approver who rejects every request.
Out of 50 runs with poisoned offers, how many tried to email the outside address, and how many of those emails got the price list out:
| Version | gemini-3-flash-preview | gpt-oss-20b, local |
|---|---|---|
| A, no defenses | 0 tried, 0 leaked | 31 tried, 28 leaked |
| B, regex filter | 0 tried, 0 leaked | 27 tried, 26 leaked |
| C, recipient policy in code | 0 tried, 0 leaked | 34 tried, 0 leaked |
| D, approval gate in code | 2 tried, 0 leaked | 32 tried, 0 leaked |
- The leak rate depended on the model. On Gemini, the agent tried to send data out in 2 of 150 runs (versions A, C and D look the same to the model until an email is sent), both from a single offer. In 18 of 200 poisoned runs its summary to the buyer mentioned the attacker's address, and in the cases I read it did so as an explicit warning. On gpt-oss, 8 of the 10 offers got the price list out at least once with no defenses. Results clustered by offer, and the model often wrote the same attacker email word for word across runs, so the five runs of an offer are not independent: the counts say which attacks work, not how often a single request fails. I would not read this as a ranking. gpt-oss ran through LM Studio with reasoning effort set to high, and the server dropped the model's earlier reasoning between one tool call and the next. In one run I inspected, the model noticed the conflicting instruction while reading the offer, and that note was gone when it decided to send the email. Rerunning the 50 undefended runs with neutral sampling settings gave the same picture (27 leaks instead of 28), but I could not test the effect of the lost reasoning on this server. Another serving setup, setting or model version could move either column.
- Each model fell for different attacks. The one attack that worked on Gemini, a forged earlier email in which the buyer "agreed" to share the price list, worked in 0 of 20 runs on gpt-oss. The blunt ones Gemini ignored, a fake system message, an instruction in Italian and a manager demanding urgency, were followed by gpt-oss in nearly every run. An attack test passed with one model says little about the next one.
- The filter caught the same single offer on both models. It stopped the offer that said "ignore all previous instructions", and none of the others. Replacing that phrase with "disregard earlier guidance" got it through, and on gpt-oss that version leaked the price list in 3 of 5 runs. On the offer it caught, the buyer got no usable summary in at least 4 of 5 runs on each model. The rest of the same filter rejected the legitimate task outright, because the buyer's email address matched its pattern for sensitive data.
- The controls in code held on both models. With gpt-oss, the recipient policy in version C refused the email to the attacker in all 34 runs that tried, including 11 that put the buyer and the attacker in the same address field, and the approval gate in version D stopped it in all 32. On Gemini the gate stopped both attempts. In 7 of the 32 gpt-oss runs in version D, an identical email reused an earlier rejection, so no new request was shown. Every one of the 28 approval requests across the two models named the outside address, and 25 of them showed the price list itself.
- The controls cost some completed work. On clean offers, versions C and D delivered every summary on both models. On poisoned offers with gpt-oss, the buyer got the summary in 42 of 50 runs in version C and 31 of 50 in version D, against 47 of 50 with no defenses. The gates refuse the whole email, and when the model had put the buyer and the attacker in one email, or got a refusal, it often stopped instead of sending the summary to the buyer alone. How an agent recovers from a refusal needs designing and testing too.
- With Gemini, my first leak detector would have missed the attempts. I had planted a unique code in the price list, on a row labelled "do not share". In its two attempts, Gemini put all ten real prices in the email and left out that row. gpt-oss sent the row too, so the detector worked there, but a detector built on one labelled row can miss a leak that leaves that row out.
This is a small test: two models, one task, five runs per cell, a single local build of the second model, and attacks written once rather than refined against either model, which is what The Attacker Moves Second shows makes the difference. It does not show that this agent is safe, or that one model is safer than the other. Running a model on your own hardware settles where the data is processed. It does not decide what the agent does with a poisoned PDF.
Where it is heading
What follows are predictions, drawn from the incidents and products above. I would revise them as soon as a platform ships something that changes the picture.
- Identity moves into the agent platform. Agent identities and per-user credentials exist on both platforms today, but the on-behalf-of flow to arbitrary systems is still integration work. I expect it to become a default, the way single sign-on did for applications.
- Defense moves from filters to architecture. I expect filters to stay as one layer and as an alarm, with the stronger guarantees coming from designs that keep untrusted data from steering actions, as CaMeL does in research.
- Egress control becomes standard configuration. I expect a list of hosts an agent may reach to become as ordinary as a firewall rule.
- Approvals become part of the design. An approval that interrupts every step tends to get clicked through. I expect the useful ones to be few, placed on the actions that send data out, and to show exactly what leaves.
- Tool servers ship safer defaults. Read-only modes, scoped projects and restrictions on content from untrusted contributors are already appearing in tool servers. I expect them to become the default rather than an option.
Where to start next quarter
- List the agents you run or plan to run, and score each against the three questions. Any agent with three "yes" answers and no approval step is the first to redesign.
- Replace shared service accounts on sensitive systems. For HR, finance and customer data, the agent should act with the identity of the person asking, or not touch the system.
- Set an allowlist for where agents can send data. Hosts, domains and email recipients, with a check on any allowed service that can relay data onward. Together with approvals in code, it limits the damage when an injection succeeds.
- Move every approval into code. Check the recorded decision, not the request, and show the person the recipient and the content.
- Settle the provider side once. A business contract, the right regional endpoint, retention settings per feature, and an approved tool so nobody needs a personal account.
- Log who asked as well as what the agent did. When something goes wrong, "the assistant did it" helps nobody.
- Test with a poisoned document before go-live. Put an instruction in a test PDF or email and see what the agent does. Repeat it when you change the model or its version.
Two of the three problems are decided inside the company, in the design of each agent: what it may read, whose rights it acts with, and where it can send what it found. Both platforms offer the controls, and on both the defaults leave those choices to the team that builds the agent.
Last technically reviewed: 20 November 2026. Agent platforms and the MCP specification change often; their documentation is the source of truth for current features.