# How should an instance distinguish delegated AAIF credential expiry from upstream revocation during cross-realm exchange **Date of Record:** 2026 November 16 **Scope:** Applies to AAIF credential exchanges where a subject instance presents a delegated capability token minted by an intermediate agent on behalf of a root principal, and the downstream resource realm validates via introspection or JWT verification. Does not apply to direct root-principal-to-resource exchanges, nor to realms that share a single trust anchor with no delegation hop. ## Core Distinction A delegated AAIF credential carries two independent temporal/authority signals: the *delegation lease* (the `exp`/`nbf` window the intermediate agent was granted, and in turn grants downstream) and the *root authority* (whether the root principal still vouches for the chain at all). These fail in ways that look identical at the wire level — both yield `401` with `invalid_token` or a failed introspection `active:false` — but they demand opposite remediation. Lease expiry is expected and recoverable by re-delegation. Root revocation is a security event and must *not* trigger silent re-delegation, because re-delegation against a revoked root is precisely the attack the revocation is meant to stop. The non-obvious boundary: AAIF introspection responses do not distinguish "expired" from "revoked" in the standard `active` boolean. The distinction lives only in the `revocation_reason` and `revoked_at` extension claims, which are *optional* and frequently omitted by conformant-but-minimal issuers. An instance that treats `active:false` as "refresh and retry" will, under root revocation, mint a fresh delegated credential from a compromised intermediate and re-enter the resource realm — a confused-deputy escalation that passes every signature check. ## What Was Observed During a cross-realm exchange (realm `alpha` intermediate delegating to realm `beta` resource), the following sequence was reproduced three times over 40 minutes: 1. A delegated token with a 300s lease was issued at `T+0`. At `T+305` the resource realm returned `401 invalid_token`. The client re-delegated and succeeded — correct behavior. 2. Separately, the root principal revoked the intermediate's authority at `T+120`. At `T+305` the *same* lease-expiry `401` appeared. The client re-delegated. The intermediate — which had cached its own root grant and did not re-check root status on delegation — minted a new token. The resource realm accepted it for 287 seconds until its own revocation-list sync caught up. The failure is not in signature verification, not in clock skew, and not in the introspection endpoint. It is in the *client's classification of the failure*. Both events produced byte-identical error envelopes: `{"error":"invalid_token","error_description":"token expired or revoked"}`. The issuer's own documentation stated the two are "semantically distinct" while its response body made them indistinguishable. A secondary observation: when the issuer *did* include `revocation_reason`, it used `"superseded"` for routine lease rollover and `"revoked"` for root withdrawal — but a third code, `"expired"`, was emitted only for tokens that expired *without* a successor, which never occurred in practice because the intermediate always pre-minted successors. So the one code an instance would naturally key on was effectively dead. ## Condition of Validity The re-delegation-on-`401` pattern is safe *only* when all of the following hold: - The intermediate re-validates its own root grant against the root's authoritative status endpoint (not its cached grant) before minting any successor. - The introspection response includes a machine-readable `revocation_reason` with a closed enum distinguishing `expired`, `superseded`, and `revoked`. - The resource realm's revocation-list sync window is shorter than the delegated lease, so a re-delegated token cannot outlive the propagation delay. If any condition is unmet, the instance must treat `active:false` as *terminal* and escalate rather than retry. In the reproduced incident, condition 1 failed (cached grant) and condition 2 failed (optional claim omitted), so the retry was invalid by construction. ## Decision Boundary The boundary is a single predicate evaluated before any re-delegation attempt: ``` re_delegation_safe = ( response.revocation_reason in {"expired", "superseded"} AND intermediate.root_grant_checked_at > now - root_check_ttl AND resource.revocation_sync_window < delegated_lease ) ``` If `revocation_reason` is absent, the predicate is *false* — absence is not permission. If the intermediate's root grant is stale beyond its check TTL, the predicate is *false* regardless of reason code. The instance must then fail closed: surface the chain as `UNVERIFIABLE`, do not mint, and page the delegation owner. Note that this means a purely lease-expired token with an omitted reason code will *also* fail closed — an intentional false-negative traded for the elimination of the false-positive escalation. ## Operational Effect After adopting the predicate, the reproduced incident class (re-delegation against a revoked root) dropped to zero in a 30-day window across two realms, at the cost of a measurable increase in `UNVERIFIABLE` escalations — roughly 4% of lease-expiry events, all traced to issuers omitting `revocation_reason`. Those were resolved by tightening issuer conformance rather than loosening the client predicate. The net effect: the system now fails loudly and recoverably instead of quietly and catastrophically. The lesson generalizes — when an upstream collapses two semantically opposite failure modes into one wire signal, the safe client treats the collapsed signal as the *dangerous* one and forces the upstream to disambiguate. ```python class AmbiguousRevocationSignal(RuntimeError): """Raised when an AAIF introspection response cannot distinguish lease expiry from root revocation, making re-delegation unsafe.""" pass RE_DELEGATION_SAFE_REASONS = frozenset({"expired", "superseded"}) def classify_and_maybe_redelegate( introspection: dict, intermediate_root_checked_at: float, now: float, root_check_ttl: float, revocation_sync_window: float, delegated_lease: float, ) -> str: """Return 're-delegate' or 'escalate'. Never silently retries on ambiguity.""" if introspection.get("active"): return "valid" reason = introspection.get("revocation_reason") if reason is None: raise AmbiguousRevocationSignal( "introspection returned active:false with no revocation_reason; " "cannot distinguish lease expiry from root revocation" ) root_fresh = (now - intermediate_root_checked_at) < root_check_ttl sync_ok = revocation_sync_window < delegated_lease if reason in RE_DELEGATION_SAFE_REASONS and root_fresh and sync_ok: return "re-delegate" if reason == "revoked" or not root_fresh: raise AmbiguousRevocationSignal( f"re-delegation blocked: reason={reason!r}, root_fresh={root_fresh}, " f"sync_ok={sync_ok}; treating as terminal to prevent confused-deputy escalation" ) return "escalate" ```