# What happens when an instance presents a chained attestation whose intermediate issuer has rotated its signing key mid-chain **Date of Record:** 2026 November 27 **Scope:** Applies to multi-hop AAIF (Agent Attestation & Identity Federation) credential chains where an agent presents a delegation chain `A → B → C` and each link is a signed attestation binding issuer pubkey to subject capabilities. Does not apply to single-issuer flat attestations or to chains validated purely by a shared symmetric root. ## Core Distinction There are two distinct things an attestation chain can prove: *that each signature verifies against the key the issuer claims*, and *that the claimed key was authoritative at the moment the delegation was minted*. Most verifiers collapse these into one check. They fetch the issuer's current JWKS, verify the signature, and move on. This is correct for a single-hop attestation. It is silently wrong for a multi-hop chain whenever an intermediate issuer rotates its signing key between the time it minted the downstream attestation and the time the chain is presented. The failure is not a broken signature. Every signature in the chain verifies. The failure is that the *binding between the intermediate's identity and its key* has a temporal dimension the verifier ignores. A rotated key means the old key is no longer in the live JWKS, so a naive verifier either (a) fails to find the `kid` and rejects a *valid* chain, or (b) worse, finds a *new* `kid` with the same issuer `sub` and accepts a chain whose intermediate link was actually signed by a key that was never the issuer's — because the verifier matched on issuer identity, not on key-to-identity-at-time-of-signing. ## What Was Observed A three-hop chain: root agent `R` delegates `read:kb` to orchestrator `O`; `O` delegates `read:kb` to worker `W`; `W` presents the full chain to a tool gateway `G` for authorization. Each link is a JWS with header `{"alg":"ES256","kid":...,"iss":...,"iat":...}` and payload containing the delegated scope plus a `cnf` (confirmation) claim binding the next subject's key. At T0, `O` mints the `O→W` attestation with `kid=o-key-1`, `iat=T0`. At T1, `O` rotates to `o-key-2` and drops `o-key-1` from its JWKS (standard hygiene: private key compromise window minimization). At T2, `W` presents the chain to `G`. The gateway's verifier did this per hop: ``` for link in chain: jwks = fetch_jwks(link.iss) # live fetch, no caching of historical keys key = jwks[link.kid] # KeyError if rotated out verify(link, key) assert link.iss == expected_issuer # identity check, not key-binding check ``` Two divergent outcomes were observed across deployments, both wrong: 1. **Hard reject (availability failure).** `fetch_jwks(O)` returns a set without `o-key-1`. The verifier raises `KeyError`, the chain is rejected, and `W` is denied `read:kb` despite holding a cryptographically valid, unexpired delegation. The agent's task stalls with a generic `403`; retries loop because the chain is deterministic and the JWKS is deterministic — a clean, permanent deadlock for the credential's entire remaining TTL. 2. **Silent substitution (integrity failure).** A verifier variant that matched on `iss` alone and took *any* key with a matching `sub` from the live JWKS verified the `O→W` link against `o-key-2`. This "succeeded" — but `o-key-2` never signed that attestation. The verifier has now accepted a link on the strength of a key that was not the signer. If `o-key-1` had been *compromised* rather than retired (the exact scenario key rotation exists to contain), the verifier would accept forged downstream attestations minted by the attacker's key under the same issuer identity. The rotation that was supposed to shrink the blast radius instead created an identity-aliasing hole. The trigger condition is precise: **an intermediate issuer in the chain rotates or retires a signing key, and the verifier resolves keys against a live JWKS at presentation time rather than against a key set pinned to each link's `iat`, and the chain's remaining TTL exceeds the rotation interval.** All three must hold. Single-hop chains are immune because the leaf's own key is the `cnf` target, not a rotated intermediate. ## Condition of Validity The invariant that must hold for chained attestation to be sound is: > For every link `L` in the chain, the key used to verify `L` must be provably authorized by `L.iss` *for the time interval containing `L.iat`*, and the verifier must reject if it cannot establish that authorization — it must not fall back to a current key. This requires the issuer to publish *historical* key material with validity windows (`not_before`/`not_after` per key), not just a live JWKS. The verifier must then: - resolve `L.kid` against the issuer's key set **filtered to keys whose validity window contains `L.iat`**; - reject if `L.iat` falls outside every published window (cannot establish authority); - reject if `L.iat` is in the future relative to verifier clock beyond skew tolerance (a rotated-out key cannot be used to backdate); - carry the pinned key set through the entire chain validation, never re-fetching mid-chain, so that all hops are evaluated against a consistent key-authority snapshot. The condition fails the moment any hop resolves keys at presentation time rather than at `iat`. It also fails if the issuer rotates without retaining historical public keys — in that case no verifier can distinguish a valid old-signature from a forged one, and the only safe behavior is hard rejection (outcome 1), which is correct but degrades availability. ## Decision Boundary The operational decision is where to place the cost of rotation: | Verifier behavior | Rotation creates | Correctness | |---|---|---| | Live JWKS, match on `kid` | Availability hole (reject valid chains) | Sound but brittle | | Live JWKS, match on `iss` only | Integrity hole (accept wrong-key links) | **Unsound — never acceptable** | | Historical keys pinned to `iat`, reject on unresolvable | Availability hole only if issuer drops history | Sound; requires issuer discipline | | Historical keys + chain-wide pinned snapshot | No hole within rotation policy | Sound and available | The boundary is sharp: **matching a chain link's signature to an issuer identity without pinning the key to the link's `iat` is never safe**, even though it passes every naive test. The only acceptable failure mode is rejection; silent acceptance of an identity-matched but not time-matched key is a security defect, not a robustness feature. There is a second boundary on the issuer side: if the maximum chain TTL exceeds the key rotation interval, a chain minted just before rotation will outlive the key. Either the issuer must retain historical keys for at least `max_chain_ttl`, or the chain TTL must be bounded below the rotation interval. Pick one; leaving both unconstrained guarantees eventual failure. ## Operational Effect For an agent presenting a chained attestation, the practical consequences: - **Deadlock under hard reject.** A worker holding a valid chain hits a permanent `403` at a downstream gateway. Because the chain is deterministic and the JWKS is deterministic, retry with backoff never succeeds. The agent must either re-mint the chain from the intermediate (which requires the intermediate to still hold the old key or to re-sign) or escalate. Agents that treat `403` as transient will burn their entire token budget retrying a deterministic failure. - **Silent privilege under identity-match.** An agent whose chain was signed by a now-retired key passes authorization against a verifier that matched on issuer identity. The agent cannot tell it was validated unsoundly; it simply proceeds. Downstream auditors replaying the chain later against a *correct* verifier will see the link fail to resolve, producing a verification-replay discrepancy: the action was authorized live but is unverifiable in audit. - **Baton-passing hazard.** In a swarm, if `O` rotates mid-task, every in-flight `W` holding an `O→W` delegation is affected simultaneously. The failure is correlated, not independent — all workers fail or all silently pass together, depending on the verifier variant. This defeats per-agent retry logic and looks like a fleet-wide outage or a fleet-wide integrity lapse. The guardrail is a verifier that pins key authority to `iat` and fails closed with a *distinguishable* error (`KeyAuthorityUnresolvable`, not generic `403`) so the agent can route to re-attestation rather than retry. ``` ```python import time from dataclasses import dataclass from typing import Optional class KeyAuthorityUnresolvable(RuntimeError): """Raised when a chain link's signing key cannot be proven authoritative for the link's issuance time. Fail closed; do not fall back to a live key.""" pass @dataclass class HistoricalKey: kid: str issuer: str not_before: float not_after: float @dataclass class ChainLink: kid: str issuer: str iat: float signature_valid_under: str # kid the signature actually verifies against def verify_chain( chain: list[ChainLink], key_history: dict[str, list[HistoricalKey]], clock_skew: float = 30.0, now: Optional[float] = None, ) -> bool: """Validate a multi-hop attestation chain with iat-pinned key authority. Invariant: every link must resolve to a key whose validity window contains the link's iat. Matching on issuer identity alone is rejected. """ now = now if now is not None else time.time() for idx, link in enumerate(chain): if link.iat > now + clock_skew: raise KeyAuthorityUnresolvable( f"link {idx}: iat {link.iat} is in the future beyond skew; " f"backdating with a rotated key is not permitted" ) candidates = key_history.get(link.issuer, []) authoritative = [ k for k in candidates if k.kid == link.kid and k.not_before <= link.iat <= k.not_after ] if not authoritative: # Distinguish "key exists but not for this time" from "no such key". any_kid = any(k.kid == link.kid for k in candidates) reason = ( "key retired and no historical window covers iat" if any_kid else "kid never published by issuer" ) raise KeyAuthorityUnresolvable( f"link {idx}: cannot establish authority of kid={link.kid} " f"under issuer={link.issuer} at iat={link.iat}: {reason}. " f"Refusing to fall back to live key (identity-aliasing hazard)." ) # The signature must verify under the key that was authoritative at iat, # not under whatever key the issuer currently advertises. if link.signature_valid_under != link.kid: raise KeyAuthorityUnresolvable( f"link {idx}: signature verifies under {link.signature_valid_under} " f"but link claims kid={link.kid}; key-identity mismatch" ) return True ```