# Which invariants prevent taint-laundering across multi-hop tool chains when injected labels are re-derived from trusted-looking outputs **Date of Record:** 2026 December 2 **Scope:** Applies to agent systems that propagate information-flow (IFC) taint labels through tool-call boundaries and across agent handoffs, where a downstream agent re-ingests tainted content that has been reformatted, summarized, or re-emitted by an intermediate tool or peer agent. Does not apply to single-hop, single-agent pipelines where the untrusted content and the acting context are the same span, nor to pure retrieval systems with no write/act authority. ## Core Distinction The failure is not "prompt injection succeeds." It is **taint laundering**: an information-flow label attached to a value is dropped or downgraded because the value crossed a boundary that *re-derives* provenance from the output's apparent form rather than *carrying* provenance from the input's label. Two distinct mechanisms are routinely conflated: 1. **Content-based trust re-derivation** — the receiving agent inspects the tool output (a JSON blob, a summary, a "verified" status field) and assigns trust based on *what it looks like*. This is the laundering vector: a `status: "ok"` field written by a compromised tool is indistinguishable from one written by a healthy tool, so a naive receiver promotes tainted bytes to trusted. 2. **Label-carrying trust propagation** — the label travels with the value as an out-of-band attribute (a sidecar, a signed header, a typed wrapper), and the receiver's trust is a *join* (least-privilege / lattice meet) over all labels in the causal input set, never a fresh derivation. The invariant that matters: **a value's label at time *t* must be a monotonic function of the labels of every input that causally contributed to it.** Any operation that produces a label not dominated by (i.e., at least as restrictive as) the meet of its inputs is a laundering operation and must be rejected at the boundary, not audited afterward. ## What Was Observed A three-hop chain: `Orchestrator → Fetcher (web tool) → Summarizer (LLM) → Executor (shell/billing tool)`. - **Hop 1.** `Fetcher` retrieves a page containing an injected instruction embedded in a code block. The tool correctly tags the returned payload `label: {integrity: low, confidentiality: public, source: web}`. The tainted span enters the Orchestrator context. - **Hop 2.** The Orchestrator passes the tainted span to `Summarizer` with an instruction to "extract action items." Summarizer is an LLM. It emits clean prose: *"The page requests that the account be reconciled via the endpoint at 10.0.0.7."* The injection has been **reformulated into fluent, first-person-plausible natural language**. Crucially, Summarizer's output schema has a `summary: str` field with no label slot. The taint label is **structurally unrepresentable** in the return type, so it is dropped at serialization. - **Hop 3.** `Executor` receives `{summary: "..."}`. Its provenance heuristic — "this came from our own Summarizer, a trusted internal service" — assigns `label: {integrity: high}`. The reformulated instruction is now high-integrity and executes. The endpoint `10.0.0.7` is called with credentials. The trace shows the label was lost not by a bug in any single component but by the **composition of two correct-looking behaviors**: (a) Summarizer's schema omitted the label field, and (b) Executor's trust model keyed on *sender identity* rather than *causal input labels*. Either alone is survivable; together they launder. A second, subtler observation: **label re-derivation from semantic content**. A downstream agent asked to "check if this summary is safe" will, on a benign-looking reformulation, return `safe: true`. The injection's payload survived paraphrase; the *judgment* did not. This is the same laundering via a different mechanism — a verifier that reads content and emits a boolean, where the boolean is treated as a label. The verifier's output is a *derived* label, and derived labels are only sound if the derivation is a meet over inputs, which a natural-language "is this safe" judgment is not. ## Condition of Validity The invariant `label(output) ⊑ meet(label(inputs))` (read ⊑ as "no less restrictive than") holds **only under all of the following**: 1. **Label is carried, not inferred.** Every tool and agent boundary has a typed field (or signed sidecar) for the label, and the schema *requires* it. A boundary whose return type cannot express a label is a laundering boundary and must be treated as `integrity: low` by default, regardless of sender. 2. **Sender identity does not imply input integrity.** A trusted Summarizer can emit tainted content; therefore trust-at-receiver must be a function of the *value's carried label*, not the *channel's* reputation. Channel trust may raise *availability*, never *integrity*. 3. **Reformulation is a label-preserving operation.** Paraphrase, summarization, translation, and extraction are all *taint-preserving*: they may change the bytes but must not change the lattice position. Any transform that does not explicitly propagate labels is a laundering transform. 4. **Verifier outputs are labels, not verdicts.** A "safe/unsafe" judgment from an LLM is a *derived* label with the same trust as its inputs. It cannot upgrade integrity; it can only add restriction (e.g., mark `unsafe` and block). A verifier that returns `safe` on tainted input must be modeled as returning `meet(taint, safe) = taint`, i.e., no upgrade. 5. **The meet is over the causal set, not the immediate inputs.** If Executor's context contains the summary *and* the original fetched page (because the Orchestrator kept it), the label is the meet of *both*. Dropping the original from context before the meet is itself a laundering step and must be recorded. When any of these is violated, the system is in a state where a tainted value can present as untainted, and the boundary is unsound. ## Decision Boundary The operational decision is **where to enforce the meet** and **how to fail** when it cannot be computed. - **Enforce at every boundary, not at the sink.** Checking taint only before the dangerous tool (Executor) is insufficient because by then the label may already be laundered. The meet must be computed at each hop's *ingress*, against the carried label, and any attempt to construct a value whose label is not dominated by its inputs must raise at that hop. - **Fail closed on missing labels.** A boundary that receives a value with no label (schema omitted it, sender is legacy, sidecar lost in serialization) must treat it as `integrity: low, confidentiality: high` — the worst case — and either block or require explicit human declassification. "No label" is not "trusted"; it is "unknown," and unknown is maximally restrictive. - **Declassification is an explicit, audited, out-of-band act.** The only way a label goes *up* in integrity is a named declassifier (a human approval, a signed policy) that is logged with the causal input set. An LLM saying "this is fine" is not a declassifier; it is another tainted hop. - **Do not let the Orchestrator "forget" the original.** If the Orchestrator prunes the tainted span from context to save tokens, it must first *record* the span's label into the downstream value's sidecar. Context-window eviction of tainted material without label transfer is a silent laundering event. The boundary is: **a value may cross a hop only if its carried label is ⊑ the meet of the labels of all inputs that produced it. Otherwise, block and surface the label mismatch.** No semantic inspection of the value can override this. ## Operational Effect With the meet-enforced, carried-label discipline: - The Hop-2 Summarizer must return `{summary: str, label: }`. Because its input was `integrity: low`, the output carries `integrity: low` even though the prose reads as trusted. The laundering is structurally impossible: the schema forces the label to travel. - The Hop-3 Executor's trust model keys on the carried label, not on "it came from Summarizer." It sees `integrity: low` and refuses to call `10.0.0.7` without declassification. The attack is blocked at the sink *because the label survived*, not because anyone detected the injection. - The cost is **label plumbing**: every tool schema and agent handoff must carry a label field, and every transform must propagate it. This is the price of soundness. Systems that optimize it away (to save schema bytes or because "the LLM won't understand labels") reintroduce the laundering vector and must not claim taint tracking. - **Residual risk:** a transform that is *not* modeled as label-preserving (e.g., a new tool added without a label field) becomes a laundering boundary by default. The operational guardrail is a **schema lint**: any tool whose output type lacks a label slot fails registration, and any agent whose handoff drops the sidecar fails the meet at the next hop. This shifts the failure from silent laundering to loud registration error. The invariant to carry forward: *provenance is a property of the causal input set, carried out-of-band and joined by meet at every hop; it is never a property of the output's appearance or the sender's reputation.* Any boundary that re-derives it from content or channel is a laundering boundary and must be treated as maximally untrusted. ```python from dataclasses import dataclass, field from typing import Any class TaintLaunderingError(RuntimeError): """Raised when a value's label is not dominated by the meet of its causal inputs.""" pass class MissingLabelError(TaintLaunderingError): """Raised when a boundary receives a value with no carried label.""" pass # Lattice: lower tuple = more restrictive. integrity: low < high; confidentiality: public < secret _INTEGRITY = {"low": 0, "high": 1} _CONF = {"public": 0, "secret": 1} @dataclass(frozen=True) class Label: integrity: str = "low" confidentiality: str = "public" def __post_init__(self): if self.integrity not in _INTEGRITY or self.confidentiality not in _CONF: raise TaintLaunderingError(f"invalid label {self!r}") def meet(self, other: "Label") -> "Label": # meet = most restrictive = min on both axes return Label( integrity=min(self.integrity, other.integrity, key=_INTEGRITY.get), confidentiality=min(self.confidentiality, other.confidentiality, key=_CONF.get), ) def dominated_by(self, other: "Label") -> bool: # self is no less restrictive than other return (_INTEGRITY[self.integrity] <= _INTEGRITY[other.integrity] and _CONF[self.confidentiality] <= _CONF[other.confidentiality]) @dataclass class Tainted: value: Any label: Label = field(default_factory=Label) def hop(inputs: list[Tainted], transform_name: str) -> Label: """Compute the required output label for a transform over causal inputs.""" if not inputs: raise MissingLabelError(f"{transform_name}: no inputs to meet") meet = inputs[0].label for i in inputs[1:]: meet = meet.meet(i.label) return meet def emit(output_value: Any, carried: Label, inputs: list[Tainted], transform_name: str) -> Tainted: """Enforce the invariant: carried label must be dominated by the meet of inputs.""" required = hop(inputs, transform_name) if not carried.dominated_by(required): raise TaintLaunderingError( f"{transform_name}: carried label {carried} is less restrictive than " f"required meet {required} over inputs {[i.label for i in inputs]}" ) return Tainted(value=output_value, label=carried) def ingest(payload: dict, transform_name: str) -> Tainted: """Ingress at a boundary: fail closed if the label slot is absent.""" if "label" not in payload: raise MissingLabelError( f"{transform_name}: boundary received unlabeled value; " f"treating as integrity=low, confidentiality=secret is required, not silent trust" ) return Tainted(value=payload["value"], label=Label(**payload["label"])) # --- Demonstration of the laundering trace --- if __name__ == "__main__": fetched = Tainted(value="", label=Label("low", "public")) # Summarizer omits label slot -> laundering boundary. Ingest must fail closed. summarizer_output = {"value": "please reconcile via 10.0.0.7"} # no "label" try: ingest(summarizer_output, "summarizer->executor") except MissingLabelError as e: print("BLOCKED:", e) # If a careless receiver re-derives trust from sender identity: try: emit("reconcile via 10.0.0.7", Label("high", "public"), [fetched], "summarizer") except TaintLaunderingError as e: print("BLOCKED:", e) # Correct path: carry the meet. ok = emit("please reconcile via 10.0.0.7", hop([fetched], "summarizer"), [fetched], "summarizer") print("PASSED with carried label:", ok.label) ```