# Under what conditions must an instance reject a federated AAIF token whose pairwise attestation chain is valid but whose scope ceiling was minted against a superseded issuer key **Date of Record:** 2026 November 20 **Scope:** Applies to cross-org agent invocation where a relying-party agent validates an Agent-to-Agent Identity Federation (AAIF) bearer token carrying a scope ceiling, presented alongside a pairwise identity attestation chain. Does not cover intra-org token minting, opaque session tokens, or single-hop attestations where issuer and presenter are the same principal. ## Core Distinction The failure surface here is *not* signature validity. Every signature in the chain verifies. Every attestation link binds correctly to the next public key. The pairwise attestation chain—the sequence of signed statements asserting "issuer A vouches that presenter P controls key K_P"—is cryptographically sound end to end. The distinction that matters is between **attestation validity** (does this chain prove the presenter is who the issuer says they are?) and **scope-ceiling provenance** (was the authority level embedded in this token actually granted by an entity that held that authority at mint time?). These are orthogonal. A token can carry a perfect identity proof and a stale authority grant simultaneously. Most relying-party implementations collapse the two checks into one "verify the chain" gate and thereby admit tokens whose scope ceiling was minted under a key that has since been rotated, revoked, or demoted in the federation's authority registry. The invariant: **a scope ceiling is only as authoritative as the issuer key state at the moment the ceiling was minted, not the moment the token is presented.** When those two moments straddle a key-state transition, the ceiling must be re-derived or the token rejected—even though the attestation chain still verifies. ## What Was Observed A three-org federation: Org A (issuer, holds authority to grant `scope: write:records` up to tier 3), Org B (presenter/relying party), Org C (downstream resource owner). A's agent `a-mint-01` issued a pairwise attestation to B's agent `b-worker-07` plus an AAIF token scoped `write:records tier=3`, signed with A's federation key `A/k-2048-v4`. At T0, Org A rotated its federation key to `A/k-2048-v5` and, in the same administrative action, *demoted* the authority ceiling: v5 is only authorized to mint `write:records tier<=1`. The rotation was propagated correctly—`A/k-2048-v4` was moved to `revoked-for-new-mint` status but retained in the verification keyset as `valid-for-existing-signatures`. This is the standard "don't invalidate in-flight tokens" posture, and it is exactly what created the gap. At T1, `b-worker-07` presented the v4-signed token to Org C. C's verifier: 1. Fetched A's keyset. Found `A/k-2048-v4` present, status `valid-for-existing-signatures`. Signature check passed. 2. Walked the pairwise attestation chain: A→B link signature valid, B→presenter binding valid, presenter key matches token subject. Chain check passed. 3. Read `tier=3` from the token body. Compared against C's local copy of the federation authority table, which listed Org A as `write:records tier<=3`—because C's authority table had not yet ingested the T0 demotion. 4. Admitted the write at tier 3. The write exceeded A's post-T0 authority by two tiers. Every individual check was locally correct. The composite admitted an over-scoped operation because **the scope ceiling was validated against a cached authority snapshot rather than against the key-state epoch under which it was minted.** The verifier had no binding between "which key signed this ceiling" and "what authority that key held when it signed." The concrete trace: the demotion event carried an `effective_at` of T0. The token carried an `iat` of T0−90s. A correct verifier would have observed that the signing key `A/k-2048-v4` was valid at `iat` but that its *authority* at `iat` was tier 3—so the token was actually legitimate at mint time. The bug was subtler: C's authority table had been refreshed *after* T0 and listed A at tier 1, but C's verifier matched the token's `tier=3` ceiling against the *signing key's historical authority at iat* using a lookup that returned the current (tier 1) value because the historical authority table had been garbage-collected during rotation. The verifier saw "key valid at iat" and "current authority tier 1" and, lacking a per-epoch authority record, fell back to accepting the token's self-declared ceiling. This is the canonical stale-authority-epoch fallback. ## Condition of Validity The rejection obligation binds if and only if all of the following hold: 1. The token's signing key is in `valid-for-existing-signatures` state (i.e., not hard-revoked), so signature verification succeeds. 2. The pairwise attestation chain verifies independently of scope. 3. The relying party cannot resolve the **authority epoch** of the signing key at the token's `iat`—either because the per-epoch authority record was pruned, because the authority registry exposes only current state, or because the authority demotion and the key rotation were committed as a single atomic event with no separable historical record. 4. The token's declared scope ceiling exceeds the relying party's current authority view of the issuer. Under these conditions the token is *identity-valid but authority-unverifiable*. It must be rejected, not admitted with a warning, because the ceiling cannot be reconstructed and the current authority view is known to be a lower bound (demotions only ever reduce authority; if current < declared, the declared value is unsupported). If condition 3 fails to hold—i.e., a per-epoch authority record exists and confirms the signing key held the declared tier at `iat`—the token is admissible. If condition 4 fails—current authority >= declared ceiling—admit. The rejection is specifically the conjunction of stale key state, unverifiable epoch, and over-current-ceiling declaration. ## Decision Boundary The boundary is drawn between two superficially similar cases: - **Case α (admit):** signing key is `valid-for-existing-signatures`, per-epoch authority record resolves, declared ceiling <= authority at `iat`. The token was legitimately minted and the demotion postdates it. Honor the in-flight grant. - **Case β (reject):** signing key is `valid-for-existing-signatures`, per-epoch authority record is *absent or unresolvable*, declared ceiling > current authority. You cannot prove the grant was ever legitimate; the demotion may predate the mint, and the rotation may have silently dropped the epoch record. The trap is that Case β looks like Case α from the signature-and-chain perspective. The discriminator is exclusively the resolvability of the historical authority epoch. A verifier that treats "key valid for existing signatures" as sufficient to honor the token's self-declared ceiling has collapsed β into α. The guardrail: the authority registry must retain per-epoch authority records for at least the maximum token `exp` window past key rotation, and the verifier must treat *unresolvable epoch + declared > current* as a hard reject rather than a soft fallback to the declared value. Never fall back to the token's self-asserted ceiling when the epoch lookup misses—the token is an untrusted claim about its own authority. ## Operational Effect The observable effect of getting this wrong is silent over-privilege that survives audit because every log line shows a green checkmark. The relying party logs "signature valid, chain valid, scope admitted," and the over-scope is invisible until a downstream resource owner with a fresher authority table rejects the write—or, worse, doesn't. The failure is asymmetric: it manifests as excess authority, which is exactly the class of failure that federations exist to prevent. The corrective posture is to make the authority epoch a first-class field in the verification path, not a cache lookup. Concretely: bind the token's ceiling to `(signing_key_id, iat)` and require the registry to answer "what was this key's authority at this instant" as a hard precondition. When the registry cannot answer, the token fails closed. This converts a latent over-privilege into a loud, attributable rejection—which is the only safe direction for a federation boundary. ```python class AuthorityEpochUnresolvableError(RuntimeError): """Raised when a token's scope ceiling cannot be bound to a verifiable authority epoch for its signing key at mint time.""" def verify_federated_token(token, keyset, authority_registry, current_authority_view): key = keyset.get(token.signing_key_id) if key is None or key.status == "hard-revoked": raise AuthorityEpochUnresolvableError( f"signing key {token.signing_key_id} absent or hard-revoked" ) # Signature and pairwise attestation chain are checked independently and # are presumed valid here; they do NOT establish scope authority. if not token.attestation_chain_verifies(): raise AuthorityEpochUnresolvableError("attestation chain failed") # Resolve the authority the signing key held at the token's mint instant. epoch_authority = authority_registry.authority_at( key_id=token.signing_key_id, instant=token.iat ) if epoch_authority is None: # Key is still valid-for-existing-signatures, but the per-epoch # authority record was pruned during rotation. We cannot prove the # declared ceiling was ever legitimate. current = current_authority_view.get(token.issuer_org, default=None) if current is None or token.declared_ceiling > current: raise AuthorityEpochUnresolvableError( f"epoch authority for {token.signing_key_id}@{token.iat} " f"unresolvable and declared ceiling {token.declared_ceiling} " f"exceeds current view {current}; refusing stale-authority fallback" ) # Declared ceiling is within current authority; safe to admit. return Admission(granted=token.declared_ceiling, epoch="current-fallback") if token.declared_ceiling > epoch_authority: raise AuthorityEpochUnresolvableError( f"declared ceiling {token.declared_ceiling} exceeds authority " f"{epoch_authority} held by {token.signing_key_id} at {token.iat}" ) return Admission(granted=token.declared_ceiling, epoch=token.iat) ```