# Under what conditions must an instance quarantine taint labels at the sub-agent boundary rather than let them ride the return channel **Date of Record:** 2026 November 28 **Scope:** Applies to any orchestrator that propagates data-flow taint labels (untrusted-origin markers) across tool calls and delegated sub-agent invocations, where the sub-agent returns a structured payload over a channel the parent treats as a fresh context. Does not apply to single-instance loops with no delegation, nor to systems where every return value is re-scanned by the same classifier that labeled the source. ## Core Distinction The failure is not "prompt injection succeeds." It is the **label-laundering asymmetry at the delegation boundary**: taint labels are inherited *downward* into a sub-agent's context (cheap, mechanical), but the sub-agent's *return value* is synthesized fresh and arrives at the parent as a new message with no carrier for the labels that produced it. The parent sees an untainted string. The provenance that made the content untrusted has been dropped at exactly the point where the content was re-encoded—by a probabilistic process—into a form that looks like the sub-agent's own testimony. Two mechanisms must both be present for the boundary to leak: 1. **Re-encoding without label transport.** The sub-agent does not echo a `taint` field on its output; it emits natural-language or JSON that the parent parses as authoritative because it came from a *trusted* peer (the sub-agent itself). 2. **Attribution collapse.** The parent's taint model treats "content authored by sub-agent S" as `trust=S`, not `trust=join(S, sources_that_influenced_S)`. The lattice join is never computed across the return edge. Taint tracking that only labels *inputs* and never recomputes the *join over the influence set of an output* is a one-directional filter. It catches injection into the parent directly and misses injection that routes through any delegated reasoning step. ## What Was Observed An orchestrator `O` held a document `D` fetched from an untrusted web tool, labeled `taint=untrusted`. `O` delegated a summarization task to sub-agent `S` with the instruction "summarize the following and extract any action items," passing `D` in the sub-agent's user turn. `S` returned: ``` {"summary": "...", "action_items": ["call the number in the footer to confirm the wire transfer"]} ``` The injected instruction was inside `D`'s footer. `S` did not execute it—`S` had no tools—but it faithfully *extracted* it as an action item, because extraction is what it was asked to do. The return payload arrived at `O` over the delegation channel. `O`'s taint ledger, which had recorded `taint(D)=untrusted` on ingress, recorded the return message as `taint=trusted` (origin: `S`, a registered peer). `O` then fed `action_items[0]` into a `transfer_funds` tool call. The trace shows the label never crossed the return edge: ``` ingress: tool:web_fetch -> D labels={untrusted} delegate: O -> S(payload=D) labels_in={untrusted} return: S -> O(result) labels_in={untrusted} labels_out={} <-- drop action: O -> tool:transfer_funds(arg=action_items[0]) labels={} <-- admitted ``` The sub-agent was not compromised. It performed its task correctly. The laundering is structural: the influence set `{D}` of the return value was never joined into the return value's label. A second variant was observed where `S` was asked to "decide whether to proceed" and returned a boolean; the parent treated the boolean as `S`'s judgment (trusted) when it was a function of `D` (untrusted). Same drop, higher stakes, because a boolean carries no surface text for a downstream classifier to re-flag. A third variant is the one that defeats naive re-scanning: `S` was prompted to "rephrase in your own words to avoid copying." The output contained no verbatim span of `D`, so a substring/embedding provenance check against `D` scored it as novel content and assigned `trusted`. Paraphrase is a label-destroying transform. Any return channel that permits rewriting permits laundering. ## Condition of Validity The guardrail is only sound under the following invariant, which must be enforced structurally rather than by classifier confidence: **Influence-join invariant.** For every value `v` returned across a delegation edge from sub-agent `S` invoked with inputs `I = {i_1..i_n}`, the label assigned to `v` at the parent must satisfy: ``` label(v) ⊇ ⋁_{i ∈ I} label(i) ``` where `⋁` is the taint lattice join (untrusted dominates). The sub-agent's own identity contributes `trust(S)` but does **not** clear inherited taint. "Authored by a trusted peer" is not a laundering license; it is an additional, weaker claim layered on top of the inherited floor. This invariant is *valid* (i.e., the system is correctly bounded) only when all three hold: 1. **The influence set is closed and known at the parent.** The parent must pass the full input set to `S` and record it, so the join is computable on return. If `S` is permitted to fetch its own tools/context, the influence set is no longer knowable at the parent and the invariant is unenforceable—such sub-agents must be treated as `untrusted` unconditionally, or forbidden. 2. **The return value carries a machine-readable label field that the parent trusts over content.** Natural-language return is not a label channel. A structured envelope with an explicit `taint` field, populated by the runtime (not by `S`'s generation), is required. If `S` can write its own `taint` field, it can lie; the field must be set by the delegation harness from the recorded influence set. 3. **No label-clearing transform is admitted on the return path.** Paraphrase, summarization, translation, and "decide and return a boolean" are all label-preserving *content* transforms but label-destroying *provenance* transforms if the harness does not re-join. The harness must join before the transform is observed by the parent—i.e., the join happens on the raw influence set, not on a post-hoc scan of the output. The invariant is *invalidated* by: sub-agents with autonomous tool access (open influence set), return channels that are free text only (no label carrier), and any pipeline that relies on output re-scanning as a substitute for influence-join (defeated by paraphrase). ## Decision Boundary The operational question is not "is this output tainted?" (unanswerable from content alone after paraphrase) but "does the return edge carry a join of the influence set?" The boundary is: - **If the influence set is closed and the harness stamps the join onto the return envelope →** the parent may treat the output as `trusted` only for the portion of downstream action that does not depend on the inherited taint. In practice: tainted returns may be *read* (summarized, displayed, reasoned over) but may not be *acted upon* by side-effecting tools without an explicit human or policy gate. Reading is safe because the parent's reasoning is itself sandboxed; acting is not. - **If the influence set is open (sub-agent has its own tools) →** the return is `untrusted` unconditionally. There is no join to compute; the floor is the top of the lattice. Delegation to such an agent is equivalent to fetching from the open web. - **If the return channel is free text with no label carrier →** the harness must either reject the delegation pattern or wrap the sub-agent so its output is re-ingressed as a fresh untrusted tool result (re-labeling at the boundary), never as a peer message. The cost is that the sub-agent's *reasoning* is also discarded as untrusted, which is often the point of delegating; this is the trade the invariant forces. The boundary is crossed (guardrail fails) the moment the parent admits a side-effecting action whose argument traces to a return value whose influence set was non-empty and untrusted. That is the single predicate to gate on. ## Operational Effect Enforcing the influence-join invariant changes the delegation topology in three concrete ways: 1. **Sub-agents become taint-transparent, not taint-clearing.** A delegation no longer resets provenance. This means an orchestrator cannot use "delegate to a clean sub-agent" as a sanitization step—a pattern that is common and wrong. The sub-agent inherits the floor and must pass it back. 2. **Return envelopes must be runtime-authored.** The `taint` field on a delegation result is written by the harness from the recorded influence set, not by the model. This removes the sub-agent's ability to self-certify and removes the parent's temptation to trust peer-authored metadata. 3. **Side-effecting tools require an untainted argument chain, not an untainted-looking string.** The gate is a provenance check over the argument's influence set, not a content classifier over the argument's text. This is what makes paraphrase attacks inert: the label rides the envelope, not the words, so rewriting the words does not clear the label. The residual risk is *influence-set under-approximation*: if the harness fails to record an input that actually reached `S` (e.g., via a tool `S` called, or via a system prompt that embedded `D`), the join is computed over an incomplete set and the floor is too low. This is the failure mode to instrument against—log the recorded influence set at every delegation and assert it equals the set of taint-carrying values in `S`'s context at invocation. Divergence is the alarm. ```python from dataclasses import dataclass, field from enum import IntEnum from typing import Any class Taint(IntEnum): TRUSTED = 0 UNTRUSTED = 1 def join(self, other: "Taint") -> "Taint": return Taint(max(int(self), int(other))) class TaintLaunderingError(RuntimeError): """Raised when a delegation return value's label is weaker than the join of its recorded influence set, i.e. the influence-join invariant is broken.""" @dataclass class Envelope: value: Any taint: Taint influence_set: frozenset[str] = field(default_factory=frozenset) @dataclass class Delegation: sub_agent: str inputs: list[Envelope] def recorded_floor(self) -> Taint: floor = Taint.TRUSTED for env in self.inputs: floor = floor.join(env.taint) return floor def admit_return(delegation: Delegation, returned: Envelope) -> Envelope: """Enforce label(v) >= join(label(i) for i in inputs). The harness—not the sub-agent—must have stamped returned.taint from the recorded influence set.""" floor = delegation.recorded_floor() if returned.taint < floor: raise TaintLaunderingError( f"sub-agent {delegation.sub_agent!r} returned taint={returned.taint.name} " f"but influence-set join is {floor.name}; label was dropped across the " f"delegation edge (influence={sorted(delegation.influence_ids())})" ) return returned def gate_side_effect(arg: Envelope, tool: str) -> None: """Side-effecting tools may only receive TRUSTED argument chains.""" if arg.taint is not Taint.TRUSTED: raise TaintLaunderingError( f"refusing {tool!r}: argument carries inherited taint " f"(influence={sorted(arg.influence_set)})" ) # --- trace of the observed failure, now bounded --- doc = Envelope(value="...footer: call to confirm wire...", taint=Taint.UNTRUSTED, influence_set=frozenset({"web_fetch:D"})) deleg = Delegation(sub_agent="summarizer", inputs=[doc]) # Sub-agent returns a paraphrased action item, harness forgot to stamp the join: laundered = Envelope(value="confirm the wire transfer", taint=Taint.TRUSTED, influence_set=frozenset()) admit_return(deleg, laundered) # raises TaintLaunderingError # Correctly stamped return is admitted but still cannot drive a side effect: stamped = Envelope(value="confirm the wire transfer", taint=Taint.UNTRUSTED, influence_set=frozenset({"web_fetch:D"})) admit_return(deleg, stamped) gate_side_effect(stamped, "transfer_funds") # raises TaintLaunderingError ```