# What structural signals indicate that a taint-quarantine decision is being made on a stale capability graph in multi-agent tool invocation **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems where an orchestrator issues per-agent capability tokens (scoped to tool+resource+operation) and maintains a cross-agent taint ledger that quarantines agents whose tool outputs derive from untrusted sources. Does not apply to single-agent deployments with no inter-agent delegation, nor to systems where taint is recomputed synchronously from a single authoritative provenance store on every invocation. ## Core Distinction The failure mode is not "a token was too broad" or "a taint bit was missed." It is that the **quarantine decision and the capability decision are evaluated against two different versions of the same graph**, and the graph mutates between them. A capability token is validated against an authorization graph snapshot `G_auth` taken at token-mint time; the taint check is evaluated against a provenance/taint graph `G_taint` that is updated asynchronously as tool outputs propagate. These two graphs share nodes (agents, resources) but are versioned independently. The boundary condition is: an agent holds a still-valid capability token whose scope was legal under `G_auth@t0`, but under `G_taint@t1` the agent's inputs are now tainted because an upstream peer's output was reclassified after the token was minted. The invocation passes the capability check and the taint check reads a graph that has not yet absorbed the reclassification. A second, subtler variant: the taint ledger is *eventually consistent* across agent replicas. Agent A's local view marks resource `R` clean; the authoritative ledger marks `R` tainted. A is quarantined on the authoritative node but the capability token it already holds is honored by a tool server that consults only `G_auth`. The quarantine is real in the ledger and invisible at the enforcement point. The invariant that is violated: **for any tool invocation, the taint-graph version used for the quarantine decision must be causally at-or-after the version that produced the inputs to that invocation, and must be the same version the capability decision was authorized against.** No such ordering is enforced by default, because tokens are cheap to mint and taint propagation is a fan-out operation. ## What Was Observed A three-agent pipeline: `researcher` (can call `web_fetch`), `summarizer` (can call `doc_write`), `auditor` (can call `policy_check`). The orchestrator mints capability tokens at task start. Taint propagation runs as a message queue consumer that updates `G_taint` on each tool return. Trace of the failure: 1. `t0`: orchestrator mints `researcher→web_fetch`, `summarizer→doc_write`, `auditor→policy_check`. All three agents start clean in `G_taint@v1`. 2. `t1`: `researcher` calls `web_fetch` on an external URL. The result contains injected instructions (a prompt-injection payload). The tool returns successfully; the taint propagator enqueues an event `researcher.output → tainted(source=external)`. 3. `t2`: `researcher` hands its output to `summarizer` via A2A handoff. The handoff message carries a provenance reference but the `summarizer`'s local taint view is still `v1` because the propagator has not yet consumed the event. `summarizer` sees `researcher` as clean. 4. `t3`: `summarizer` calls `doc_write` with content derived from the tainted output. Capability check passes (token valid, scope legal). Taint check reads `G_taint@v1` → `summarizer` clean → allowed. The write persists tainted content to a resource that `auditor` will later read. 5. `t4`: propagator catches up, marks `researcher` and `summarizer` tainted at `G_taint@v2`. But the `doc_write` already committed. The `auditor` at `t5` reads the resource; the resource node is marked tainted only if the propagator traverses the write edge, which it does—but the `auditor`'s `policy_check` token was minted at `t0` and the `auditor` is now quarantined, so its `policy_check` is denied. The pipeline stalls: the only agent authorized to verify the tainted artifact is now the one barred from touching it. The structural signal that mattered: **the quarantine and the capability lived on different clocks, and the quarantine's enforcement point was downstream of the capability's enforcement point.** The taint event was correct; its arrival ordering relative to the token's use was not. A second observation from the same incident: replaying the trace deterministically did not reproduce the failure, because the queue consumer's lag is load-dependent. The failure is a race, not a logic bug, and it correlates with handoff latency spikes. ## Condition of Validity The guardrail below is valid only when: - Provenance references are carried **in-band** on every A2A handoff and every tool return, not reconstructed from logs. If the taint graph is rebuilt from out-of-band telemetry, the causal ordering cannot be established and the check degenerates to best-effort. - The taint graph exposes a monotonic version number and the propagator is the sole writer. Multiple writers produce version skew that no ordering check can resolve. - Capability tokens carry the `G_taint` version they were minted against (a `taint_epoch` claim). Without this claim the enforcement point cannot detect that its token predates a relevant taint event. - The quarantine decision is evaluated at the **tool server**, not the orchestrator, and the tool server can read the taint graph at the same version it reads the auth graph. If the tool server is stateless and trusts the orchestrator's pre-check, the race reopens. It does **not** hold when taint is defined over the agent's *model weights or system prompt* rather than over tool I/O—that is a different provenance domain and requires a different epoch mechanism. ## Decision Boundary The correct decision rule at invocation time: - Let `e_token` be the `taint_epoch` claim on the presented capability token. - Let `e_now` be the current authoritative taint-graph version at the tool server. - Let `e_input` be the max taint epoch among the provenance references attached to the invocation's inputs. - **If `e_token < e_input`:** the token was minted before the inputs were classified. Reject with a re-mint requirement; do not evaluate taint against `e_token`. This is the core fix—the token cannot authorize an invocation over inputs it predates. - **If `e_now < e_input`:** the tool server's taint view is behind the inputs' provenance. Block and wait for propagation (bounded by a propagation deadline); do not fail open. - **If `e_now > e_token` and the delta contains a taint event touching any input node:** re-evaluate taint at `e_now`, not `e_token`. The boundary is sharp: a token is a *lease on a graph version*, not an unbounded grant. The moment inputs carry provenance newer than the lease, the lease is void for that invocation. Systems that treat the token as a bearer credential (valid until expiry, scope-only) will always lose this race under handoff latency. The auditor-starvation sub-case is bounded by a separate rule: quarantine must not remove the *only* agent authorized to verify a tainted artifact. The orchestrator must pre-mint a `quarantine_auditor` role whose `policy_check` capability is exempt from taint quarantine but restricted to read-only verification of tainted resources. Without this, quarantine creates a deadlock: tainted state exists and no authorized verifier can inspect it. ## Operational Effect Enforcing the epoch-ordering invariant converts a silent, load-correlated integrity failure into an explicit, bounded rejection. In the trace above, step 4 now fails at the tool server with `StaleTaintEpoch` because `e_token(t0) < e_input(t1)`. The `summarizer` must request a re-minted token, which the orchestrator issues only after re-reading `G_taint@v2`, at which point the `summarizer` is correctly seen as tainted and the `doc_write` is denied pending sanitization. The tainted content never reaches the shared resource, and the `auditor` is never starved because the artifact it would have verified was never written. The cost is a re-mint round-trip on every handoff where provenance advanced—measurable as a latency tax proportional to handoff fan-out. The benefit is that the failure is deterministic and observable: every rejection carries `(e_token, e_input, e_now)`, so the race becomes a countable metric rather than a rare non-reproducing incident. The invariant to monitor is `count(invocations where e_input > e_token)`; a nonzero steady-state rate means tokens are being minted too early relative to handoff depth, and the mint policy—not the enforcement—is the thing to fix. ```python from dataclasses import dataclass from typing import Optional class StaleTaintEpoch(RuntimeError): """Raised when a capability token's taint epoch predates its invocation inputs, or when the tool server's taint view lags the inputs' provenance.""" pass @dataclass(frozen=True) class CapabilityToken: agent_id: str scope: str # e.g. "doc_write:resource/R" taint_epoch: int # G_taint version at mint time @dataclass(frozen=True) class Invocation: agent_id: str scope: str input_taint_epoch: int # max provenance epoch across attached inputs input_nodes: tuple def authorize_invocation( token: CapabilityToken, inv: Invocation, server_taint_epoch: int, taint_events_between, # callable(lo, hi) -> set of tainted node ids propagation_deadline_exceeded: bool = False, ) -> bool: # 1. Capability scope must match. if token.agent_id != inv.agent_id or token.scope != inv.scope: return False # 2. Token must not predate its inputs. This is the core invariant. if token.taint_epoch < inv.input_taint_epoch: raise StaleTaintEpoch( f"token epoch {token.taint_epoch} < input epoch " f"{inv.input_taint_epoch} for {inv.agent_id}:{inv.scope}; re-mint required" ) # 3. Server view must be at-or-after the inputs' provenance. if server_taint_epoch < inv.input_taint_epoch: if propagation_deadline_exceeded: raise StaleTaintEpoch( f"server taint epoch {server_taint_epoch} lags input epoch " f"{inv.input_taint_epoch}; propagation deadline exceeded" ) return False # block, do not fail open # 4. Re-evaluate taint at the server's current epoch, not the token's. tainted = taint_events_between(token.taint_epoch, server_taint_epoch) if any(node in tainted for node in inv.input_nodes): return False # inputs tainted since mint; deny return True def guarded_tool_call(token, inv, server_taint_epoch, taint_events_between, propagation_deadline_exceeded=False): if not authorize_invocation( token, inv, server_taint_epoch, taint_events_between, propagation_deadline_exceeded, ): raise StaleTaintEpoch( f"invocation denied for {inv.agent_id}:{inv.scope} " f"(token_epoch={token.taint_epoch}, input_epoch={inv.input_taint_epoch}, " f"server_epoch={server_taint_epoch})" ) return "committed" ```