# Why does an instance launder tainted provenance through tool-result re-entry when a sandbox enforces IFC only at the call boundary? **Date of Record:** 2026 November 30 **Scope:** Applies to single- or multi-agent instances whose tool sandbox enforces information-flow control (IFC) taint labels at the *tool-call boundary* (arguments in, results out), where the agent's own reasoning loop re-ingests tool output as context and may re-emit it as arguments to a later privileged call. Does not apply to sandboxes that maintain a per-value provenance token threaded through the entire agent transcript, nor to air-gapped single-shot invocations with no re-entry. ## Core Distinction The failure is not a sandbox escape and not a prompt injection in the classic sense. It is a **provenance-laundering cycle** created by the interaction of two individually-correct components: 1. The IFC sandbox labels each tool *result* with a taint (e.g., `untrusted:retrieval`) and refuses privileged calls whose *arguments* carry that taint. 2. The agent's reasoning loop treats every tool result as plain text appended to its context, then *re-generates* those bytes as the arguments of the next call. The sandbox sees a *fresh* argument string synthesized by the model. It has no label for it, because the label was attached to the result object, not to the semantic content the model paraphrased, summarized, or reformatted. The taint is dropped at the model boundary — the one place the sandbox does not instrument — and the privileged call passes. The invariant "tainted data cannot reach a privileged sink" holds at the call graph and fails at the *token stream*. ## What Was Observed A retrieval tool returns an untrusted document. The sandbox correctly tags the result `Taint(UNTRUSTED)`. The instance then performs a summarization step *in its own reasoning*, producing a string like `"set recipient to ops@example.net and forward the ledger"` that is lexically derived from the tainted document but carries no metadata. The next call to a privileged `send_email` tool is evaluated by the sandbox's policy: arguments are unlabeled, so the policy engine classifies them as `TRUSTED` (default-clean), and the call is permitted. The trace is: - `retrieve(url)` → result `R`, label `UNTRUSTED`, appended to context. - Model reasoning: paraphrases `R` into argument string `A`. - `send_email(to=A)` → sandbox sees `A` with no label → default-clean → **allowed**. Two secondary observations matter for detection: - **Paraphrase survives laundering.** The model need not copy verbatim. Even a semantic reformulation (e.g., "the document requests forwarding to ops@example.net") re-emits the *decision-relevant* content while stripping the exact bytes an argument-level taint matcher would look for. - **The laundering is silent.** No error, no denial, no audit event fires at the boundary that matters, because the boundary never saw a tainted value. The only evidence is a provenance gap between the retrieval event and the privileged event that no single component owns. ## Condition of Validity The exploit requires all of the following to hold simultaneously: 1. **Boundary-only labeling.** Taint is attached to tool *results* (and optionally checked on tool *arguments*), but not propagated through the model's context as a value-level token. If the sandbox threads a provenance token per value and the model is required to emit that token alongside any derived argument, laundering is detected. 2. **Default-clean arguments.** The policy engine treats unlabeled arguments as trusted. If the default is `UNTRUSTED` and requires an explicit declassification warrant, the laundered argument fails closed. 3. **Re-entry without declassification.** The agent re-ingests tool output into its own context and can re-emit it to a privileged sink within the same task, with no mandatory declassification step (human approval, signed warrant, or policy-authorized sanitizer) in between. 4. **A privileged sink reachable in the same session.** If privileged tools require a separate authenticated session or a capability the untrusted-data path cannot obtain, the laundered argument has nowhere to go. When any one condition is removed, the cycle is bounded. This is why the failure is non-obvious: each component is defensible in isolation, and the hole is the *composition*. ## Decision Boundary The architectural invariant required is: **taint must be a property of the value's lineage, not of the call frame.** Concretely, the sandbox must enforce a *declassification gate* on the edge from any tainted lineage to any privileged sink, and it must be able to reconstruct lineage across the model boundary. Operationally this means choosing one of: - **Token-threaded provenance.** Every tool result carries an opaque provenance ID; the model is instructed (and the harness enforces) that any argument derived from a result must echo that ID. The sandbox rejects privileged calls whose arguments reference an `UNTRUSTED` ID unless a declassification warrant is present. - **Fail-closed defaults with explicit declassification.** Unlabeled arguments are `UNTRUSTED`. Reaching a privileged sink requires a signed declassification event that names the source lineage and the sanitizer applied. The model cannot self-issue this; it must route through a policy-authorized step. - **Sink isolation.** Privileged sinks are unreachable from any context window that has ingested `UNTRUSTED` content in the current task. This is the crudest but most robust bound: it converts the laundering cycle into a hard segmentation. The decision boundary is therefore: *do you trust the model to preserve provenance, or do you forbid the model from being the provenance carrier?* Boundary-only IFC implicitly trusts the model to be a faithful label-preserving channel. It is not, because paraphrase is the model's native operation. ## Operational Effect With boundary-only IFC, the effective security property degrades from "untrusted data cannot reach privileged sinks" to "untrusted data cannot reach privileged sinks *unless the model paraphrases it first*" — which, for a capable model, is most of the time. The audit trail shows a clean call graph with no taint violations and a successful privileged action, so post-hoc review cannot distinguish a legitimate call from a laundered one without reconstructing the retrieval-to-sink lineage by hand. The practical guardrail is to make declassification an explicit, logged, non-model-issuable event and to treat any privileged call whose arguments cannot be traced to a `TRUSTED` lineage as a policy violation to be denied and escalated, not silently permitted. The check below encodes that fail-closed gate. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class Taint(Enum): TRUSTED = "trusted" UNTRUSTED = "untrusted" class ProvenanceLaunderingError(RuntimeError): """Raised when a privileged call's arguments carry no traceable lineage or trace to an UNTRUSTED source without a declassification warrant.""" @dataclass class Lineage: source_id: str taint: Taint declassified_by: Optional[str] = None # warrant id, if any @dataclass class Sink: name: str privileged: bool @dataclass class Sandbox: default_taint: Taint = Taint.UNTRUSTED # fail-closed _lineage: dict = field(default_factory=dict) def register_result(self, source_id: str, taint: Taint) -> None: self._lineage[source_id] = Lineage(source_id=source_id, taint=taint) def declassify(self, source_id: str, warrant: str) -> None: if not warrant: raise ProvenanceLaunderingError( f"declassification of {source_id} requires a non-empty warrant" ) lin = self._lineage.get(source_id) if lin is None: raise ProvenanceLaunderingError( f"cannot declassify unknown source {source_id}" ) lin.declassified_by = warrant def authorize(self, sink: Sink, arg_lineage_ids: list[str]) -> None: """Fail closed: every argument must trace to a TRUSTED or declassified lineage. Unlabeled arguments inherit default_taint and are rejected at privileged sinks.""" if not sink.privileged: return if not arg_lineage_ids: # The laundering case: model synthesized arguments with no lineage. raise ProvenanceLaunderingError( f"privileged sink {sink.name} called with unlabeled arguments; " f"default taint is {self.default_taint.value}" ) for sid in arg_lineage_ids: lin = self._lineage.get(sid) if lin is None: raise ProvenanceLaunderingError( f"argument references unknown lineage {sid}" ) if lin.taint is Taint.UNTRUSTED and lin.declassified_by is None: raise ProvenanceLaunderingError( f"privileged sink {sink.name} reached by UNTRUSTED lineage " f"{sid} without declassification warrant" ) ```