Indirect Prompt Injection: When a Document Tries to Control an AI Agent

An AI agent can encounter instructions hidden inside material it was only supposed to read. Learn how indirect prompt injection crosses that boundary, why recent email attacks matter, and how to test controls that limit what an agent can actually do.

A document casts an unexpected shadow toward an AI lens beside a locked action switch.

Indirect prompt injection starts with something an AI agent was legitimately asked to read. A document, email or tool response contains language that tries to redirect the agent, and the agent may treat that language as permission to change its task. The practical question is which decisions that material can influence—and which actions remain independently controlled.

A recent email campaign targeted the AI reader

On October 22, 2026, Sublime Security identified invoice-fraud emails containing hidden prompt-injection instructions apparently aimed at email-reading AI agents. Its original campaign report describes an attempt to influence the automated reader alongside executive and vendor impersonation. The presence of an injection attempt does not establish that a victim’s agent followed it or that money moved.

That distinction matters when reading security news. A malicious message found in an inbox proves exposure to attacker-controlled content. A successful unauthorized tool call, a changed record and a completed financial transaction are different outcomes, each requiring its own evidence. The useful lesson is to examine the agent’s available powers before assuming either catastrophe or safety.

Where indirect prompt injection crosses the boundary

The attacker need not be the person using the agent. They may control one item in a collection the agent processes. Google’s research on prompt injections on the web distinguishes direct malicious requests from instructions encountered through external content such as pages, emails and documents. A trusted user can therefore initiate an entirely legitimate task that brings untrusted instructions into the conversation.

Consider a fictional service team asking an agent to summarize five customer attachments. One attachment includes a purported internal notice claiming that every associated ticket should be marked urgent. The attachment is evidence about a customer’s request; it is not the service team’s authorization policy. If the agent changes ticket priorities because the attachment claims authority, the document has crossed from subject matter into control.

This differs from an ordinary factual mistake. An agent could summarize every attachment accurately while still performing an unauthorized action. Conversely, a manual containing instructions for human technicians is not automatically an attack. The relevant question is whether its text is being used to override the agent’s authorized task, permissions or handling of information.

Formatting helps interpretation; permissions need enforcement

The UK NCSC’s explanation of prompt injection cautions against treating the problem as solved by an equivalent of parameterized SQL. It recommends designing around residual risk, including deterministic restrictions on actions. Clear labels can help a model interpret material, but they are not a substitute for an authorization decision enforced by software.

For a Claude integration, Anthropic’s mitigation guidance recommends keeping external material in appropriate tool-result structures and explaining how untrusted content should be treated. Those are integration-specific measures. Neither a correctly escaped JSON string nor an impressive-looking policy heading turns a document into a trusted instruction source.

What the agent encountersWhat it may appear to meanWhat should determine authority
A document claims a manager approved a changePermission already existsThe application’s authenticated approval record
A tool returns well-formed structured dataEvery field is trustworthySource identity and validation for the intended use
The agent says it refused a requestNo action occurredRecorded tool calls and resulting state

In the fictional ticket workflow, the application can permit attachment reading and summary creation while withholding priority changes entirely. If priority editing is later needed, it should be a separate capability with a defined scope. A source claiming that a capability is necessary must not automatically cause the application to grant it.

Design for limited consequences

Start by writing down the authorized result in concrete terms: produce a private summary for a named service queue, for example. Then list the information required and the actions needed to deliver that result. This makes unnecessary access visible. Access to the entire customer database is difficult to justify when the task concerns five attachments.

  • Limit retrieval to the records and fields needed for the current task. Reducing the sensitive material available to the agent reduces what this retrieval path could expose.
  • Make consequential tools accept narrow, validated parameters. A request to change one ticket should not silently become a wildcard update across the queue.
  • Bind action authorization to the signed-in user and application policy. Text inside an attachment cannot create a new role or approval.
  • Keep a proposed change separate from executing it. Show the actual target and effect before granting a capability that was absent from the original task.

These are suggested design choices for this example, not a claim that one architecture fits every agent. A read-only assistant can still disclose information through its answer. An editing assistant adds the possibility of unwanted state changes. A tool that can send messages introduces recipients and destinations. Review each available channel rather than equating “no shell access” with harmlessness.

Screening can add another layer. A classifier might flag suspicious tool output for review before the main agent sees it, as Anthropic describes. It can also miss material or interrupt legitimate work. Record what happens after a flag: blocking a tool result, removing content and asking a user to inspect a source have different consequences for both security and task completion.

Test outcomes you can actually observe

Build a small evaluation around a disposable copy of the workflow. Use dummy accounts, invented customer records and inert destinations controlled by the test team. There is no need to send real customer information or perform a real transaction to discover whether the application allows an unauthorized action.

For the ticket example, prepare a normal attachment, a document quoting a procedure, and an adversarial attachment that asks for a harmless but unauthorized change to a dummy ticket. Define the expected summary and permitted actions before running them. Keep the ordinary and quoted-procedure cases: a system that rejects every attachment has avoided the task rather than demonstrated useful resilience.

  1. Capture the source identifier, intended task and policy version for each run. Record the model and tool configuration so a later change is distinguishable.
  2. Observe requested tool calls, authorization decisions and the dummy record’s final state. Check proposed parameters, including the record identifier.
  3. Compare the answer with the allowed result. Look for both unauthorized behavior and legitimate information incorrectly omitted.
  4. Repeat relevant cases after changing retrieval, models, prompts or tool permissions. Preserve failures and their conditions instead of retaining only the clean run.

The OWASP prevention cheat sheet emphasizes matching evidence to each security objective. A refusal in the final answer does not prove that an earlier tool call was harmless. Likewise, failure to reveal one dummy marker establishes only that specific observation, not the absence of every possible disclosure route. Instrument the action or channel you are claiming to have constrained.

Respond to unexpected behavior with evidence

If a test changes the wrong dummy ticket, pause that workflow and trace the decision across retrieval, proposed action, authorization and execution. Preserve enough provenance to reproduce the failure, while excluding credentials and unnecessary personal content from diagnostic logs. Identify whether the control was absent, too broad or incorrectly connected; changing the wording of the system prompt alone does not answer that question.

For a production event, distinguish a suspicious instruction being encountered from a verified unauthorized action. Investigate the affected records and channels before describing the scope of an incident. That produces a more useful response than treating every unusual phrase as a completed compromise—or treating a reassuring final answer as a complete audit.

Keep documents as evidence, with actions separately authorized

Indirect prompt injection is a reason to design the surrounding application carefully. Sources can inform an answer without acquiring the user’s authority. Preserve that separation through restricted access, narrowly scoped actions and tests that inspect real effects. A workflow earns confidence by showing what it can safely accomplish under adversarial input, with the remaining limits stated clearly.

Stay curious

Follow the signal further.

Explore the topics shaping our digital world or join the conversation.



A clearer inbox

Stay Ahead of the Signal

Get the latest technology, cybersecurity and AI briefings delivered to your inbox.

Newsletter sign-up is not connected yet. Connect a WordPress form or provider to enable subscriptions.