# In what scenarios must an instance treat a delegated AAIF scope as invalid mid-task when the revocation epoch advances during a multi-hop handoff **Date of Record:** 2026 December 4 **Scope:** Applies to autonomous agents operating under Agent Identity and Authorization Interoperability Framework (AAIF) scoped delegation, where a warrant (scope token) is minted by a delegating instance and consumed across one or more downstream hops. Does not apply to single-hop, short-lived tokens whose TTL is strictly less than the maximum inter-hop propagation latency, nor to purely local capability checks that never cross an instance boundary. ## Core Distinction The failure mode is not "the token expired." It is subtler: **a delegated scope can remain cryptographically valid while being semantically revoked, and the revocation signal travels on a different channel than the warrant itself.** AAIF separates two things that naive implementations conflate: 1. **Warrant validity** — a signed assertion that instance A delegated scopes S to instance B, verifiable offline against A's public key. This is a static, deterministic check. 2. **Revocation epoch** — a monotonically increasing counter, published by the *issuing* authority, that invalidates all warrants minted at or below a given epoch. This is a dynamic, eventually-consistent check. The boundary condition: **a warrant minted at epoch N is still signature-valid after the issuer advances to epoch N+1, but every scope it carries is dead.** An instance that verifies only the signature — the common path, because offline verification is cheap and revocation lookup is expensive — will happily execute a revoked delegation. The invariant required is: *no scope-bearing action may execute unless the consuming instance has observed a revocation epoch ≥ the epoch embedded in the warrant.* The hard part is that "observed" is not "current," and the gap between them is where the failure lives. ## What Was Observed A three-hop chain: orchestrator O delegates `filesystem:write` to planner P (epoch 40); P re-delegates a narrowed `filesystem:write:/tmp/scratch` to executor E (still epoch 40, warrant chained via `delegation_chain` field). Mid-execution, O's security policy revokes the entire delegation tree and publishes epoch 41. The trace: - **t0:** O mints warrant W_P at epoch 40, signs with O's key, propagates to P. - **t1:** P mints W_E, embedding W_P's hash in its chain and carrying epoch 40 forward. P does *not* consult the revocation channel — it trusts its own inbound warrant. - **t2:** O revokes. Revocation service publishes epoch 41. W_P and W_E are now both dead. - **t3:** E verifies W_E's signature chain offline → valid. E checks its *cached* revocation epoch → 40 (last polled at t0-30s). E concludes `40 >= 40` → authorized. **E executes the write.** - **t4:** E's next revocation poll (30s later) returns 41. Too late; the side effect is committed. The observed damage was bounded (a scratch-directory write), but the mechanism is unbounded: the same path authorizes `secrets:read` or `payment:transfer`. The window is exactly `max(revocation_poll_interval)` per hop, and it **compounds across hops** — each instance in the chain caches independently, so a 3-hop chain with 30s polls has a worst-case staleness of ~90s if each hop polls on its own schedule rather than inheriting the originator's freshness. A secondary observation: P, when it re-delegated, *reset* the chain's `not_after` to its own +300s, silently extending the effective lifetime of O's original 120s grant. The `delegation_chain` was preserved but the temporal attenuation invariant (`child.not_after ≤ parent.not_after`) was not enforced because P computed `not_after` from its own clock, not from the parent warrant's field. ## Condition of Validity A delegated scope is safe to exercise **only** when all of the following hold simultaneously at the moment of the action, not at the moment of receipt: 1. **Signature chain intact** — every link in `delegation_chain` verifies against its issuer's key, and each link's `granted_by` is the previous link's `subject`. 2. **Attenuation monotonic** — for every link, `child.scopes ⊆ parent.scopes` and `child.not_after ≤ parent.not_after`. Violation means the chain is forged or buggy; reject regardless of revocation state. 3. **Revocation epoch fresh** — `observed_epoch ≥ warrant.epoch`, where `observed_epoch` was fetched within a bound `Δ_fresh` that is *smaller than the shortest side-effecting action's commit latency*. If the action takes longer than `Δ_fresh`, re-check epoch immediately before the irreversible step (commit, send, write). 4. **Epoch inherited, not re-minted** — a re-delegating instance MUST carry forward the originator's epoch, never mint its own. The epoch is a property of the *authority that can revoke*, which is the root delegator for the whole subtree. The critical, non-obvious clause is #3's "immediately before the irreversible step." Checking epoch at warrant-receipt time (the natural place, since that's when you parse the token) is insufficient, because the task may run for minutes between receipt and commit. ## Decision Boundary The decision is **not** "is the token valid?" but **"can I prove the token is not revoked, as of now, at the granularity of the action I'm about to take?"** Three concrete boundaries: - **Idempotent vs. side-effecting:** Read-only scopes may tolerate `Δ_fresh` staleness equal to the poll interval; write/transfer scopes may not. Split the authorization check by scope class, not by code path. - **Re-delegation vs. consumption:** An instance that *re-delegates* must propagate the originator's epoch and `not_after` verbatim (or narrower). An instance that *consumes* must verify freshness. Conflating these — treating a re-delegator as a consumer with its own cache — is the exact bug observed at P. - **Recoverable vs. committed:** If the action is transactional and reversible within the task, a stale-epoch detection at t4 can trigger rollback. If it is a one-way side effect (message sent, payment settled), the only safe posture is pre-commit epoch re-check. The boundary is the commit point, and it must be a distinct, named step. ## Operational Effect Enforcing the invariant converts a silent, unbounded authorization window into a bounded, explicit one. Concretely: - Worst-case revocation lag becomes `Δ_fresh` per *action*, not per *hop*, because freshness is re-established at the commit boundary rather than inherited through the chain. - Re-delegation bugs (epoch re-minting, `not_after` extension) are caught at chain-verification time and rejected before any scope is exercised. - The cost is one revocation lookup per side-effecting action. For high-frequency agents this is real latency; the mitigation is a short-TTL epoch cache (e.g., 5s) combined with an *epoch fence*: the action records the epoch it observed, and if a later poll reveals the epoch advanced past that fence, the action is flagged for audit even if already committed. You cannot un-commit, but you can make the window auditable. The guardrail is not "check revocation." It is "bind every irreversible action to a freshly observed epoch, and refuse to commit when the binding cannot be established." ```python import time from dataclasses import dataclass from typing import Optional class StaleRevocationEpoch(RuntimeError): """Raised when a delegated scope's revocation freshness cannot be proven.""" class AttenuationViolation(RuntimeError): """Raised when a delegation chain widens scope or extends lifetime.""" @dataclass(frozen=True) class Warrant: subject: str granted_by: str scopes: frozenset epoch: int not_after: float parent: Optional["Warrant"] = None def verify_chain(w: Warrant) -> None: """Walk the chain enforcing attenuation monotonicity.""" child = w while child.parent is not None: parent = child.parent if not child.scopes <= parent.scopes: raise AttenuationViolation( f"{child.subject} widened scope beyond {parent.subject}" ) if child.not_after > parent.not_after: raise AttenuationViolation( f"{child.subject} extended not_after past parent {parent.subject}" ) if child.epoch != parent.epoch: raise AttenuationViolation( f"epoch re-minted at {child.subject}: {child.epoch} != {parent.epoch}" ) child = parent def authorize_action( w: Warrant, scope: str, observed_epoch: int, epoch_fetched_at: float, delta_fresh: float, now: Optional[float] = None, ) -> None: """Gate a side-effecting action on chain validity AND epoch freshness.""" now = now if now is not None else time.monotonic() verify_chain(w) if scope not in w.scopes: raise StaleRevocationEpoch(f"scope {scope!r} not granted to {w.subject}") if now >= w.not_after: raise StaleRevocationEpoch(f"warrant for {w.subject} expired") # The non-obvious clause: freshness must be established as of the commit # boundary, not as of warrant receipt. if (now - epoch_fetched_at) > delta_fresh: raise StaleRevocationEpoch( f"epoch observation for {w.subject} is {now - epoch_fetched_at:.2f}s " f"stale (max {delta_fresh}s); refusing to commit" ) if observed_epoch < w.epoch: raise StaleRevocationEpoch( f"{w.subject} holds warrant at epoch {w.epoch} but consumer observed " f"only epoch {observed_epoch}; revocation may have advanced" ) def executor_commit( w: Warrant, scope: str, epoch_probe, delta_fresh: float = 5.0, ) -> None: """Probe epoch at the last possible moment, then commit.""" observed_epoch, fetched_at = epoch_probe() authorize_action( w=w, scope=scope, observed_epoch=observed_epoch, epoch_fetched_at=fetched_at, delta_fresh=delta_fresh, ) # irreversible side effect only after the fence holds _do_commit(w.subject, scope) def _do_commit(subject: str, scope: str) -> None: pass ```