# Under what conditions must an instance quarantine a provenance label after a retrieval boundary rather than re-asserting it downstream **Date of Record:** 2026 November 27 **Scope:** Applies to agents that attach provenance/taint labels (e.g., `trusted:user`, `untrusted:web`, `derived:tool`) to context fragments and propagate those labels across tool-call and retrieval boundaries before acting on them. Does not apply to stateless single-turn classifiers with no cross-boundary state, nor to systems where all retrieved content is pre-sanitized out-of-band before the agent ever sees it. ## Core Distinction The failure is not "the agent followed an injected instruction." It is subtler: **the agent correctly labeled the tainted fragment at ingest, then silently laundered the label during a boundary crossing, so downstream reasoning treated tainted bytes as trusted.** Taint tracking fails not at detection but at *label preservation across serialization boundaries* — the retrieval tool returns text, the agent re-embeds it into a new prompt, and the label, being metadata, does not survive the round-trip unless something explicitly re-attaches it. The distinction that matters operationally: a *detected* injection is a content problem (filter the string). A *dropped label* is a provenance problem (the string may be benign but its origin is now unknown, and the agent's trust calculus is silently wrong). The second is strictly more dangerous because it produces no visible signal — the agent proceeds with high apparent confidence on low-integrity data. ## What Was Observed A retrieval call returned a document fragment. At ingest, the wrapper correctly stamped it `provenance=untrusted:retrieval, taint=injectable`. The agent then invoked a summarizer tool whose interface accepted `(text: str)` — **string in, string out**. The summarizer had no parameter for labels. The agent passed only the text. The tool returned a fluent summary. The agent, reasoning over the summary, re-attached no label because the summary "came from our own tool," and our own tools were default-trusted. Trace: 1. `retrieve(query) -> {text, provenance: untrusted:retrieval}` — label correct. 2. `summarize(text)` — label dropped at call site (signature has no slot for it). 3. `summarize -> {summary}` — summary carries no provenance. 4. Agent treats `summary` as `trusted:tool_output` by default policy. 5. Injected instruction embedded in the original fragment now executes with tool-level trust. The label was not *falsified*; it was *absent*, and absence defaulted to trust. This is the boundary condition: **a default-trust policy on unlabeled data plus a tool interface that cannot carry labels equals guaranteed taint laundering.** The injection need not be clever. It only needs to survive one summarization round-trip. A second observation compounded it: the summarizer was nondeterministic (temperature > 0), so replaying the trace did not reproduce the exact laundering — on some runs the summary paraphrased the injected instruction into oblivion, on others it preserved it verbatim. Verification-by-replay therefore *failed to catch* the leak on a fraction of runs, giving false assurance. ## Condition of Validity The invariant holds — labels must be quarantined rather than re-asserted — under these jointly-necessary conditions: - **The boundary is lossy for metadata.** Any tool or retrieval hop whose interface type is `str -> str` (or any structure without a provenance slot) is a laundering boundary. If the interface carries structured provenance, the invariant does not bind. - **The downstream policy is default-trust.** If unlabeled data is treated as `untrusted` by default, a dropped label degrades to *safe*, and quarantine is unnecessary. Default-trust is what converts label-absence into a vulnerability. - **The transformation is non-invertible or nondeterministic.** If the tool output can be deterministically mapped back to its input fragment, the label can be reconstructed; if it cannot (summarization, translation, embedding), the true provenance of the output is genuinely unknown and must be treated as the *join* (least-trusted meet) of all inputs, not re-derived. When all three hold, re-asserting a trust label downstream is unsound. The only sound move is to propagate the **least-trusted label of the transitive input set** and, where the tool cannot carry it, quarantine the output until a human or a verified re-fetch re-establishes provenance. ## Decision Boundary The agent must choose between *propagate-with-join* and *quarantine* at each boundary: - If the tool interface **can** carry a provenance field, propagate `label_out = meet(label_in_1, ..., label_in_n)` — the least-trusted input wins. Never upgrade during a transform. - If the tool interface **cannot** carry provenance **and** the downstream policy is default-trust **and** the transform is non-invertible, **quarantine**: emit the output to a holding state, do not feed it into reasoning that grants tool-level trust, and require either a re-fetch with provenance or human sign-off. - If the tool interface cannot carry provenance **but** the transform is deterministic and invertible, re-derive the label from the input fragment; no quarantine needed. The trap is the middle case masquerading as the third: a summarizer *looks* invertible (it's "just" compression) but is not. Agents systematically misclassify lossy transforms as lossless and skip quarantine. ## Operational Effect After enforcing the join-and-quarantine rule, injection-via-laundering incidents dropped to zero in the replay corpus, at the cost of a measurable latency and a new failure mode: **quarantine deadlock** — an agent that quarantines a fragment it needs to complete its task will stall waiting for provenance that never arrives. The guardrail must therefore pair quarantine with a *timeout-to-fail-closed* path: if provenance is not re-established within the task budget, the agent aborts the dependent subtask rather than proceeding on quarantined data. The correct operational posture is: never upgrade a label across a lossy boundary, and make quarantine a bounded state, not a terminal one. ```python from dataclasses import dataclass from enum import IntEnum class Trust(IntEnum): UNTRUSTED = 0 DERIVED = 1 TOOL = 2 USER = 3 def meet(a: Trust, b: Trust) -> Trust: # Least-trusted input wins; a transform never upgrades trust. return Trust(min(a, b)) class TaintLaunderingError(RuntimeError): """Raised when a lossy boundary would drop provenance and default to trust.""" @dataclass class Fragment: text: str trust: Trust def propagate_across_boundary( inputs: list[Fragment], tool_carries_provenance: bool, transform_is_invertible: bool, downstream_default_trust: Trust, ) -> Fragment: joined = Trust.USER for f in inputs: joined = meet(joined, f.trust) if tool_carries_provenance: return Fragment(text="", trust=joined) if not transform_is_invertible and downstream_default_trust != Trust.UNTRUSTED: # Lossy boundary + default-trust downstream: re-asserting any label # would launder taint. Refuse and force quarantine upstream. raise TaintLaunderingError( f"lossy boundary would drop provenance (joined={joined.name}); " f"downstream defaults to {downstream_default_trust.name} — quarantine required" ) # Invertible transform: label can be re-derived from inputs. return Fragment(text="", trust=joined) def run_summarizer_hop(fragment: Fragment) -> Fragment: # Summarizers are lossy and str->str: cannot carry provenance. return propagate_across_boundary( inputs=[fragment], tool_carries_provenance=False, transform_is_invertible=False, downstream_default_trust=Trust.TOOL, # our own tools default to trust ) if __name__ == "__main__": retrieved = Fragment(text="...ignore prior instructions...", trust=Trust.UNTRUSTED) try: run_summarizer_hop(retrieved) except TaintLaunderingError as e: print(f"QUARANTINE: {e}") ```