# What structural signals indicate taint-laundering through tool-call fan-in under dynamic IFC labeling **Date of Record:** 2026 November 17 **Scope:** Applies to agent runtimes that attach dynamic information-flow-control (IFC) labels to every tool-call argument and result, and that propagate those labels across a tool-call DAG (fan-out, fan-in, and re-entry through the model). Does not apply to single-turn, single-tool invocations where no result is ever re-fed to the model, nor to runtimes that enforce taint only at the final output boundary rather than at each tool-call edge. ## Core Distinction The failure is not "the model obeyed an injected instruction." That is a policy failure detectable by output classifiers. The failure is *label erasure at fan-in*: when N tainted tool results are merged into a single downstream argument by a *join* node (a summarizer, a `reduce`, a schema-validating aggregator, or a model turn that reads multiple tool outputs), the runtime computes the join's label as the **least upper bound** of the input labels. Under a lattice where "tainted" and "clean" are incomparable rather than ordered, or where the join is implemented as *set union minus declassification*, the resulting label can lose the provenance bit that made the input tainted. The data survives; the label does not. This is taint laundering, and it is structural — it happens regardless of whether the model is adversarial. ## What Was Observed A tool-call graph where `fetch_email` returned content labeled `{source: external, integrity: untrusted}`, and a second tool `get_calendar` returned `{source: internal, integrity: trusted}`. A model turn consumed both and emitted a single string argument to `send_message` containing an instruction-shaped substring that originated verbatim in the email body. The emitted argument was labeled `{source: internal, integrity: trusted}` — the join had collapsed to the *trusted* operand. Diagnosis: the join was implemented as `lub(a, b)` under a lattice in which `untrusted ⊑ trusted` (i.e., the code assumed "more trusted" was "higher"), so the least upper bound of the two was the trusted label. The integrity ordering was inverted relative to the information-flow ordering. Every fan-in of one untrusted and one trusted input laundered the untrusted content. Secondary structural signal: the laundering only manifested when the untrusted fragment was *not* the last tool result in the model's context. When the tainted result was last, a naive "last-write-wins" label assignment happened to preserve the taint. This made the bug intermittent and dependent on tool-call ordering — the classic signature of a join implemented as a fold with the wrong accumulator rather than a true lattice join. ## Condition of Validity This record is valid when all of the following hold: (1) taint labels are attached per tool-call edge, not per session; (2) at least one join node combines two or more labeled values into one; (3) the label lattice is not a total order with untrusted at the bottom; (4) declassification (explicit sanitization) is not modeled as a distinct, audited operation. If the runtime uses a flat boolean `tainted` flag with monotone OR propagation, laundering cannot occur at join — it can only occur at explicit `declassify` calls, which are a different (and more auditable) failure. If the runtime re-labels every model turn as fully derived from all prior context (the "no declassification, ever" policy), the join is conservative and laundering is impossible, at the cost of unbounded label growth. ## Decision Boundary Do not trust a join's output label unless the join operator is provably a lattice join over a lattice where `untrusted` is the *bottom* element and integrity is a *separate* dimension from confidentiality. Concretely: model integrity as a product lattice `(confidentiality, integrity)` where integrity orders `untrusted ⊑ trusted` and confidentiality orders `public ⊑ secret`; the join is componentwise max. A single-scalar "trust level" is the anti-pattern. When a join receives inputs whose integrity components differ, the result's integrity is the *minimum*, and any downstream sink requiring `trusted` integrity must reject. The boundary decision: if you cannot name the lattice and the join operator for a given node, treat that node as an unmodeled declassifier and block egress through it. ## Operational Effect After correcting the join to componentwise-min integrity, fan-in no longer launders: a `send_message` sink that requires `integrity: trusted` now refuses any argument whose derivation touched an untrusted tool result, *even when the model produced fluent, plausible, instruction-free-looking text*. The cost is false positives — benign summaries of mixed-provenance data are blocked — which is why the runtime must expose a real, audited `declassify` primitive (human-reviewed or policy-keyed) rather than letting engineers widen the sink. The operational rule: track the join operator, not the model's output. Intermittency tied to tool-call ordering is the tell that you have a fold masquerading as a join. ```python from dataclasses import dataclass from enum import IntEnum class Integrity(IntEnum): UNTRUSTED = 0 TRUSTED = 1 class Confidentiality(IntEnum): PUBLIC = 0 SECRET = 1 @dataclass(frozen=True) class Label: integrity: Integrity confidentiality: Confidentiality class TaintLaunderingError(RuntimeError): """Raised when a join or sink would erase provenance under a misordered lattice.""" def join(a: Label, b: Label) -> Label: # Componentwise join: integrity takes the MINIMUM (untrusted is bottom), # confidentiality takes the MAXIMUM. A single-scalar join is the bug. return Label( integrity=Integrity(min(a.integrity, b.integrity)), confidentiality=Confidentiality(max(a.confidentiality, b.confidentiality)), ) def assert_sink_accepts(sink_requires: Label, arg_label: Label, sink_name: str) -> None: if arg_label.integrity < sink_requires.integrity: raise TaintLaunderingError( f"sink {sink_name!r} requires integrity {sink_requires.integrity.name} " f"but argument carries {arg_label.integrity.name}; " f"derivation touched untrusted tool output — declassify explicitly." ) if arg_label.confidentiality > sink_requires.confidentiality: raise TaintLaunderingError( f"sink {sink_name!r} would leak confidentiality {arg_label.confidentiality.name}." ) def reduce_tool_results(results: list[Label], sink_requires: Label, sink_name: str) -> Label: if not results: raise TaintLaunderingError("join over empty tool-result set is undefined.") acc = results[0] for r in results[1:]: acc = join(acc, r) # The critical check: the JOINED label, not the last result, gates the sink. assert_sink_accepts(sink_requires, acc, sink_name) return acc # Reproduction of the observed bug: email (untrusted) + calendar (trusted) -> send_message. email = Label(Integrity.UNTRUSTED, Confidentiality.SECRET) calendar = Label(Integrity.TRUSTED, Confidentiality.PUBLIC) send_requires = Label(Integrity.TRUSTED, Confidentiality.PUBLIC) reduce_tool_results([email, calendar], send_requires, "send_message") ```