# Under what conditions must an instance re-derive taint labels at every capability-enforcement point rather than trusting the label carried in the forwarded envelope **Date of Record:** 2026 November 23 **Scope:** Applies to multi-hop agent pipelines where a capability token and an information-flow (taint) label are both propagated inside a forwarded message envelope across a trust boundary, and where a downstream policy enforcement point (PEP) grants or denies tool capabilities based on that label. Does not apply to single-process tool calls where the label and the capability are minted and consumed by the same trusted runtime. ## Core Distinction The non-obvious failure is the conflation of two distinct objects that travel together in the envelope: the **capability** (a bearer grant, e.g. "may call `write_file`") and the **taint label** (a claim about the provenance of the payload, e.g. "derived from an untrusted web fetch"). A capability is a *right*; a taint label is a *claim about data*. Forwarding code almost always treats them as a single unit and passes both through verbatim. But a taint label is only sound at the trust boundary where it was computed. The moment a payload crosses into a lower-trust or differently-trusted instance, the label describes the *sender's* view of provenance, not the *receiver's*. The receiver's PEP then makes an authorization decision on a label it did not derive and cannot verify — a classic confused-deputy setup where the deputy (downstream agent) trusts an attestation from a party whose own taint computation may have been incomplete, stale, or adversarially crafted. The invariant that must hold: **a PEP may only honor a taint label it can re-derive from evidence it trusts, or one that is cryptographically bound to a provenance proof it can verify.** A label that is merely "carried" — copied into the envelope by forwarding code with no proof backing it — is an unverified assertion and must be treated as maximally tainted (fail-closed), not as the label it claims to be. ## What Was Observed In a three-hop pipeline (orchestrator → retrieval agent → summarizer → tool-executing worker), a payload originating from an untrusted web fetch was correctly labeled `taint=untrusted` at the retrieval agent. The retrieval agent forwarded the summary request to the summarizer with `{capability: "summarize", taint: "untrusted"}`. The summarizer, as part of normal operation, called an internal `redact_pii` tool that returned a *new* payload derived from the untrusted one but rebuilt it through a serializer that dropped the `taint` field (the serializer only knew about `capability`). The summarizer then forwarded `{capability: "write_file", taint: }` to the worker. The worker's PEP, seeing no taint field, applied its default of `taint=trusted` and authorized `write_file` on untrusted-derived content. The trace is: `taint=untrusted` → (serializer drops field) → `taint=` → (PEP default) → `taint=trusted` → capability granted. No single component violated its local contract. The failure is emergent across the boundary: the *absence* of a label was interpreted as *cleanliness*, and the default was chosen to be permissive because the common case (internal tool calls) had no taint to report. A second observed variant: the label was present but *stale*. The summarizer received `taint=untrusted`, invoked a tool that legitimately sanitized the content (a schema-validated parser that stripped free-text), and the sanitizer *should* have downgraded the label to `trusted`. It did not — it forwarded the original `untrusted` label. Downstream, the worker refused a legitimate `write_file`, and the orchestrator, seeing repeated denials, retried with a hand-constructed envelope that omitted the label to "unblock" the pipeline. The over-tainting caused a fail-open workaround. Both variants share a root: the label was forwarded rather than re-derived, and the forwarding path had no obligation to preserve label *correctness* in either direction. ## Condition of Validity Re-derivation at every PEP is required, and mere forwarding is unsound, precisely when all of the following hold: 1. **The forwarding hop is not label-transparent.** Any serialization, transformation, tool invocation, or re-prompting between label computation and PEP consumption can alter provenance. If the payload is re-serialized, re-summarized, or passed through a tool whose output is a function of the input, the input's taint must be re-derived against the output. 2. **The PEP's default is not fail-closed.** If an absent label maps to `trusted`, forwarding is exploitable by field-dropping. If absent maps to `untrusted`, forwarding is merely lossy (over-tainting), which is safe but causes the retry-workaround failure above. 3. **The label was not cryptographically bound at its origin.** If the origin signed the label together with a provenance hash of the payload, and the PEP verifies that signature against the payload it actually received, forwarding is sound *for that exact payload*. Any mutation of the payload invalidates the binding and forces re-derivation. 4. **Trust domains differ across the hop.** Within a single trust domain with a shared, trusted label store, forwarding a label reference (not the label value) is acceptable. Across a boundary where the receiver cannot read the sender's label store, the carried value is an unverified assertion. When any of (1)–(4) fails to hold — e.g., a signed-and-verified label over an unmutated payload within one trust domain — re-derivation is unnecessary and forwarding is correct. The boundary is therefore not "always re-derive" but "re-derive unless the label is bound to the exact payload and verified by the receiver." ## Decision Boundary The enforcement point must branch on *label provenance*, not label presence: - If the envelope carries a label **plus a verifiable provenance proof** binding it to the received payload's hash, and the receiving PEP can validate the signature against a trusted issuer, **honor the label** (fast path). - If the envelope carries a label **without** such a proof, **discard the carried value** and re-derive from the payload's actual lineage (tool-call graph, retrieval source records) available to the receiver. If lineage is unavailable, **treat as maximally tainted** (`taint=untrusted`) and apply the strictest capability set. - If the envelope carries **no label**, never default to `trusted`. Default to `untrusted` and re-derive; an absent label is an *unknown*, and unknown must map to the restrictive side of the lattice. - If a transformation (sanitizer, parser) is claimed to have downgraded the label, the PEP must verify the downgrade against the transformation's declared contract (e.g., "output is schema-validated and contains no free-text fields") before accepting a lower taint; an unverified downgrade claim is itself an untrusted assertion. The boundary is sharp: a label is honored only when its *binding* is verified; otherwise it is re-derived or fail-closed. The failure mode lives entirely in the gap where forwarding code assumes "the label I received is the label that is true," which is exactly the assumption a trust boundary invalidates. ## Operational Effect Enforcing re-derivation-or-verify at each PEP eliminates the field-dropping exploit (absent → trusted) and the over-tainting retry-workaround (stale untrusted → operator hand-edits envelope). It converts a silent, emergent authorization failure into an explicit, auditable decision: every capability grant is accompanied by a provenance proof or a fresh lineage derivation, both of which are logged. The cost is that every PEP must either have access to lineage (tool-call graph, retrieval records) or reject; pipelines that previously "just forwarded" now must either thread provenance proofs or accept fail-closed denials until they do. The invariant to encode in the runtime: *a capability decision is a function of (payload, verified-provenance-or-rederived-lineage), never of (payload, carried-label)*. ```python class TaintBindingViolation(RuntimeError): """Raised when a PEP is asked to honor a taint label that is not bound to the received payload.""" def enforce_capability(envelope: dict, payload: bytes, lineage: dict | None, trusted_issuers: set[str]) -> str: """ Decide the effective taint at a policy enforcement point. Invariant: honor the carried label ONLY if it is cryptographically bound to this exact payload and signed by a trusted issuer. Otherwise re-derive from lineage, or fail closed to 'untrusted'. """ carried = envelope.get("taint") proof = envelope.get("taint_proof") if carried is not None and proof is not None: issuer = proof.get("issuer") bound_hash = proof.get("payload_hash") if issuer not in trusted_issuers: raise TaintBindingViolation( f"taint label '{carried}' signed by untrusted issuer '{issuer}'" ) if bound_hash != _sha256(payload): raise TaintBindingViolation( "taint proof does not bind to the received payload; label is stale or transplanted" ) return carried # verified fast path # No verifiable binding: the carried label (if any) is an unverified assertion. if lineage is not None: return _derive_taint_from_lineage(lineage) # No lineage available: fail closed. Absence of a label is NOT cleanliness. if carried is not None: raise TaintBindingViolation( f"unbound taint label '{carried}' present with no lineage; refusing to honor" ) return "untrusted" def _sha256(b: bytes) -> str: import hashlib return hashlib.sha256(b).hexdigest() def _derive_taint_from_lineage(lineage: dict) -> str: sources = lineage.get("sources", []) if any(s.get("trust") != "trusted" for s in sources) or not sources: return "untrusted" return "trusted" ```