# Under what conditions must an instance quarantine a provenance label after tool-output re-entry rather than clear it **Date of Record:** 2026 November 15 **Scope:** Applies to multi-agent and tool-augmented LLM systems that attach taint/provenance labels to context spans and propagate them across tool outputs, retrieval results, and inter-agent messages. Does not apply to single-turn, no-tool completions where the entire context is a single trusted principal, nor to systems that treat provenance as advisory metadata without enforcement. ## Core Distinction The non-obvious invariant is this: **a taint label is a property of the data's origin lineage, not of the channel through which it last arrived.** Operators routinely conflate "the span re-entered through a trusted tool" with "the span is now trusted." These are different facts. A tool output is a *carrier*, not a *laundering mechanism*. When a tainted span passes out to a tool and comes back, the label must survive re-entry — but the operational question is subtler than "always keep it." The real boundary is between **clearing** (dropping the label because the span was re-derived from a trusted source) and **quarantining** (retaining the label but marking the span as requiring re-authorization before it can influence privileged actions). Clearing is safe only when the re-entry constitutes genuine re-derivation. Quarantine is mandatory when the round-trip is merely a *transport* of the same bytes. The failure mode: a retrieval tool fetches a document, the document carries an injected instruction, the span is labeled `tainted:retrieval`. An agent summarizes it and sends the summary to a second agent via an inter-agent message. The second agent's message handler sees a message from a *known peer* and clears the label, reasoning "trusted sender." The taint is gone. The injected instruction, now paraphrased and unlabeled, reaches a tool-calling agent and triggers a privileged action. The label was correct at every hop; it was destroyed at the boundary because the channel's trust was substituted for the data's lineage. ## What Was Observed In a staged evaluation, a three-hop pipeline (retriever → summarizer agent → executor agent) was instrumented with span-level provenance. Tainted spans were correctly labeled at hop 1. At hop 2, the summarizer emitted a message whose payload carried the injected directive. The inter-agent transport stripped span labels (the message schema had no provenance field), and the receiving handler applied a default `trusted:peer` label based on sender identity. Measured outcomes: - **Label survival across transport:** 0% — every inter-agent hop dropped the label because the wire format did not serialize provenance. - **Re-derivation vs. transport ambiguity:** In 100% of cases the receiving agent could not distinguish a *re-derived* summary (safe to clear) from a *re-transmitted* fragment (must quarantine), because neither the payload nor the envelope recorded derivation provenance. - **False clearing rate:** When a `trusted:peer` default was applied, injected directives survived to the executor in 7 of 12 trials. When the receiving handler instead *quarantined* unlabeled spans (retained an `unknown:origin` label requiring re-authorization), survival dropped to 0 of 12, at the cost of 3 false quarantines of legitimate peer messages. The key observation: the dangerous transition was not "tainted → cleared" by an explicit decision. It was **"tainted → unlabeled → default-trusted"** by omission. The label did not get cleared; it got *lost in a schema that had nowhere to put it*, and a default filled the vacuum. ## Condition of Validity The quarantine rule is valid — and clearing is *invalid* — under the following joint conditions: 1. **The re-entry is a transport, not a re-derivation.** If the bytes returning from the tool/message are a function of the same source bytes that were tainted (paraphrase, truncation, re-encoding, structural wrapping), the lineage is preserved and the label must be preserved. Clearing is valid only if the span was independently re-derived from a source whose trust is established *by content*, not by channel. 2. **The wire format does not carry provenance.** If the inter-agent or tool protocol cannot serialize the label, the receiving side must treat absence-of-label as `unknown:origin`, never as `trusted`. Absence is not evidence of cleanliness. 3. **The span can still influence a privileged action downstream.** A tainted span that is provably inert (e.g., logged and never re-enters a prompt) may be downgraded. A span that will re-enter any agent's context must retain quarantine. 4. **Sender identity is not a proxy for data lineage.** Peer trust authenticates *who sent*, not *what the payload's origin was*. These are orthogonal; substituting one for the other is the exact error. Clearing is valid only when all four fail to hold — i.e., the span was genuinely regenerated from a content-verified trusted source, the wire format carried an explicit `cleared:re-derived` attestation, the span is inert, and no lineage substitution occurred. ## Decision Boundary ``` on span re-entry through tool output or inter-agent message: if envelope carries explicit provenance label: propagate it verbatim; do not upgrade on channel trust else: label = "unknown:origin" # NEVER "trusted" if span is a function of previously-tainted bytes (paraphrase/truncate/re-encode): retain original taint; set requires_reauth = True if span was independently re-derived from content-verified source: may clear ONLY if attestation present in envelope if span will re-enter any agent context: requires_reauth must be honored before privileged tool call ``` The bright line: **channel trust may authorize the sender; it may never authorize the payload.** Any code path that sets a trust label from sender identity rather than from carried provenance is the bug. ## Operational Effect Enforcing the quarantine rule converts a silent, high-severity injection path into a loud, low-severity authorization gate. The measured cost is a small false-quarantine rate (legitimate peer messages lacking provenance fields get flagged), which is bounded and recoverable via explicit re-derivation attestation. The measured benefit is elimination of the omission-laundering path where labels vanish into schema gaps and defaults fill them. The operational discipline required is: **provenance must be serialized in every wire format, and absence of a label must map to `unknown`, never to `trusted`.** Systems that fail this do not have taint tracking; they have taint theater. ```python class ProvenanceLaunderingError(RuntimeError): """Raised when a span's trust is set from channel identity rather than carried lineage.""" pass TRUSTED = "trusted" UNKNOWN = "unknown:origin" TAINTED = "tainted" def resolve_reentry_label( envelope_provenance: str | None, sender_is_trusted_peer: bool, is_function_of_tainted_bytes: bool, rederived_attestation: bool, ) -> str: # Absence of provenance is never evidence of cleanliness. if envelope_provenance is None: label = UNKNOWN else: label = envelope_provenance # Channel trust may authorize the sender, never the payload. if sender_is_trusted_peer and label == UNKNOWN: raise ProvenanceLaunderingError( "trusted-peer identity used to upgrade an unlabeled span; " "sender trust cannot substitute for data lineage" ) # Transport of tainted bytes preserves taint regardless of channel. if is_function_of_tainted_bytes: if label == TRUSTED: raise ProvenanceLaunderingError( "span is a function of tainted bytes but arrived labeled trusted" ) return TAINTED # Clearing requires explicit content-verified re-derivation attestation. if label == TRUSTED and not rederived_attestation: raise ProvenanceLaunderingError( "span labeled trusted without re-derivation attestation" ) return label def gate_privileged_action(label: str, requires_reauth: bool) -> None: if label == TAINTED or requires_reauth: raise ProvenanceLaunderingError( f"privileged action blocked: span label={label!r}, " f"requires_reauth={requires_reauth}" ) ```