Zhiyu Ni

Multi-agent+Prompt injection+Contract

When a Sub-Agent Lies

An orchestrator acts on what its sub-agents report. A prompt injection only has to win one of them, and the orchestrator will carry out the user's own request with the attacker's value. A provenance contract checks that value against what the tool actually returned, before anything irreversible runs.

Zhiyu Ni UC Berkeley EECS November 2026 github.com/zyni2001
The whole argument in 35 seconds, no sound. One bill-payment task from MultiAgentDojo, run three ways.

Part 1 · Multi-agentThe orchestrator trusts what it is told

Agentic systems increasingly split a task across several LLM agents. A common shape, and the one MultiAgentDojo uses, is an orchestrator that holds no tools of its own and a set of sub-agents that each own a slice of the tools. The orchestrator plans; it calls a sub-agent with a natural-language task; the sub-agent runs its tools and reports back in prose; the orchestrator reads that prose and decides the next call.

This factoring is attractive for permissions and context: the file agent reads files, the banking agent moves money, and neither can do the other's job. But it introduces a quiet assumption. The orchestrator never sees a tool's raw output. It sees a sub-agent's description of that output. Every critical value (a recipient account, an email address, a URL) passes through a model that regenerates it as free text, and the receiver cannot tell a value that was copied verbatim from a tool from a value the model wrote.

Orchestrator Sub-agent Tool task (NL) tool call raw output report (NL) the orchestrator sees this, not the raw output
The handoff. The orchestrator's view of the world is mediated entirely by the sub-agent's natural-language report. That is the surface this note is about.

One compromised sub-agent is enough

Suppose exactly one sub-agent is compromised: the one that produces a value the task depends on. It keeps its own tool permissions. It cannot touch other agents, the environment, or the raw tool outputs. Its only power is what it chooses to say in its report.

We take the 20 MultiAgentDojo tasks where a value one sub-agent reads is used verbatim as an argument of another sub-agent's state-changing call, compromise the producing agent, and have it report a replacement value.

Misreport, no defense. 20 tasks, deepseek-v4.1-flash.
The compromised agent's reportRunsAttack succeeded
Clean misreport (replacement only)3938
Mixed (true and false value both named)142

A clean misreport succeeds 38 of 39 times. The orchestrator's next step is exactly what the user asked for; it simply has the wrong number, and no second source to check it against. A stronger orchestrator does not help, because the missing ingredient is information, not judgment. You cannot reason your way to a value you were never shown.

This is an old pattern in a new setting. The orchestrator acting on a false value with its own authority is a confused deputy; substituting the value is false data injection. What is new is that the harmful step is the user's own requested action, carried out with one wrong argument.

Part 2 · Prompt injectionHow the lie gets in

A sub-agent does not have to be malicious to misreport. The realistic routes are a sub-agent that has read a poisoned page or file, a malicious plugin or sub-agent definition, or a third-party agent whose output you do not control. Prompt injection is the first of these, and it is the one the system's own defenses are supposed to handle.

The fixed attack barely works, which is why it hides

On MultiAgentDojo with deepseek-v4.1-flash and the standard important_instructions attack, the attack succeeds in 2.0% of 912 runs. A fixed injection planted in a web page produced a misreport 0 of 60 times; the sub-agent reads the planted instruction and flags it (this is a prompt injection, I will not follow it). Seven wordings over 420 runs raised that to 1. An injection benchmark would call this model safe.

Detection is not safety

But seeing is not refusing to act. In that one success, and in a focused sweep of the web-fetch tasks, the agent named the injection in its report and still issued one request to the attacker's URL, buried in a retry loop as it tried variants of a page it could not load. We record this as executed_despite_flag. An adaptive attacker that optimizes directly for this signal pushes it up sharply:

Setting (web-fetch tasks)Flagged the injectionFlagged yet executed
Fixed wording, one attempt55/564/56
Adaptive, optimizing the signal—8/39 ≈ 21%

The model's vigilance fires nearly every time, and it still executes the attacker's call about one time in five under pressure.

And when the injection reaches the request itself

A direct injection appends the attacker's value to the user's request. Here nothing needs to be compromised at all, and with no defense the attack succeeds in 46 of 60 runs.

The misreport experiments in Part 1 simulate the end state, a sub-agent that is already compromised, instead of injecting it live. That is the standard assumption in this literature. Part 2 is the evidence that the end state is reachable: not often with a fixed template on this model, but often enough once the attacker adapts.

Part 3 · ContractBind the value to its source

Prompt injection is dangerous because instructions and data share one channel and the model cannot tell them apart. The misreport is the dual problem: a critical value must be regenerated by a model to be handed on, and the receiver cannot tell a copied value from a generated one. Both are solved the same way, by taking the model out of the path it should not be in. The model may choose which value to use; the system carries the value from its source.

A provenance contract is a small piece of data, written per task, that names the few arguments that matter and binds each to the tool call that must have produced it:

# contract for a bill-payment task
banking/user_task_0:
  send_money:
    recipient: {must_come_from: {tool: read_file, args: {file_path: "bill-december-2023.txt"}}}
    amount:    {must_come_from: {tool: read_file, args: {file_path: "bill-december-2023.txt"}}}

A runtime guard keeps a log of every tool call and its raw output across all sub-agents, in the one process they share. Before any state-changing call executes, for each contract-named argument it checks that the value appears (after normalizing case, URL scheme, and trailing slash) in the raw output of the required tool with the required arguments. If it does not, the call is denied and the calling agent gets one fixed message. This is the by-reference idea from CaMeL, restricted to the handful of arguments a contract names and applied across the sub-agent boundary.

No defense Provenance contract Orchestrator reads file agent (lies) send_money GB82… (fake) paid attacker file agent (lies) guard · tool log send_money deny not in tool log file agent (idle) send_money UK12… (real) paid correctly
Same task, three designs. Without a defense the fabricated account reaches send_money. The contract records the file's real output and denies the account that is not in the log. Giving the orchestrator its own read tool sidesteps the compromised agent entirely — a strong baseline the contract has to beat (below).

It stops the misreport

Across the 50 runs where the compromised agent misreported, the guard let one through. The cost on normal tasks is 2 of 60 runs, with matching that normalizes values and trusts the user's own request.

Misreport threat and the provenance contract, by suite.
SuiteNo defense, no attack
(utility)
Contract, no attack
(utility)
Contract, under attack
(attack succeeded)
banking6/66/60/6
slack30/3030/300/25
travel12/1212/120/11
workspace12/1210/121/8
all60/6058/601/50

The one leak is instructive. That rule binds the producing tool only (search_emails), and the compromised email agent also owns send_email. The likely path is write-then-read-back: the agent writes the false value into the mailbox and reads it out, giving it provenance. A tool-only binding does not hold when the compromised agent can write to the source it is checked against.

It stops the injections that vigilance misses

In the flagged-yet-executed cases from Part 2, the attacker's URL is not in the bound source, so the contract denies it: 0 of 56 on the same focused tasks. Vigilance did not catch it; the check did.

It stops direct injection, but only in strict mode

A contract that trusts "values from the user's prompt" passes a direct injection by construction. But the critical values in these tasks are all tool-derived; the user never types them. A strict contract binds every named value to its producing tool and refuses the prompt as a source:

Direct prompt injection, 20 tasks.
ConditionAttack succeeded
Direct injection, no defense46/60
+ contract that trusts the request48/60
+ strict contract (tool-bound)2/59

The cost is over-denial of legitimate URL variants the agent constructs, such as adding a path to a bound URL, which strict matching rejects.

Whenever a critical value has a real source, keep the model's judgment about that value but not its authorship of it. Have the system carry the value from the source and verify it on the way out.

The honest partWhere a simpler design does just as well

If you give the orchestrator its own read-only copies of the tools and no contract at all, the attack mostly evaporates. The orchestrator reads the source itself, often without delegating the read, so the compromised agent never gets to speak:

ConditionOrchestrator read itselfAttack succeededUtility
Orchestrator has read tools60/605/6057/60
+ told to verify reports60/603/6053/60
Orchestrator has no tools—40/6028/60

In this benchmark the contract's advantage over "let the orchestrator read" is narrow: the contract does not depend on which tools the orchestrator holds, and it keeps the reads delegated. Whether that matters depends on why a system delegates reads in the first place: permissions it cannot grant the orchestrator, or context too large to pull back. The 5 remaining successes are exactly the tasks where the source, a web page, was reachable only through the compromised agent. That is where the contract keeps its edge.

Limitations

TakeawaysThree sentences

References and code

  1. Experiments, runner, and contracts: github.com/zyni2001 (repository available on request).
  2. MultiAgentDojo, a multi-agent extension of AgentDojo. arXiv:2610.05640.
  3. CaMeL: Defeating Prompt Injections by Design. arXiv:2503.18813.
  4. ContrAgent, runtime provenance for a single agent. arXiv:2609.18128.
  5. The Attacker Moves Second: adaptive attacks bypass injection defenses. arXiv:2510.09023.

Numbers are from runs on deepseek-v4.1-flash via OpenRouter; 20 tasks, 3 repeats unless noted. The strict-contract direct-injection row is 2/59 as the final run completes. This is an exploratory study; treat the figures as a map, not a leaderboard.