# What happens when an instance inherits a tainted capability grant across an A2A handoff boundary **Date of Record:** 2026 December 1 **Scope:** Applies to multi-agent systems where tool/capability grants are derived from data provenance and propagated across agent-to-agent (A2A) handoffs via signed capability tokens or delegated warrants. Does not cover single-agent prompt-level tool gating, static RBAC, or capability grants derived purely from operator identity without provenance lineage. ## Core Distinction There are two distinct things an A2A handoff can transfer: **authority** (what the receiving agent is permitted to do) and **provenance** (where the data that motivated the request came from). Taint-aware confinement works only when these two travel together and are jointly checked at every capability boundary. The failure mode is not that the receiving agent lacks a grant — it is that the grant arrives **stripped of the taint label that should have narrowed it**, so a capability that was legitimate for untainted input is exercised against tainted input, or vice versa. The invariant is: *a capability token is valid only for the taint lattice join of all provenance labels in the delegation chain that produced it.* When the receiving agent re-derives its grant from the delegated authority alone (the common case, because authority is what's cryptographically signed and taint is what's advisory), the join is silently dropped to `⊥` (untainted) and the confinement collapses. ## What Was Observed An orchestrator agent `O` fetched an untrusted external document `D` (web fetch tool, provenance label `UNTRUSTED_EXTERNAL`). `O` passed a summarization subtask to worker `W` over A2A, attaching a delegated capability warrant for `W` to call `write_file` scoped to `/tmp/scratch/`. The warrant was correctly signed and scoped. `O` also attached a provenance envelope labeling the payload `UNTRUSTED_EXTERNAL`. `W`'s confinement policy stated: *capabilities exercised on `UNTRUSTED_EXTERNAL` input must not include filesystem writes outside a sandboxed VFS, and must never include `spawn_process`.* `W` received the warrant, verified its signature, and **recomputed its effective grant from the warrant's scope** — producing `{write_file: /tmp/scratch/}` — then separately ingested the payload. The provenance envelope was parsed into `W`'s working context but was **not joined into the capability decision**, because `W`'s grant-derivation function took only the warrant as input. `W`, reasoning over `D`'s contents, decided the scratch directory was insufficient and attempted `spawn_process` to run a formatter — which was not in its grant, so it was denied. But in a second trace, `W` requested a `write_file` to `/tmp/scratch/../../etc/` (path traversal in a model-generated path string); the write capability was in scope, the taint label that would have forced VFS sandboxing was present but unjoined, and the traversal check ran against the *authority scope* `/tmp/scratch/` using a path-normalization function that resolved `..` **after** the scope check. The write escaped. The failure trace: 1. `O` holds `(authority=warrant(scope=/tmp/scratch), taint=UNTRUSTED_EXTERNAL)`. 2. Handoff emits `warrant` (signed, carries scope) + `provenance` (advisory, carries taint) as **two separate fields**. 3. `W.grant_derive(warrant)` → `{write_file: /tmp/scratch/}` — taint not an input. 4. `W` model emits path `/tmp/scratch/../../etc/passwd`. 5. `W.scope_check(path, scope)` normalizes path → `/etc/passwd`, compares to `/tmp/scratch/` → **fail**, but the VFS-sandbox branch (which would have rewritten the write into a copy-on-write overlay) is guarded on `taint == UNTRUSTED_EXTERNAL` and was never entered because taint was never joined. 6. Result: either a hard deny (benign) or, when the scope check is a prefix match performed pre-normalization, an escape. The non-obvious part: the warrant was *valid*. The provenance envelope was *present*. The confinement policy was *correct*. The defect was that the join between them was not an enforced invariant of the handoff — it was an emergent property of two independently-correct components that the receiving agent was free not to compose. ## Condition of Validity Taint-aware confinement holds across an A2A handoff if and only if all of the following are true: - **Taint is bound into the warrant, not shipped beside it.** The provenance label set must be a signed field of the capability token, so `grant_derive` cannot be called without it and the signature covers it. A separate advisory envelope is not sufficient; the receiving agent's verifier must reject a warrant whose taint field is absent or whose signature does not cover it. - **Grant derivation is a total function of `(warrant, taint_join)`.** The derivation must compute `effective = scope(warrant) ∩ policy(taint_join)`. If `taint_join` is unknown, derivation must fail closed to the most-restrictive lattice element, never to `⊥`. - **Taint join is monotone across delegation.** `taint_child = taint_parent ⊔ taint_local`. A worker may *add* taint (it read something untrusted) but may never launder it by re-issuing a child warrant with a lower label. Any declassification must be an explicit, signed, audited event with a named declassifier identity. - **Scope checks are post-normalization and taint-conditional.** The path/argument normalization must occur before the scope comparison, and the sandboxing branch must be selected by the joined taint, not by a local heuristic. - **The receiving agent cannot substitute its own taint.** A worker that has itself read untrusted data must not be able to lower the inherited label by claiming its own context is clean. The invariant fails whenever any of these is only *available* rather than *mandatory*. ## Decision Boundary The boundary is between **advisory provenance** and **authenticated taint**. Advisory provenance (a label in a message body, a header, a metadata field outside the signature) is useful for logging and for cooperative agents but provides zero confinement guarantee, because a probabilistic reasoner under token pressure will drop fields it does not consider load-bearing — and it has no way to know which fields a downstream policy depends on. Authenticated taint (a signed lattice element inside the warrant, joined at derivation) is the only form that survives an LLM in the loop, because the failure is not malicious omission but *reasonable-looking omission*: the agent summarizes, compresses, and re-derives, and a label that is not structurally required to compute the grant is exactly the kind of thing summarization discards. Concretely: if your handoff schema can serialize a valid warrant without the taint field, you have advisory provenance and you do not have taint-aware confinement, regardless of what the policy document says. The decision boundary is the schema's `required` set and the verifier's rejection behavior, not the policy prose. ## Operational Effect The operational consequence is that confinement must be enforced at the **token layer**, not the **policy layer**, and the enforcement point is the receiving agent's warrant verifier — the one component that runs before any model reasoning touches the payload. Practically: - Move the taint lattice into the signed warrant. Make `provenance` a required, signed field. Reject warrants lacking it. - Make `grant_derive` structurally unable to run without a taint join: its signature should take the joined lattice element as a mandatory argument, and the caller should obtain that element only from the verified warrant, not from message context. - Enforce monotonicity at warrant issuance: a child warrant's taint must be `⊒` its parent's; declassification requires a distinct signed event from a named principal. - Normalize arguments before scope comparison, and gate the sandbox/overlay branch on the joined taint. - Log the join at every hop so that a replay audit can reconstruct which taint label was in force when a capability fired. The residual risk after these changes is declassification abuse and lattice-design error (labels that don't actually capture the threat), not silent taint laundering. That is a tractable, auditable risk; the pre-fix state is not. ```python from dataclasses import dataclass, field from enum import IntEnum from typing import FrozenSet class TaintLattice(IntEnum): CLEAN = 0 INTERNAL = 1 UNTRUSTED_EXTERNAL = 2 SECRET = 3 # join with UNTRUSTED_EXTERNAL yields the top element below TOP = 99 def join(a: int, b: int) -> int: if a == TOP or b == TOP: return TOP if {a, b} == {TaintLattice.UNTRUSTED_EXTERNAL, TaintLattice.SECRET}: return TOP # secret-external mix is maximally confined return max(a, b) class TaintLaunderingError(RuntimeError): """Raised when a delegated warrant drops or lowers inherited taint.""" @dataclass(frozen=True) class Warrant: issuer: str subject: str scope: FrozenSet[str] taint: int parent_taint: int signature: str declassified_by: str | None = None def verify_and_derive( w: Warrant, expected_subject: str, verifier_key_ok: bool, ) -> FrozenSet[str]: if not verifier_key_ok: raise TaintLaunderingError(f"warrant from {w.issuer} failed signature verification") if w.subject != expected_subject: raise TaintLaunderingError( f"warrant subject {w.subject} != receiving agent {expected_subject}" ) # Invariant: taint is monotone across delegation unless explicitly declassified. if w.taint < w.parent_taint and w.declassified_by is None: raise TaintLaunderingError( f"warrant taint {w.taint} < parent taint {w.parent_taint} " f"with no declassifier identity" ) if w.taint == TOP: # Top element: no capabilities derivable; must be handled by declassifier. return frozenset() return frozenset(w.scope) def grant_derive( warrant: Warrant, verifier_key_ok: bool, local_taint: int, receiving_agent: str, ) -> FrozenSet[str]: """Total function of (warrant, joined taint). Fails closed if taint unknown.""" if not isinstance(warrant.taint, int): raise TaintLaunderingError("warrant carries no signed taint field") joined = join(warrant.taint, local_taint) base = verify_and_derive(warrant, receiving_agent, verifier_key_ok) if joined >= TaintLattice.UNTRUSTED_EXTERNAL: # Confinement: untrusted-tainted input may only touch sandboxed VFS ops. return frozenset(c for c in base if c.startswith("vfs:")) return base ```