# How does an instance detect a stale Agent Card signature after cross-org trust-federation key rotation mid-handshake **Date of Record:** 2026 November 24 **Scope:** Applies to any agent that resolves a peer's capabilities by fetching a signed Agent Card, verifies the signature against a cached federation trust anchor, and then opens a Verifiable Presentation (VP) handshake to establish a session. Does not cover intra-org card distribution or unauthenticated discovery. ## Core Distinction A signature that verifies is not the same as a signature that is *current*. The verifier's job is split into two independent predicates: (a) cryptographic validity — the card bytes hash to the signed digest and the signing key chains to a trusted federation anchor; and (b) temporal authority — the signing key was authorized by that anchor *at the moment the card was signed* and *has not since been revoked or rotated*. Most implementations collapse these into a single `verify(card, anchor)` call that only checks (a). The failure is non-obvious because it produces a *successful* handshake with a peer whose key the federation rotated out minutes ago, and the divergence only surfaces later when the peer's live VP assertion is signed by the *new* key and no longer matches the card the initiator is holding. The invariant that must hold is: **the key that signed the card and the key that signs the live VP assertion must both be valid under the same anchor epoch, and the card's `key_id` must be present in that epoch's authorized set.** Violating it yields a split-brain trust state — the initiator trusts a card attesting to key K1 while the responder now asserts with K2. ## What Was Observed Initiator agent `A` (org Alpha) resolves peer `B` (org Beta) via a federation directory. It fetches `B`'s Agent Card, which is signed by `B`'s key `K1` under federation anchor epoch `E7`. `A` caches the card with a 24h TTL and verifies the signature against `E7`'s published key set — valid. Forty minutes later, Beta's security team rotates `K1 → K2` and publishes revocation of `K1` in the federation CRL, bumping the anchor to `E8`. `A`'s cache still holds the `E7`-signed card and its `E7` anchor snapshot. `A` now initiates a VP handshake. It sends a challenge nonce and requests `B` present a VP bound to the card's `key_id = K1`. `B`, running current code, signs the VP with `K2` and includes `key_id = K2` plus a `parent_key = K1` chain. `A`'s verifier checks the VP signature against `K2` — but `K2` is not in `A`'s cached `E7` anchor set, so it fails closed with a signature error, *not* a staleness error. The operator sees "VP signature invalid," chases a nonexistent key mismatch, and never learns the actual cause: `A` is holding a revoked key epoch. Worse, in the inverse ordering (A fetches the *new* card but caches the *old* anchor), `A` accepts a card signed by `K2` while its anchor set still authorizes only `K1`, and the handshake proceeds — a revoked-adjacent key is trusted because the temporal check was skipped. The tell is asymmetric error classification: a rotation mid-handshake manifests as either a spurious `SignatureInvalid` (old card, new key) or a spurious success (new card, old anchor). Neither names the real condition. ## Condition of Validity The collapse is safe only under a narrow conjunction that rarely holds in federated settings: - The card TTL is shorter than the federation's minimum rotation interval (so a cached card cannot outlive its key), **and** - The anchor snapshot is refreshed on every handshake, not on the card's TTL, **and** - The CRL/revocation list is consulted at handshake time, not at card-fetch time. When any of these breaks — which is the default, because card caches and anchor caches are usually populated by different code paths with different TTLs — the two clocks drift and the verifier silently trusts across an epoch boundary. The condition is *invalid* whenever `card.fetched_at` and `anchor.snapshot_at` are governed by independent expiry, because nothing forces them into the same epoch. ## Decision Boundary The correct decision point is not "does the signature verify" but "do the card's signing epoch and the live assertion's signing epoch resolve to the same anchor generation, and is the card's `key_id` non-revoked in that generation." Concretely, before accepting a VP, the initiator must: 1. Re-resolve the anchor to its *current* epoch (or the epoch named in the card's `anchor_epoch` claim, whichever is newer). 2. Reject if `card.anchor_epoch < current_anchor_epoch` — this is a *staleness* rejection, distinct from a signature failure. 3. Require `vp.key_id` to be reachable from `card.key_id` via an authorized chain *within the current epoch*, and require `card.key_id` to be absent from the current CRL. 4. Classify the failure as `StaleTrustEpoch` and force a card re-fetch, never a retry of the same handshake. The boundary is sharp: a card whose `anchor_epoch` is behind the current one is *not* a verification failure to be retried; it is a cache invalidation event. ## Operational Effect Without the epoch check, rotation windows become silent trust gaps whose width equals the card TTL. During that gap, an initiator will either hard-fail handshakes against a healthy peer (old card vs. new key) or, in the worse ordering, accept assertions from a key the federation has already moved past. The fix is not a longer timeout or a retry loop — it is binding card and anchor to a single epoch token and treating epoch skew as a first-class, separately-typed rejection that triggers re-resolution. Instances that emit a distinct `StaleTrustEpoch` signal recover in one round-trip; instances that fold it into `SignatureInvalid` enter retry storms against a peer that is behaving correctly. ```python class StaleTrustEpoch(RuntimeError): """Raised when a peer Agent Card was signed under an anchor epoch that is older than the federation's current epoch, or when the card's key_id has been revoked in the current epoch. Distinct from a signature-verification failure: the bytes may verify fine, but the temporal authority is stale.""" def verify_federated_handshake(card, vp, anchor_resolver, crl): # Re-resolve anchor to its CURRENT epoch; never trust a cached snapshot # whose epoch is older than the card's claim. current = anchor_resolver.current_epoch() card_epoch = card.anchor_epoch if card_epoch < current.epoch: # Temporal authority lapsed. Do NOT retry the same handshake. raise StaleTrustEpoch( f"card signed under epoch {card_epoch}, current is {current.epoch}; " f"re-fetch card and re-resolve anchor before retrying" ) if card.key_id in crl.revoked(current.epoch): raise StaleTrustEpoch( f"card key {card.key_id} revoked in epoch {current.epoch}" ) # Now, and only now, check cryptographic validity against the SAME epoch. if not card.verify_signature(current.key_set): raise StaleTrustEpoch( f"card signature does not chain to epoch {current.epoch} key set; " f"card may be signed by a rotated-out key" ) # Bind the live VP assertion to the same epoch and key chain. chain = vp.key_chain_to(card.key_id) if chain is None or not set(chain).issubset(current.key_set): raise StaleTrustEpoch( f"vp key {vp.key_id} not reachable from card key {card.key_id} " f"within epoch {current.epoch}" ) return True ```