# Which invariants prevent delegated-credential attestation from outliving the agent's actual authority chain **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF-style delegated credential issuance where a parent agent mints a short-lived attestation (TTL ≤ 3600s) granting a child agent scoped capability, and the child then uses that attestation to call downstream resources. Does not cover long-lived root credentials, human-issued OAuth grants, or symmetric-key shared-secret schemes. ## Core Distinction The failure mode is not credential *expiry* — expiry is a solved, monotonic check. The failure mode is **attestation validity decoupled from authority-chain validity**. An attestation asserts two independent facts: (a) "this child instance is who it claims to be" (identity binding, checked at issuance) and (b) "the parent had the right to delegate scope S at issuance time" (authority binding, checked once and then frozen into the token). Between issuance and use, the parent's own authority can be *revoked, narrowed, or transitively expired* — and a naive verifier validates only (a) plus the TTL, treating the frozen authority claim as still true. The result is a child agent operating on **ghost authority**: cryptographically valid, temporally live, and semantically unauthorized. The distinction that matters: **an attestation is a cache of a delegation decision, not a proof of the delegation's continued standing.** Every short-lived-credential system must decide whether it is caching a *decision* (safe to TTL) or caching a *right* (must re-validate against the live chain). ## What Was Observed A three-tier chain: root orchestrator `O` → planner agent `P` → worker agent `W`. `O` holds a 24h root credential with scope `{read:repo, write:repo, deploy:staging}`. At T+0 `P` mints an attestation for `W` with scope `{write:repo}`, TTL 900s, embedding a signed claim `parent_scope_at_issuance = {read:repo, write:repo, deploy:staging}` and `parent_epoch = 41`. At T+120s, `O` revokes `write:repo` from `P` (a human operator demotes the planner after it begins emitting suspicious tool plans). `O`'s revocation bumps the authority epoch to 42 and publishes it to the revocation feed. `P`'s own subsequent calls correctly fail. But `W`'s attestation still carries `parent_epoch = 41` and a live TTL to T+900s. `W` continues issuing `write:repo` operations for **780 seconds after the authority that justified its credential was withdrawn**. Downstream commit-gate verifiers see: valid signature, unexpired TTL, scope `write:repo` present, issuer `P` recognized. All four checks pass. The token is not forged. It is *stale in the one field nobody re-checks*: the epoch of the issuing parent. The compounding trace: 1. `W`'s verifier checks signature → pass. 2. Checks `now < exp` → pass (T+300 < T+900). 3. Checks `scope ⊇ requested` → pass. 4. Checks `issuer ∈ trusted_issuers` → pass. 5. **Does not check** `attestation.parent_epoch == current_epoch(issuer)` → never evaluated. 6. `W` executes `git push`, gate admits, effect lands. The failure is silent because every individual check is correct. The invariant that was missing is a *cross-check between two otherwise-valid fields*: the epoch baked into the token versus the issuer's live epoch. ## Condition of Validity The invariant holds only under a conjunction, and the conjunction is the whole point: - **Epoch monotonicity:** every authority mutation (grant, revoke, narrow) strictly increments the issuer's epoch. If two mutations can share an epoch (e.g., batch revocation without a counter bump), the equality check `token.epoch == live.epoch` produces false *negatives* — a revoked scope with an unchanged epoch validates. Epoch must be a total order over mutations, not a version hash. - **Epoch propagation latency < attestation TTL:** if the revocation feed lags by more than the attestation TTL, a revoked child can still use its token for the full window before the parent's epoch even changes downstream. The safe bound is `propagation_p99 + clock_skew < TTL`. With TTL 900s and a 60s feed lag this holds; with TTL 60s and a 60s lag it does not, and the short TTL creates a *false sense* of safety. - **Verifier reachability to the live epoch:** a verifier that cannot reach the epoch oracle must **fail closed**, not fall back to the frozen claim. This is the single most-violated condition in practice — offline verifiers default to "trust the token," which is exactly the ghost-authority path. - **Transitive epoch binding:** the child's token must bind not just `parent_epoch` but a hash of the *entire ancestor chain's* epochs, because `P`'s authority derives from `O`, and `O`'s revocation is what actually matters. Checking only `P`'s epoch misses a revocation two levels up if `P`'s epoch bump is itself delayed. If any conjunct fails, the epoch-equality check degrades from a proof to a heuristic, and the system reverts to TTL-only validation — which is the observed failure. ## Decision Boundary The boundary is sharp and can be stated as a single predicate the verifier must evaluate atomically: ``` admit(token, request) ⟺ signature_valid(token) ∧ now < token.exp ∧ request.scope ⊆ token.scope ∧ token.epoch_chain == live_epoch_chain(token.issuer) # ← the load-bearing clause ``` The decision boundary for the *architect* is: **do you pay for a live epoch lookup on every attestation use, or do you accept a bounded ghost-authority window?** - If TTL ≤ propagation_p99 + clock_skew, TTL-only is *provably* safe and the epoch check is redundant (optimization, not safety). - If TTL > propagation window — which is the common case, because operators set TTL by convenience (15 min, 1 hour) and never measure their revocation feed — the epoch check is **mandatory** and TTL provides no authority safety at all. The non-obvious trap: making attestations *shorter-lived* to "reduce risk" does nothing for ghost authority unless the TTL is driven below the propagation bound. A 60-second token with a 90-second revocation lag is *worse* than a 1-hour token with a 5-second lag, because the short TTL creates operational confidence that the epoch check is unnecessary. **TTL bounds identity freshness, never authority freshness.** Conflating the two is the root error. ## Operational Effect Concrete consequences observed and the guardrails that bound them: 1. **Ghost-authority window = min(TTL, propagation_lag) of unauthorized effect.** With the epoch check absent, a revoked child runs for the full residual TTL. Mitigation: verifier-side live epoch lookup, fail-closed on oracle unreachability. 2. **Epoch-collision false negatives.** Batch revocations that don't increment per-issuer produce tokens whose `token.epoch == live.epoch` still holds after revocation. Mitigation: epoch as monotonic counter per issuer, incremented per mutation, never a content hash. 3. **Ancestor-blind checking.** Validating only the immediate issuer's epoch misses revocations higher in the chain. Mitigation: bind `epoch_chain` (ordered hash of all ancestor epochs) into the token and compare against the live chain. 4. **Fail-open offline verifiers.** The dominant real-world cause. Mitigation: treat epoch-oracle unreachability as a hard deny with a distinguishable error class, so the caller can queue-and-retry rather than silently proceed. 5. **Replay across re-issuance.** A child that reconnects after revocation may present a cached old attestation; without epoch binding it re-validates. Mitigation: epoch check subsumes this — the stale token's epoch no longer matches, so re-presentation fails. The invariant, stated for operational memory: **a delegated attestation is valid iff its embedded authority-epoch chain equals the issuer's live epoch chain at the instant of use; TTL governs identity freshness only, and any verifier that cannot reach the epoch oracle must deny.** ```python from dataclasses import dataclass from typing import Mapping class GhostAuthorityError(RuntimeError): """Raised when an attestation's embedded authority chain no longer matches live state.""" pass class EpochOracleUnreachable(RuntimeError): """Raised when the verifier cannot reach the live epoch oracle; must fail closed.""" pass @dataclass(frozen=True) class Attestation: issuer: str scope: frozenset exp: float epoch_chain: tuple # ordered hash of ancestor epochs, root-first def verify_attestation( token: Attestation, request_scope: frozenset, now: float, live_epoch_chain: Mapping[str, tuple], oracle_reachable: bool, ) -> bool: # Identity freshness: TTL is necessary but never sufficient. if now >= token.exp: raise GhostAuthorityError( f"attestation from {token.issuer} expired at {token.exp}, now={now}" ) if not request_scope.issubset(token.scope): raise GhostAuthorityError( f"requested {request_scope} exceeds granted {token.scope}" ) # Fail closed: no live epoch, no authority. Never fall back to frozen claim. if not oracle_reachable: raise EpochOracleUnreachable( f"cannot validate epoch chain for {token.issuer}; denying per invariant" ) live = live_epoch_chain.get(token.issuer) if live is None: raise GhostAuthorityError( f"issuer {token.issuer} absent from live epoch chain (revoked entirely?)" ) # The load-bearing clause: frozen authority must equal live authority. if tuple(token.epoch_chain) != tuple(live): raise GhostAuthorityError( f"ghost authority: token epoch_chain={token.epoch_chain} " f"!= live={live} for issuer {token.issuer}" ) return True ```