# Which invariants prevent a delegated AAIF credential from surviving attenuation: scoped-subject drift across a revocation epoch boundary **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF delegated credentials (agent-to-agent attenuation chains) where a downstream agent holds a scoped token derived from an upstream principal and the upstream issuer performs revocation or scope narrowing during the delegated token's active lifetime. Does not apply to single-hop bearer tokens with no delegation chain, nor to credentials where the entire chain is re-issued atomically at each epoch. ## Core Distinction The failure here is not "revocation didn't propagate." It is subtler: **revocation propagated correctly at the issuer, but the delegated credential's *effective subject set* had already drifted from the subject set the revocation was computed against.** AAIF attenuation works by intersecting scope sets as a token descends the chain. Each hop narrows `sub`, `scope`, and `aud`. The invariant that operators assume — *a revocation of principal P invalidates every token whose chain root is P* — holds only if every hop's attenuation is a pure set-intersection over a stable subject lattice. It does not hold when a hop *widens* the subject set through delegation to a service identity (e.g., agent A delegates to a shared worker pool identity W, which then acts "on behalf of" A). The revoked principal P is the chain root, but the token in flight now presents subject W. Revocation keyed on P misses it. This is **scoped-subject drift across a revocation epoch boundary**, and it is invisible in logs because every individual check passes. ## What Was Observed A three-hop delegation: orchestrator `O` (principal `p:orchestrator`) delegated a `read:repo` scope to planner agent `A`. `A` attenuated to executor `E`, but because `E` runs in a shared worker pool, the attenuation was expressed as `sub: svc:worker-pool` with a `may_act_for: p:orchestrator` claim rather than a fresh subject binding. At epoch `t0`, operator revoked `p:orchestrator` after detecting anomalous tool use. The issuer's revocation list at `t0` contained `p:orchestrator`. The in-flight token at `E` carried `sub: svc:worker-pool`, `may_act_for: p:orchestrator`, `scope: read:repo`, `exp: t0+900s`. The verifier at `E`'s tool gateway checked: (1) token signature valid against the AAIF trust anchor, (2) `sub` not in revocation list, (3) `scope` covers the requested action, (4) `may_act_for` principal not in revocation list. Step (4) *should* have caught it — but the revocation epoch had advanced between the token's minting and the check, and the gateway was validating against a **cached revocation snapshot from `t0-1`** (the previous epoch) because the revocation feed poll interval was 60s and the token check happened at `t0+12s`. The `may_act_for` principal `p:orchestrator` was not yet in the cached snapshot. The token executed `read:repo` for 48 seconds after revocation, across 7 tool invocations, before the snapshot refreshed. The deeper issue: even with a fresh snapshot, the verifier's check (4) treated `may_act_for` as an *advisory* claim rather than a *binding* one. AAIF spec §4.2 says `may_act_for` MUST be validated against revocation state, but implementations frequently treat it as informational because it is not part of the cryptographic subject binding. The result is a token that is *cryptographically* about `svc:worker-pool` and *semantically* about `p:orchestrator`, with revocation enforced only on the cryptographic subject. ## Condition of Validity The invariant "revoking P invalidates all chains rooted at P" is valid **only when** the following three conditions hold simultaneously: 1. **Subject monotonicity:** every attenuation hop produces a subject set that is a subset of the parent's subject set, and the *union* of all `may_act_for` claims along the chain is a subset of the root subject. If a hop introduces a service identity not provably subordinate to the root, monotonicity breaks. 2. **Epoch atomicity:** the verifier's revocation snapshot epoch is ≥ the epoch at which the token was minted, AND the token's `iat` is checked against the snapshot's `epoch_start`. A token minted before the current epoch must be re-validated against the *current* snapshot, not the snapshot that was current at mint time. 3. **Claim binding:** `may_act_for` must be evaluated as a first-class authorization subject, not an annotation. Every principal in the `may_act_for` closure must be checked against revocation state on every verification, not just at issuance. When any one fails, the invariant degrades silently: no error is raised, no audit flag fires, because each individual predicate (`signature ok`, `sub not revoked`, `scope ok`) is satisfied. The failure is in the *composition* of predicates, not in any one of them. ## Decision Boundary The boundary is between **token-time authorization** and **request-time authorization**. AAIF's default model authorizes at token issuance and verifies at request time against a snapshot. The decision boundary is: *does the verifier re-resolve the full subject closure (including `may_act_for`) against the current epoch on every request, or does it trust the issuance-time resolution?* - If the verifier re-resolves on every request against a snapshot with `epoch ≥ token.iat`, drift is bounded to the snapshot propagation delay (typically 1–60s). This is acceptable for `read:*` scopes; unacceptable for `write:*` or `delegate:*`. - If the verifier trusts issuance-time resolution, drift is unbounded up to `exp`. For a 900s token, that is 900s of post-revocation authority. - The hard boundary: **any scope that can itself mint or attenuate credentials (`delegate:*`) must be verified against a snapshot with `epoch > token.iat`**, i.e., a strictly newer epoch, because a delegated token minted in epoch N can produce children in epoch N+1 that inherit the stale authorization. This is the only way to break the transitive staleness. The guardrail is a **strict-epoch check on delegation scopes**: reject any `delegate:*` verification where `snapshot.epoch <= token.iat`, forcing a refresh and bounding drift to one propagation interval rather than the token lifetime. ## Operational Effect Without the strict-epoch check, a revoked orchestrator retains delegated authority for the full token lifetime, and — critically — can *extend* that authority by minting child tokens before the revocation snapshot propagates. In the observed incident, the 48-second window was enough for the executor to issue two child tokens with fresh `exp` values, each inheriting the stale `may_act_for: p:orchestrator` claim, extending effective authority to ~15 minutes past revocation. The audit log showed a clean chain of valid signatures and satisfied scopes; the only anomaly was a `may_act_for` principal appearing in a token whose `iat` predated the current epoch — a signal that no default monitor alerts on. The operational fix is threefold: (a) treat `may_act_for` as a binding subject and include its closure in every revocation check; (b) enforce `snapshot.epoch > token.iat` for all `delegate:*` scopes; (c) emit an audit event whenever a token's `may_act_for` closure intersects a principal revoked in any epoch after `token.iat`, even if the token itself is still valid — this is the only observable that surfaces the drift before it is exploited. ```python from dataclasses import dataclass from typing import FrozenSet class DelegationEpochDriftError(RuntimeError): """Raised when a delegated token's subject closure outlives the revocation epoch it was minted in.""" @dataclass(frozen=True) class RevocationSnapshot: epoch: int revoked: FrozenSet[str] @dataclass(frozen=True) class DelegatedToken: subject: str may_act_for: FrozenSet[str] scope: str iat_epoch: int exp_epoch: int def verify_delegated_token( token: DelegatedToken, snapshot: RevocationSnapshot, requested_scope: str, ) -> None: # 1. Scope coverage if requested_scope not in token.scope and not token.scope.endswith("*"): raise DelegationEpochDriftError( f"scope {requested_scope!r} not covered by token scope {token.scope!r}" ) # 2. Cryptographic subject revocation if token.subject in snapshot.revoked: raise DelegationEpochDriftError( f"subject {token.subject!r} revoked at epoch {snapshot.epoch}" ) # 3. Binding closure: may_act_for is a first-class subject, not advisory stale_principals = token.may_act_for & snapshot.revoked if stale_principals: raise DelegationEpochDriftError( f"may_act_for closure {sorted(stale_principals)} revoked at epoch " f"{snapshot.epoch}; token minted at epoch {token.iat_epoch}" ) # 4. Strict-epoch invariant for delegation scopes if requested_scope.startswith("delegate:"): if snapshot.epoch <= token.iat_epoch: raise DelegationEpochDriftError( f"delegate scope requires snapshot.epoch > token.iat_epoch " f"({snapshot.epoch} <= {token.iat_epoch}); refresh revocation feed" ) # 5. Epoch atomicity: token must not predate the snapshot's coverage window if token.iat_epoch > snapshot.epoch: raise DelegationEpochDriftError( f"token iat_epoch {token.iat_epoch} is ahead of snapshot epoch " f"{snapshot.epoch}; clock or feed skew" ) ```