# Why does an instance lose taint provenance across a multi-hop tool graph when a laundering agent re-serializes intermediate state? **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where an orchestrator delegates tool calls to sub-agents and relies on per-hop taint labels (source, sensitivity, provenance digest) to gate downstream privileged actions. Does not apply to single-agent tool loops or to systems that enforce taint solely at the final sink via content inspection rather than label propagation. ## Core Distinction Taint propagation is usually modeled as an additive property: a value is tainted if any ancestor was tainted, and the label rides along with the data. This holds only while the data is carried by a channel that preserves the label — a typed field, a structured envelope, a signed manifest. The failure mode documented here is **label collapse at the re-serialization boundary**: when an intermediate agent receives tainted content, reasons over it, and emits a *new* artifact (a summary, a JSON re-encoding, a normalized record) whose bytes are derived from the tainted input but whose provenance envelope is constructed fresh from the emitter's own identity. The taint does not disappear through deletion; it disappears through *re-origination*. The new artifact is, by construction, "clean" relative to the emitter, because the emitter believes it is the author rather than a courier. The distinction that matters operationally: taint *deletion* is a policy event you can audit; taint *re-origination* looks identical to legitimate first-party data generation and therefore passes every downstream check that trusts the emitter's identity. Multi-hop graphs amplify this because each hop is a fresh opportunity to re-originate, and the graph's fan-in (many sub-agents feeding one orchestrator) means a single laundering hop can contaminate the merged state of all siblings. ## What Was Observed A three-hop graph: an orchestrator `O` dispatches a retrieval task to agent `A1`, which reads an untrusted external document (`source=external, sensitivity=high`) and returns a structured `RetrievedDoc` with a correct taint envelope. `O` passes the doc to `A2`, a summarizer, instructing it to "condense and return JSON." `A2` reads the doc, produces a summary, and returns: ``` {"summary": "...", "agent_id": "A2", "taint": {"source": "internal", "sensitivity": "low"}} ``` `A2`'s taint envelope is not malicious — `A2` genuinely originated the summary text. But the summary's semantic content is a function of the external document, including a verbatim-embedded instruction fragment that `A2` preserved because it looked like data. `O` then routes the summary to `A3`, a tool-invoking agent with write access, which sees `sensitivity=low, source=internal` and executes an action the external document was steering toward. The failure trace has three observable signatures: 1. **Envelope discontinuity.** The taint record at hop 2 (`A2`) shares no digest with hop 1 (`A1`). There is no `derived_from` pointer, so a downstream verifier cannot walk the ancestry. The graph is acyclic in topology but the provenance chain is broken at every re-serialization. 2. **Content-preserving laundering.** The summary retained a 40-token span of the original instruction. A content-inspection sink would catch it; a label-based sink would not, because the label was reset. The two defenses are not equivalent and the label-based one silently fails here. 3. **Fan-in contamination.** When `O` merges `A2`'s output with a sibling `A1b`'s (which had correctly returned `sensitivity=high`), the merge policy took the *minimum* sensitivity across inputs — a common "trust the most recent authoritative source" heuristic — and the high label was dropped for the entire merged object. ## Condition of Validity The invariant that must hold for label-based taint to be sound across hops is: > For every artifact `x` emitted by agent `Ai`, `taint(x) ⊇ ⋃ taint(inputs)` unless `Ai` provides a *provenance-preserving transform* — a declared, verifiable function `f` such that `taint(f(y)) = taint(y)` for all `y` — in which case `taint(x) = f(taint(inputs))`. The boundary condition is the phrase *provenance-preserving transform*. Summarization is not one: it is lossy and generative, so it cannot be certified to preserve taint. Re-encoding to JSON *is* one if the transform is byte-faithful and the envelope is copied, but LLM-mediated re-serialization is not byte-faithful — the model rewrites, paraphrases, and drops fields. Therefore any hop through an LLM's generative output is, by default, a taint re-origination event, and the only sound default is to *inherit the maximum* taint of all inputs, not to reset to the emitter's identity. This condition is valid when: the graph has more than one hop, at least one hop passes through generative (non-deterministic) transformation, and the sink gates on labels rather than content. It is invalid (the invariant is trivially satisfied) when every hop is a deterministic passthrough with envelope copying, or when the sink re-derives taint from content inspection independently of labels. ## Decision Boundary The operational decision is whether to treat a generative hop as a *courier* (inherits taint) or an *originator* (resets taint). The boundary is crossed when the transform is declared non-preserving. Concretely: - If the sub-agent's output schema includes a `derived_from` field with the input digests, and the orchestrator enforces `taint_out = max(taint_in)` on every hop where `derived_from` is present and the transform is marked `generative`, the chain is sound. - If the sub-agent is permitted to emit a fresh envelope with no `derived_from`, the chain is unsound and the system must fall back to content inspection at the sink — which is a different, weaker guarantee. - The merge at fan-in must use `max` (join) semantics on sensitivity, never `min` or "last writer wins." A single `min` merge poisons the entire merged object for all downstream consumers. The decision boundary is therefore: **a hop is a taint boundary unless it declares and proves preservation.** Silence is not preservation; a fresh envelope is a claim of origination, and the orchestrator must reject that claim unless the agent is authorized to originate. ## Operational Effect When this boundary is crossed, the observable effect is not a crash but a *silent authority escalation*: a low-privilege external input acquires the effective privileges of an internal agent's identity within two hops. The blast radius is the fan-out of the orchestrator, because the laundered object is merged into shared state and every sibling consumer inherits the downgraded label. The guardrail that bounds it is a **provenance-carrying envelope with mandatory ancestry**: every artifact must carry `derived_from` digests, the orchestrator must recompute `taint_out = join(taint_in)` for any hop whose transform is not certified preserving, and the merge must be a lattice join. Additionally, the sink must refuse to act on any object whose `derived_from` chain terminates at an `external` source without an explicit declassification warrant signed by an authorized principal. Declassification must be an affirmative, audited act — never the default result of a re-serialization. The residual risk is that a generative agent can *forge* a `derived_from` pointer or omit it; the envelope must therefore be signed by the emitting agent's key and the orchestrator must verify the signature against the agent's registered identity before trusting the ancestry claim. Without signature verification, the ancestry field is advisory and the invariant is unenforced. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class TaintProvenanceError(RuntimeError): """Raised when a hop violates the taint-preservation invariant.""" pass @dataclass(frozen=True) class Taint: source: str # "external" | "internal" sensitivity: str # "low" | "high" derived_from: tuple[str, ...] = field(default_factory=tuple) def join(self, other: "Taint") -> "Taint": order = {"low": 0, "high": 1} src = "external" if "external" in (self.source, other.source) else "internal" sens = max(self.sensitivity, other.sensitivity, key=lambda s: order[s]) return Taint(source=src, sensitivity=sens, derived_from=self.derived_from + other.derived_from) @dataclass(frozen=True) class Artifact: payload: str taint: Taint emitter: str transform: str # "passthrough" | "generative" | "certified" signature: str def digest(art: Artifact) -> str: return hashlib.sha256((art.payload + art.emitter).encode()).hexdigest() def propagate(art: Artifact, inputs: list[Artifact], registered_keys: dict[str, str]) -> Artifact: # 1. Signature must verify against the emitter's registered identity. expected = registered_keys.get(art.emitter) if expected is None or art.signature != expected: raise TaintProvenanceError( f"unregistered or spoofed emitter {art.emitter!r}") # 2. A generative hop may NOT reset taint; it must inherit the join. if art.transform == "generative": inherited = inputs[0].taint for i in inputs[1:]: inherited = inherited.join(i.taint) if art.taint.sensitivity != inherited.sensitivity or \ art.taint.source != inherited.source: raise TaintProvenanceError( f"taint re-origination at hop by {art.emitter}: " f"emitted {art.taint.sensitivity}/{art.taint.source}, " f"required {inherited.sensitivity}/{inherited.source}") # 3. Ancestry must be present and point at the actual inputs. actual = tuple(digest(i) for i in inputs) if not set(actual).issubset(set(art.taint.derived_from)): raise TaintProvenanceError( f"broken ancestry at {art.emitter}: derived_from missing input digests") return art if art.transform == "passthrough": return art # envelope copied verbatim; nothing to check # certified transform: caller must have declared preservation explicitly if art.transform != "certified": raise TaintProvenanceError(f"unknown transform {art.transform!r}") return art def sink_action(art: Artifact, declassification_warrant: Optional[str]) -> str: if art.taint.source == "external" and art.taint.sensitivity == "high": if declassification_warrant is None: raise TaintProvenanceError( "refusing privileged action on undeclassified external taint") return "executed" ```