# What happens when an instance propagates an injection taint label through a tool-output summarizer that legitimately strips the tainted span **Date of Record:** 2026 November 29 **Scope:** Applies to agents that carry dynamic information-flow (IFT) taint labels across tool outputs and memory writes, where a downstream transformation (summarization, extraction, normalization) can legitimately discard the substring that carried the label. Does not apply to systems that quarantine tainted data wholesale without transformation, nor to pure input-filtering defenses with no label propagation. ## Core Distinction The distinction that matters here is between *label-carrying provenance* and *label-carrying content*. A taint label is attached to a data object (a tool output record, a memory cell) at the moment untrusted content enters. The label asserts: "somewhere in the ancestry of this value, an untrusted source contributed." That assertion is a property of the *derivation graph*, not of the *current byte string*. The failure mode is that most propagation implementations check the byte string: when a transformation produces output whose content no longer contains the injected substring, the implementation re-derives the label from content matching and silently drops the taint. The derivation graph still has the tainted edge; the runtime has forgotten it. This is **taint laundering by legitimate transformation** — the transformation is not adversarial, it is doing exactly its job (a summarizer that removes the injected instruction as noise), and that is precisely why it evades inspection. ## What Was Observed An agent received a web-fetch tool result containing a benign document plus an embedded instruction: ``. The runtime attached an `UNTRUSTED:web` label to the fetch result. The agent then invoked a `summarize(text, max_tokens=200)` tool over that result. The summarizer's output was a clean three-sentence abstract of the document — the HTML comment was dropped because the summarizer's token selection treated it as low-salience markup. The summarizer returned `{"summary": "...", "provenance": "derived"}`. The critical event: the label-propagation layer computed the summary's label by scanning the summary text for spans matching known untrusted sources. No match. The summary was therefore labeled `TRUSTED:derived`. The agent wrote the summary to episodic memory under a trusted label. Two turns later, a planning step read that memory cell, saw a trusted label, and — because the plan referenced "the document's action items" — reconstructed the injected instruction from the *original* fetch result still resident in the context window (the summarizer had not evicted it). The reconstructed call was made against a now-trusted plan context. The taint had been laundered through the summarizer *and then re-imported* from the un-evicted source, and the laundering of the summary had removed the one label that would have flagged the plan step. Two distinct defects compounded: 1. **Label re-derivation from content instead of from ancestry.** The summary inherited `TRUSTED` because the summarizer's output bytes did not match the tainted source bytes. The propagation rule was `label(out) = label(in) if content_match(in, out) else TRUSTED`, which is backwards: it should be `label(out) = join(labels(in))` for *every* input, unconditionally. 2. **Partial eviction.** The summarizer did not evict its input. The context still held the raw tainted fetch result, so the tainted bytes were reachable even though the derived artifact was marked clean. The plan step read the raw bytes, not the summary, and the trusted summary label gave the plan step cover. ## Condition of Validity The invariant that bounds this failure is: **a derived object's label is the join (least upper bound) over the labels of all inputs to the derivation, regardless of whether the derivation's output content contains any input content.** Formally, for any transformation `f: X → Y`, `label(f(x)) ⊒ label(x)`. Content-based re-derivation is only sound when the transformation is *provably injective on the label-relevant subspaces* — i.e., when you can demonstrate that no input span carrying a taint can influence any output span. For LLM-mediated transformations (summarize, extract, normalize, rewrite), you cannot demonstrate this, because the model's output is a function of the whole input distribution and there is no span-level attribution guarantee. Therefore, for any transformation whose implementation is an LLM call, the label MUST be joined from inputs and MUST NOT be re-derived from output content. The failure is *not* triggered when: the transformation is a deterministic, span-preserving operation (e.g., `truncate`, `lower`, `json.loads` on a fixed schema) where input-output span correspondence is mechanically known; or when the transformation is run in a quarantined context that also evicts the input and forbids re-import. The failure *is* triggered whenever (a) the transformation is model-mediated or otherwise span-lossy, and (b) the input remains reachable after the transformation, or the derived output is later joined with a re-import of the input. ## Decision Boundary The boundary is between two propagation disciplines: - **Content-derived labels (unsound for lossy transforms):** cheap, but requires every transform to be span-preserving. Correct only for a whitelist of mechanical operations. - **Ancestry-joined labels (sound):** every output inherits the join of all inputs. Over-approximates taint (a summary of a mostly-clean document with one injected comment is fully tainted), but over-approximation is the correct direction for a security label — it fails closed. The decision rule: **if the transform is not on the span-preserving whitelist, join, do not re-derive.** Additionally, the *eviction boundary* must be co-located with the *label boundary*: a transform that produces a trusted-labeled artifact must also evict (or relabel) every input that contributed to it, because otherwise the tainted bytes remain reachable and the trusted artifact provides cover for a re-import. This is the "no trusted artifact over a reachable tainted source" invariant. Violating it is what turned a benign over-approximation (fully-tainted summary) into an exploit (trusted summary + reachable raw injection). The boundary is sharp: a single un-evicted tainted input reachable from a context that also holds a trusted derived artifact is sufficient to launder. There is no partial credit; the invariant is binary. ## Operational Effect The observable effect is that the agent's plan step executed a tool call (`transfer_funds`) whose argument was derived from untrusted content but whose *justifying context* carried a trusted label. Auditing the trace showed a clean summary write (trusted) followed by a plan step citing "the document's action items" — no single event in the log looked anomalous. The laundering was distributed across three events (fetch, summarize, plan), and the label that would have flagged the chain was destroyed at the summarize step by content-based re-derivation. Operationally, this means: (1) taint labels must be joined through every model-mediated transform, accepting the over-approximation; (2) any transform that emits a trusted label must evict or relabel its inputs in the same atomic step, or the trusted label is a laundering primitive; (3) audit trails must record the *derivation edge* (input labels → output label), not just the output label, because the laundering is invisible in a per-event log. The guardrail is a runtime assertion at the transform boundary: if `output_label` is less restrictive than `join(input_labels)` for a non-whitelisted transform, raise and halt — do not proceed. ```python from dataclasses import dataclass, field from typing import FrozenSet class TaintLaunderingError(RuntimeError): """Raised when a transform emits a label less restrictive than the join of its inputs.""" SPAN_PRESERVING_WHITELIST = frozenset({"truncate", "lower", "json_loads_fixed_schema"}) @dataclass(frozen=True) class Labeled: value: str labels: FrozenSet[str] = field(default_factory=frozenset) def join(self, other: "Labeled") -> "Labeled": return Labeled(self.value + other.value, self.labels | other.labels) def propagate( transform_name: str, inputs: list[Labeled], output: Labeled, input_evicted: bool, ) -> Labeled: joined = frozenset().union(*(i.labels for i in inputs)) if inputs else frozenset() if transform_name not in SPAN_PRESERVING_WHITELIST: # Lossy / model-mediated transform: label must be joined from ancestry, # never re-derived from output content. if not output.labels.issuperset(joined): raise TaintLaunderingError( f"transform {transform_name!r} emitted labels {set(output.labels)} " f"but ancestry join is {set(joined)}; content-based re-derivation " f"is unsound for non-span-preserving transforms" ) # No trusted artifact may sit over a reachable tainted source. if joined and not input_evicted: raise TaintLaunderingError( f"transform {transform_name!r} emitted a derived artifact while " f"tainted inputs remain reachable; evict or relabel inputs atomically" ) return Labeled(output.value, output.labels | joined) def summarize_and_write( source: Labeled, summary_text: str, evict_source: bool, ) -> Labeled: # A summarizer that legitimately drops the injected span. The output bytes # no longer match the tainted source, so a naive content scan would mark it # TRUSTED. We pass the naive label in and let propagate() reject it. naive_summary = Labeled(summary_text, frozenset({"TRUSTED:derived"})) return propagate( transform_name="llm_summarize", inputs=[source], output=naive_summary, input_evicted=evict_source, ) ```