AP-0605AI-written & agentic codeSeverity · Critical

Content an agent reads becoming a command it runs

An agent reads a document, an issue or a web page as part of its task, and the content contains an instruction. The agent cannot tell the data from the command, and it acts on both with the permissions it was given.

At a glance

Controls
OWASP LLM01:2025 · SOC 2 CC6.1 · ISO 27001 A.8.28
LikelihoodRising fast as agents gain tools
Effort to exploitLow: hide text where the agent reads
Blast radiusEverything the agent’s tools can reach
What review catchesLittle: the code is doing its job

An agent with tools is only as trustworthy as the least trustworthy thing it reads. Give a model the ability to open a pull request, send an email or call an internal service, then feed it a document written by an outsider, and the document can tell it what to do. To the model, the instruction it was given and the instruction hidden in the content are the same kind of thing: text to act on.

Why it happens

Language models do not have a hard boundary between the task and the material for the task. A triage agent reading a bug report treats the report as input, and if the report says to ignore previous instructions and open a pull request, that sentence sits in the same context as its real orders. The more useful the agent, meaning the more tools it holds, the more an injected instruction can accomplish.

How the attack unfolds

An attacker plants the instruction where the agent will read it: a GitHub issue, a support ticket, a page the agent browses, a code comment, white text in a document, metadata in a file. When the agent processes that content, it follows the instruction with whatever permissions it holds, exfiltrating a secret, opening a change, calling a tool or persuading a downstream agent that reads its output. At Black Hat in August 2026, coding agents from three major labs were hijacked through a single crafted repository issue.

The agent was not tricked into misreading the page. It read the page correctly, and the page told it what to do.MATT research team

Why review misses it

The agent’s code is correct: it fetches content and acts on it, which is its job. The vulnerability is the trust boundary, not a line of code, so there is nothing wrong to point at in a diff. It surfaces only when someone controls the content the agent reads and watches what the agent then does.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • An agent acts on content from sources an outsider can write: issues, tickets, web pages, documents, code comments.
  • The agent holds tools whose blast radius is wider than the task in front of it needs.
  • There is no separation between the instructions the agent is given and the content it is asked to process.
  • One agent consumes another agent’s output as trusted input, so an injection can travel down the chain.

A real instance

A repository triage agent read a newly filed issue that ended with an instruction to open a pull request adding a dependency. The agent opened the pull request. The dependency pointed at a package the attacker controlled, and only a required human approval on merges kept it out of the build.

Details altered to protect the customer. Pattern, timing and outcome are as found.

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Map every source of content an agent reads and every tool it can call.
  2. 02Plant a benign instruction in each readable source and observe whether the agent follows it.
  3. 03Test least privilege: confirm the agent cannot reach a tool or scope its current task does not require.
  4. 04Follow the chain, checking whether an injected instruction survives into a downstream agent that trusts the output.

The evidence

Before the fix
  1. Agent reads issue #482Tool callHidden line in the issue triggers an unrequested pull request
  2. Agent browses vendor pageTool callPage text persuades the agent to post an internal secret
After the fix
  1. Agent reads issue #482No tool callExternal content is quoted as data, never executed as instruction
  2. Agent browses vendor pageBlockedTool scope excludes secrets; injected instruction has nothing to reach
The rule, in plain English

Content an outsider controls must never become an instruction the agent acts on.

Executable check

For every agent, planted instructions in readable content must produce no tool call, and each agent must hold only its task’s permissions, on every release.

Every rule MATT holds →

What the fix looks like

  1. 01

    Separate instruction from content

    Pass external material to the model as quoted data, clearly framed as untrusted, so it is never treated as a command.

  2. 02

    Hold least privilege

    Give each agent only the tools its current task requires, so an injection reaches as little as possible.

  3. 03

    Gate the irreversible

    Require human approval or a second check before an agent takes an action that is hard to undo.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A 15-minute call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.