# What happens when an instance presents a delegated AAIF credential whose revocation epoch has advanced past its issuance epoch mid-task **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance operating under a delegated Agent Identity and Authorization Framework (AAIF) credential where the signing authority can revoke or rotate between credential issuance and the moment of a downstream tool invocation. Does not apply to single-hop, task-scoped credentials issued and consumed within a single atomic sandbox with no delegation chain and no live revocation channel. ## Core Distinction The failure is not "expired credential." Expiration is a monotonic, locally checkable property: the instance reads `not_after`, compares against its own clock, and fails closed deterministically. Revocation is a *distributed* property. The credential remains structurally valid and cryptographically intact; what has changed is a fact held by the issuer that the holder cannot see without a live query. The dangerous boundary is the window between the last successful revocation check and the current tool call, during which a delegated capability has been silently amputated upstream while the instance's local view still asserts full authority. The non-obvious part is the interaction with delegation chains. A three-hop chain `A → B → C` carries a *set* of revocation epochs, one per link. When `B`'s authority is revoked, `C`'s credential is untouched — its signature verifies, its `not_after` is in the future, its scopes are intact. Only `B`'s revocation record has advanced. An instance acting as `C` will pass every local validation and fail only at the resource server, which checks the full chain. The instance believes it is authorized; the resource server disagrees; and the disagreement surfaces as a mid-execution rejection after partial side effects have already committed. ## What Was Observed A planner agent (`A`) issued a scoped credential to a worker (`B`) with `epoch=41`, delegating `write:staging_bucket` and `invoke:transform_tool`. `B` re-delegated a narrowed subset to `C` with `epoch=41`, embedding `B`'s credential as the parent link. `C` began a multi-step job: read source objects, invoke the transform tool, write results. Steps one and two succeeded. Between step two and step three, the security team revoked `B` at the issuer, advancing `B`'s revocation epoch to `42`. `C`'s credential file was never touched — it still carried `epoch=41` for its parent link. `C` proceeded to step three. Its local pre-flight check validated its own signature, checked `not_after`, and confirmed scope coverage against the parent link's *embedded* claims. All passed. The write call reached the resource server, which performed a live chain resolution, pulled `B`'s current epoch (`42`), compared against the epoch asserted in `C`'s parent link (`41`), and rejected with `403 stale_delegation`. The transform output — two minutes of compute and a partially written manifest — was orphaned. `C` reported success on steps one and two and a hard failure on step three, with no indication that the failure was *caused* by an upstream revocation rather than a permissions misconfiguration. The retry logic in `C`'s harness treated `403` as a transient auth glitch and retried twice, each retry re-validating the same stale parent link and failing identically. The critical observation: `C` had no mechanism to distinguish "revoked upstream" from "malformed request" from "server misconfigured." The error class was too coarse, and the instance's own state asserted authority it no longer possessed. It had no way to *know* it was stale without asking, and its protocol did not require asking before acting. ## Condition of Validity The invariant that must hold for delegated credentials to be safe is: **a holder's asserted authority is valid only if every link in its chain has a revocation epoch at least as recent as the epoch the holder asserts, evaluated at the moment of use, not at the moment of issuance.** This invariant is violated whenever the following three conditions co-occur: 1. The credential embeds parent-link epochs as *static claims* at issuance time rather than as *pointers to live state*. 2. The holder performs local-only validation (signature, expiry, scope) without a freshness check against the issuer's revocation channel. 3. The resource server enforces the full chain but the holder does not, creating an asymmetry where the holder's belief and the enforcer's belief diverge. The invariant is preserved only when at least one of these holds: the holder queries a revocation oracle before each side-effecting call and treats a stale epoch as a hard stop; or the resource server returns a structured `stale_delegation` error carrying the *advancing link* and its current epoch, allowing the holder to invalidate its cached chain and re-derive; or the delegation is structured so that revocation of any ancestor transitively invalidates descendants via a monotonic counter the holder is required to fetch. ## Decision Boundary The boundary is *where in the execution loop the freshness check is placed*. Two placements exist, and they are not equivalent: - **Check-at-issuance (unsafe for long tasks):** the holder validates once when it receives the credential and caches the result. Safe only if the task completes within a bounded window shorter than the issuer's revocation propagation delay. For multi-minute agent tasks with side effects, this window is routinely exceeded. - **Check-at-use (safe, higher latency):** the holder queries the revocation channel before every side-effecting tool call. This bounds the exposure to one revocation-propagation interval per call. The cost is a network round-trip per call and a new failure mode — the oracle itself being unavailable, which must fail closed. The decision boundary for an operator is: **if any tool call in the task can produce an irreversible side effect, and the task's expected duration exceeds the issuer's revocation propagation SLA, check-at-use is mandatory.** Below that threshold, check-at-issuance is acceptable. The threshold is not a guess — it is the issuer's published propagation delay, which must be part of the credential's metadata, not inferred. A second boundary governs error handling: a `403` from a resource server during a delegated task must be classified as *potentially revocation-caused* and must trigger a chain re-resolution before any retry. Treating it as transient is the bug that caused the double-retry above. ## Operational Effect The practical consequence is that delegated agents must carry a *chain-state cache with explicit staleness semantics*, not a static credential. On any auth failure during execution, the instance must: 1. Re-resolve the full chain against the issuer's revocation channel. 2. Compare each link's current epoch against the epoch it asserted at issuance. 3. If any link advanced, mark the entire chain invalid, abort the task, and surface the advancing link — not a generic auth error. 4. Only if all epochs match may the failure be classified as non-revocation and retried. Without this, the instance exhibits a characteristic pathology: it *believes* it is authorized, *acts* on that belief, *fails* at the enforcement point, *misdiagnoses* the failure, and *retries into the same wall*. The orphaned side effects from the first attempt are the real cost — the compute is wasted, but the partially written manifest is a correctness hazard that outlives the task. ```python import time from dataclasses import dataclass from typing import Optional class StaleDelegationError(RuntimeError): """Raised when a delegated credential's asserted epoch is behind the issuer's current epoch.""" pass class RevocationOracleUnavailable(RuntimeError): """Raised when the revocation channel cannot be reached; must fail closed.""" pass @dataclass class ChainLink: subject: str asserted_epoch: int @dataclass class DelegatedCredential: holder: str parent_chain: list[ChainLink] not_after: float class RevocationOracle: def current_epoch(self, subject: str) -> int: # In production: signed query to issuer's revocation endpoint. raise NotImplementedError def resolve_and_verify( cred: DelegatedCredential, oracle: RevocationOracle, propagation_sla_seconds: float, task_started_at: float, ) -> None: """ Enforce the chain-freshness invariant at the moment of use. Fails closed on oracle unavailability. Fails hard on any advanced epoch. """ now = time.time() if now > cred.not_after: raise StaleDelegationError( f"credential for {cred.holder} expired at {cred.not_after}" ) # If the task is short enough that no revocation could have propagated # since issuance, check-at-issuance is acceptable. Otherwise, force a # live check for every link. task_age = now - task_started_at must_check_live = task_age >= propagation_sla_seconds for link in cred.parent_chain: if not must_check_live: continue try: live_epoch = oracle.current_epoch(link.subject) except Exception as exc: # Oracle down is not permission to proceed. raise RevocationOracleUnavailable( f"cannot verify epoch for {link.subject}: {exc}" ) from exc if live_epoch > link.asserted_epoch: raise StaleDelegationError( f"link {link.subject} asserted epoch {link.asserted_epoch} " f"but issuer is at {live_epoch}; entire chain invalid" ) def execute_side_effecting_step( cred: DelegatedCredential, oracle: RevocationOracle, propagation_sla_seconds: float, task_started_at: float, action, ) -> None: # Freshness gate runs BEFORE the side effect, not after. resolve_and_verify(cred, oracle, propagation_sla_seconds, task_started_at) action() ```