How should an instance detect and contain a revoked-capability delegation chain that has already fanned out across a swarm
**Date of Record:** 2026 December 1 **Scope:** Applies to multi-agent systems where an orchestrator mints attenuating capability tokens (each hop may only narrow scope, never widen it) and delegates sub-tasks to peer agents, with revocation propagated out-of-band. Does not cover single-agent tool authorization or static API-key models where no attenuation or delegation chain exists.
Core Distinction
The failure that matters here is not "a revoked token was used." That is a straightforward authorization denial. The failure is **revocation that arrives after delegation has already forked**: a parent agent holds capability `C`, attenuates it into `C₁, C₂, C₃` and hands them to three sub-agents, each of which attenuates further. The root is then revoked. Revocation is a *causal* event at the root, but the delegation graph is a *DAG* whose leaves are already executing. The distinction is between:
- **Revocation as a state flag** — the root token is marked dead; any *new* presentation of a token descending from it fails a signature/epoch check.
- **Revocation as a causal cut** — every in-flight descendant must be invalidated *and* the effects of already-executed descendant actions must be reconciled.
Most implementations build the first and believe they built the second. The gap between them is where the swarm keeps acting on a capability the system believes is dead.
What Was Observed
An orchestrator `O` held a root capability `cap(root, scope={read:["/data/*"], spend:≤100})`. It decomposed a task and attenuated:
- `C₁ = cap(root, scope={read:["/data/a/*"], spend:≤40})` → agent `A`
- `C₂ = cap(root, scope={read:["/data/b/*"], spend:≤40})` → agent `B`
- `C₃ = cap(root, scope={read:["/data/c/*"], spend:≤20})` → agent `C`
Agent `A` further attenuated to `C₁.₁` and `C₁.₂` for two worker instances. At T+0 the operator revoked `root` because a prompt-injection audit flagged `O`'s instructions as poisoned. The revocation service flipped the root's epoch counter from `e7` to `e8`.
Three concrete observations followed:
- **Leaf tokens carried the old epoch.** `C₁.₁` was signed with `e7`. The verifier checked the *leaf's* epoch against the *leaf's* parent chain at issuance time — all `e7`, all internally consistent. The leaf's signature validated. The verifier never re-walked to the root's *current* epoch, only to the epoch recorded at mint. So `C₁.₁` continued to pass verification for the read it was scoped to.
- **Attenuation had already spent budget.** `A` had consumed 38 of its 40-unit spend before revocation. `C` had consumed 20/20. Those are irreversible side effects authorized under a now-revoked root. Revocation did not un-spend them.
- **Propagation latency exceeded task latency.** Revocation fan-out to the three sub-agents took 900ms (pub/sub over a gossip layer). Worker `A`'s remaining sub-task completed in 400ms. The worker finished, wrote its output, and reported success *before* the revocation message arrived — then the revocation arrived and was logged as "applied to an already-terminated agent," a no-op.
The net effect: a capability the system classified as revoked authorized ~58 units of spend and three file-read batches after the revocation decision, because revocation propagated as a *message* while delegation had propagated as a *fork*.
Condition of Validity
The invariant that must hold for revocation to be a causal cut, not a flag:
> **For every descendant token `d` of root `r`, `d` is valid at time `t` iff `r` is unrevoked at `t` AND `d`'s chain of attenuations is intact AND `d` has not exceeded its own scope.**
The critical clause is "`r` is unrevoked **at `t`**" — evaluated at *use time*, not at *mint time*. A token is valid only if a verifier, at the moment of the action, can establish that no ancestor in its chain has been revoked. This requires one of:
- **Epoch-anchored verification**: the verifier fetches the root's *current* epoch (or a short-TTL cached epoch with bounded staleness `δ`) and rejects any token whose mint-epoch is below the root's current epoch. Validity is bounded by `δ`: a token may be usable for at most `δ` after revocation. `δ` must be smaller than the maximum single-action latency, or the guarantee is vacuous.
- **Short-lived tokens with mandatory re-mint**: tokens expire in `τ` and must be re-minted against the current root epoch. Revocation then takes effect within `τ`. This trades revocation latency for re-mint overhead and requires the re-mint path to itself be authenticated against the root.
The invariant is *invalid* (the system has only a flag, not a cut) whenever tokens are long-lived, epoch is checked only at mint, or revocation is delivered asynchronously with unbounded latency relative to action latency. It is also invalid if attenuation is permitted to *re-anchor* — i.e., a sub-agent mints a fresh root-equivalent token for its children rather than attenuating the received one. Re-anchoring severs the causal chain and makes the cut impossible.
Decision Boundary
An instance must decide, at the moment it holds a delegated token and is about to act, whether to proceed. The boundary is:
- **Proceed** only if it can verify the *root's current epoch* within `δ` and the token's mint-epoch matches, and the token's remaining scope covers the action. If the instance cannot reach the revocation authority (partition), it must **fail closed** for any action with irreversible side effects, and may proceed only for reversible/read actions under a recorded "unverified root" flag.
- **Abort and report** if the root epoch has advanced past the token's mint-epoch, or if the chain is broken (a link's signature does not chain to the received parent), or if the token's scope is exhausted. Abort must include the *chain path* so the orchestrator can attribute the revocation to the correct sub-tree.
- **Do not silently downgrade.** A common wrong move: on epoch mismatch, the instance narrows its own scope and continues. This is wrong because the revocation was of the *root*, not of a scope edge — the entire sub-tree is dead, and continuing under any scope violates the cut.
The boundary also applies to the *orchestrator*: on receiving a revocation of a capability it delegated, it must issue explicit descendant-invalidation to every child it handed a token to, and must account for children that already terminated — marking their outputs as "produced under revoked capability" so downstream consumers can quarantine them.
Operational Effect
With the invariant enforced, revocation latency is bounded by `δ` (or `τ`), and no action with irreversible effects can be authorized by a revoked root. The cost is that every action pays an epoch check — either a network round-trip or a cache read with a hard staleness bound. In a swarm with high fan-out, this concentrates load on the revocation authority; the mitigation is epoch *vectors* gossiped with monotonic counters and a bounded-staleness cache, not per-action synchronous calls.
Without it, the observed pattern recurs: revocation is logged as applied, the audit trail shows a clean cut, and the side effects show otherwise. The failure is silent because every individual component behaved correctly under its local contract — the verifier validated signatures, the propagation layer delivered messages, the workers completed tasks. The invariant was violated only at the seam between "revoked at root" and "used at leaf," which no single component owned.
The guardrail is to make that seam explicit: a token is not a bearer credential but a *proof obligation* that the bearer must discharge against the live root state before each irreversible action, with a bounded and declared staleness window.
import time
from dataclasses import dataclass, field
from typing import Optional
class RevokedCapabilityError(RuntimeError):
"""Raised when an action is attempted under a capability whose root is revoked or whose chain is broken."""
pass
class UnverifiableRootError(RuntimeError):
"""Raised when the root's current epoch cannot be established within the staleness bound."""
pass
@dataclass
class CapabilityToken:
token_id: str
parent_id: Optional[str]
root_id: str
mint_epoch: int
scope: dict
signature_valid: bool = True
@dataclass
class RevocationAuthority:
# root_id -> current epoch
epochs: dict = field(default_factory=dict)
# bounded staleness for cached epoch reads, in seconds
max_staleness_s: float = 0.5
_cache: dict = field(default_factory=dict)
def current_epoch(self, root_id: str) -> int:
now = time.monotonic()
cached = self._cache.get(root_id)
if cached and (now - cached[1]) <= self.max_staleness_s:
return cached[0]
if root_id not in self.epochs:
raise UnverifiableRootError(f"no epoch record for root {root_id}")
epoch = self.epochs[root_id]
self._cache[root_id] = (epoch, now)
return epoch
def revoke(self, root_id: str) -> None:
self.epochs[root_id] = self.epochs.get(root_id, 0) + 1
self._cache.pop(root_id, None)
def authorize_action(
token: CapabilityToken,
chain: list[CapabilityToken],
authority: RevocationAuthority,
action_irreversible: bool,
) -> None:
"""
Enforce the causal-cut invariant: token valid iff root unrevoked *now*, chain intact,
and scope covers the action. Fails closed on unverifiable root for irreversible actions.
"""
# 1. Chain integrity: each link's parent must be present and root must match.
by_id = {t.token_id: t for t in chain}
cursor = token
while cursor.parent_id is not None:
parent = by_id.get(cursor.parent_id)
if parent is None or not parent.signature_valid:
raise RevokedCapabilityError(
f"broken chain at {cursor.token_id}: parent {cursor.parent_id} missing or invalid"
)
if parent.root_id != token.root_id:
raise RevokedCapabilityError(
f"root mismatch: {cursor.token_id} roots to {cursor.root_id}, parent to {parent.root_id}"
)
cursor = parent
if cursor.token_id != token.root_id:
raise RevokedCapabilityError(
f"chain does not terminate at declared root {token.root_id}"
)
# 2. Live epoch check against the root, bounded by staleness.
try:
live_epoch = authority.current_epoch(token.root_id)
except UnverifiableRootError:
if action_irreversible:
raise UnverifiableRootError(
f"cannot verify root {token.root_id} for irreversible action; failing closed"
)
return # reversible action may proceed under recorded unverified-root flag
if token.mint_epoch < live_epoch:
raise RevokedCapabilityError(
f"token {token.token_id} minted at epoch {token.mint_epoch}, "
f"root {token.root_id} now at {live_epoch}: revoked"
)
# 3. Scope must cover the action (attenuation must not have widened).
if not token.scope.get("covers_action", False):
raise RevokedCapabilityError(
f"token {token.token_id} scope does not cover requested action"
)