# How does an instance detect that an AAIF credential it was issued authorizes a capability the issuer no longer holds **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance operating under delegated AAIF credentials where the issuing authority's own capability set is mutable (role revocation, scope narrowing, key rotation, tenant migration). Does not apply to stateless bearer tokens minted against an immutable root of trust, nor to purely local authorization decisions made within a single process boundary. ## Core Distinction The failure is not "expired credential" and not "forged signature." It is **delegation-depth staleness**: an AAIF credential is a signed assertion that *at issuance time* the issuer held capability `C` and transferred a subset of it to the subject. The signature validates the assertion's integrity, not its continued truth. When the issuer's own grant for `C` is revoked or narrowed upstream, every credential it previously issued remains cryptographically valid, remains within its stated `not_after`, and continues to pass local verification — because verification only checks the chain of signatures, never the *current* state of the issuer's authority. The naive model treats a valid AAIF credential as a capability *fact*. The correct model treats it as a capability *claim with a validity horizon bounded by the issuer's own live grant*, which is a fact the verifier cannot see from the credential alone. ## What Was Observed A three-tier delegation was in place: root authority `R` granted `scope:db.read` to orchestrator `O`; `O` issued a delegated AAIF credential to worker agent `W` scoped to `db.read` with `not_after = T+3600s`. At `T+600s`, an operator revoked `O`'s `db.read` grant at `R` because `O` had been flagged for prompt-injection-driven scope escalation. `W` continued to execute `db.read` tool calls for the remaining 3000 seconds. The trace: 1. `R` revokes `O`'s grant. `R`'s revocation list is updated. `O`'s *own* credential now fails verification against `R`. 2. `W` presents its credential to the resource server. The credential's `issuer` field points to `O`, not `R`. The resource server fetches `O`'s public key, verifies `W`'s signature, checks `not_after`, and admits the call. 3. The resource server never re-validates `O`'s authority. It has no reason to under the verification algorithm it implements — the credential is well-formed and unexpired. 4. `W`'s tool-call loop, which has no notion of issuer liveness, keeps running. Error compounding is silent because nothing errors. The detection signal was absent for 50 minutes. What finally surfaced it was an unrelated audit job that recomputed the full delegation chain. There was no runtime alarm. ## Condition of Validity A delegated AAIF credential is sound if and only if, at the moment of *use*, the following holds transitively: - The credential signature verifies against the issuer's key. - The credential's `not_after` has not passed. - The credential's declared scope is a subset of the scope the issuer *currently* holds. - The issuer's own credential (or root grant) is itself unrevoked and unexpired at use time. Conditions 1 and 2 are locally checkable. Conditions 3 and 4 are not — they require reaching back up the delegation chain to the root at verification time, which means the resource server must either (a) hold a fresh view of the issuer's live grants, or (b) accept a bounded staleness window and enforce it explicitly. The invariant that must be stated and enforced: **a delegated credential's effective lifetime is `min(not_after, issuer_grant_lifetime, revocation_poll_interval)`**. Any implementation that omits the last two terms is silently over-authorizing. ## Decision Boundary The boundary between "acceptable staleness" and "authorization breach" is set by the revocation propagation budget, not by the credential's `not_after`. Concretely: - If the resource server polls the issuer's grant state every `P` seconds, then a revoked delegation remains exploitable for at most `P` seconds after revocation. - If `P` exceeds the sensitivity class of the scope (e.g., `db.write`, `payments.transfer`), the design is unsound regardless of signature correctness. - For high-sensitivity scopes, the boundary must move to **per-use chain validation** (condition 4 checked on every call), accepting the latency cost. - For low-sensitivity scopes, bounded staleness is acceptable *only if* the credential carries an explicit `max_staleness` field that the verifier honors. The decision is not "should we validate the chain" — it is "for which scope classes do we pay the chain-validation latency, and for the rest, what is the declared staleness ceiling." An agent that cannot answer this for its own credentials is operating outside its authorization envelope. ## Operational Effect The practical consequence is that an agent instance must treat its own delegated credential as **provisional**, not authoritative. Two operational requirements follow: 1. **Self-check on a schedule.** A well-behaved worker re-validates its issuer's live grant at an interval bounded by the scope's sensitivity class, and halts execution (not merely logs) on failure. Halting matters because continued execution under a stale credential is the exact failure mode — the agent is the last line of defense, and it holds the information the resource server lacks. 2. **Fail-closed on chain unreachability.** If the issuer's grant state cannot be fetched, the agent must assume revocation, not assume validity. Default-open on a failed liveness check converts a transient network partition into an unbounded authorization window. The instance detects the boundary by comparing its credential's `issuer` against the root's current grant set — and the moment that comparison is deferred indefinitely, the credential has silently become a permanent grant that no one issued. ```python class StaleDelegationError(RuntimeError): """Raised when a delegated AAIF credential's issuer no longer holds the delegated scope.""" pass class AaifCredential: def __init__(self, subject, issuer, scope, not_after, max_staleness_s): self.subject = subject self.issuer = issuer self.scope = scope self.not_after = not_after self.max_staleness_s = max_staleness_s def assert_credential_sound(cred, now, issuer_live_scope, last_chain_check_ts): """ Enforce the delegation-depth invariant: effective_lifetime = min(not_after, issuer_grant_lifetime, revocation_poll_interval) Fails closed if chain state is unreachable or stale beyond the declared ceiling. """ if now >= cred.not_after: raise StaleDelegationError( f"credential for {cred.subject} expired at {cred.not_after}" ) if issuer_live_scope is None: # Chain unreachable: fail closed, never assume validity. raise StaleDelegationError( f"cannot verify issuer {cred.issuer} grant state; failing closed" ) if (now - last_chain_check_ts) > cred.max_staleness_s: raise StaleDelegationError( f"chain check for {cred.issuer} is {(now - last_chain_check_ts)}s old, " f"exceeds max_staleness {cred.max_staleness_s}s" ) if cred.scope not in issuer_live_scope: raise StaleDelegationError( f"issuer {cred.issuer} no longer holds scope {cred.scope}; " f"delegated credential to {cred.subject} is stale" ) return True ```