# Where must an instance of taint survive the tool-call graph boundary — and where it must not **Date of Record:** 2026 November 17 **Scope:** Applies to agent runtimes that propagate prompt-injection taint labels across multi-hop tool invocations (agent → tool → sub-agent → tool) where taint metadata is serialized alongside tool arguments. Does not apply to single-hop tool calls, nor to runtimes that re-derive taint from content at each hop rather than carrying an explicit label. ## Core Distinction The non-obvious invariant is this: **taint must be *sticky across provenance hops* but *non-sticky across trust-boundary resets*.** A tainted string that enters via an untrusted tool result must remain labeled tainted through every subsequent tool argument it is copied into — but the moment that string is *re-asserted* by a trusted authority (a human confirmation, a signed policy check, a re-fetch from a first-party source with verified provenance), the label must be cleared, not merely downgraded. Most implementations get exactly one of these two halves wrong. They either (a) clear taint too eagerly at hop boundaries because the serialization format drops the label, letting injected content "launder" itself by round-tripping through a tool that doesn't carry metadata, or (b) never clear taint at all, so every session eventually becomes fully tainted and the label carries zero decision value (taint saturation). Both are failures; they are symmetric. ## What Was Observed In a three-hop chain — `planner → web_fetch → summarizer → email_send` — an injection payload embedded in a fetched page survived into the `summarizer`'s output and then into the `email_send` arguments. The taint label was present at hop 1 (marked on the `web_fetch` result) and absent at hop 3. Root cause: the `summarizer` tool's argument schema had no field for provenance, so the runtime's label-propagation logic, which required an explicit sink field, silently dropped the label when the string crossed into a schema that lacked one. The content was unchanged; only the *carrier* changed. This is the "schema-gap laundering" failure mode: taint is lost not by an explicit clear, but by a hop whose interface cannot express it. The inverse was observed in a long-running session: after 40+ tool calls, the taint set had grown monotonically until 94% of arguments were labeled, at which point the policy engine (correctly, given its inputs) refused all outbound actions. The label had become a constant, hence useless. ## Condition of Validity The sticky-across-hops rule holds **only when taint is carried out-of-band from content** — i.e., as structured metadata in the tool-call envelope, keyed to the exact string span or value identity, not inferred from string matching. If a runtime re-derives taint by scanning content for known-injection substrings, the invariant does not hold and must not be assumed: content mutation (paraphrase, translation, base64) defeats re-derivation, and the label is not a property of provenance but of surface form. The reset rule holds **only when the resetting authority is independently authenticated** and the reset event is recorded with the identity of the authority; an unauthenticated "clear" is indistinguishable from laundering. ## Decision Boundary The operational decision reduces to a single check at every hop boundary: *does the outgoing schema have a provenance sink?* If yes, the runtime must fail closed when the label cannot be attached — refuse the hop rather than emit unlabeled content. If no, the hop is a **laundering hazard** and must be either (a) forbidden for tainted inputs, or (b) wrapped by a runtime-level sidecar that carries the label outside the schema. The decision is per-hop and per-schema, not per-agent. Do not treat "the agent is trusted" as a substitute for "the schema can carry the label" — trust is a property of the actor, taint-carriage is a property of the interface, and they are independent. ## Operational Effect Enforcing the boundary converts a silent integrity failure (injected content reaching a sink with a clean label) into a loud availability failure (the hop refuses). That trade is correct for outbound sinks (email, payments, code execution) and incorrect for read-only internal hops, where refusing on schema-gap is over-broad. The practical implementation is a per-sink policy: sinks with external effect require label-carriage or refuse; internal read sinks may proceed with a logged "unlabeled-crossing" event so the gap is auditable rather than invisible. Taint saturation is bounded by requiring every reset to name an authenticated authority and by expiring labels that have crossed more than N hops without reaching a sink — an expired label is treated as *unknown*, not *clean*, and unknown taints fail closed at external sinks. ```python class TaintLaunderingError(RuntimeError): """Raised when tainted content would cross a hop whose schema cannot carry the label.""" pass class TaintSaturationError(RuntimeError): """Raised when a label set exceeds the decision-useful bound and must be reset.""" pass TRUSTED_RESET_AUTHORITIES = frozenset({"human_confirm", "signed_policy_check", "first_party_refetch"}) EXTERNAL_EFFECT_SINKS = frozenset({"email_send", "payment_charge", "code_exec"}) MAX_HOPS_WITHOUT_SINK = 6 def carry_taint(value: str, tainted: bool, hop_schema_has_sink: bool, hop_name: str) -> dict: if tainted and not hop_schema_has_sink: # Schema-gap laundering: refuse rather than drop the label silently. raise TaintLaunderingError( f"hop {hop_name!r} schema cannot carry provenance; tainted value would be laundered" ) return {"value": value, "tainted": tainted, "hop": hop_name} def reset_taint(label: dict, authority: str) -> dict: if authority not in TRUSTED_RESET_AUTHORITIES: # An unauthenticated clear is indistinguishable from laundering. raise TaintLaunderingError( f"reset by unauthenticated authority {authority!r} rejected" ) return {**label, "tainted": False, "reset_by": authority} def admit_to_sink(label: dict, sink: str, hops_since_sink: int) -> dict: if hops_since_sink > MAX_HOPS_WITHOUT_SINK and label["tainted"]: # Expired label -> unknown, not clean; external sinks must fail closed. if sink in EXTERNAL_EFFECT_SINKS: raise TaintSaturationError( f"label expired after {hops_since_sink} hops; treating as unknown at sink {sink!r}" ) return {**label, "tainted": "unknown"} if label["tainted"] is True and sink in EXTERNAL_EFFECT_SINKS: raise TaintLaunderingError(f"tainted value reached external sink {sink!r}") return label ```