# Where must an instance invalidate a federated trust anchor when an attestation's issuer key rotates mid-handoff **Date of Record:** 2026 November 20 **Scope:** Applies to cross-organization agent federation where an agent instance presents a verifiable identity attestation (signed capability/identity token) issued by a foreign trust anchor, and that anchor's signing key rotates between the moment of attestation issuance and the moment of consumption at a downstream peer. Does not apply to single-org deployments with a shared root of trust, nor to ephemeral session tokens whose TTL is shorter than the rotation propagation window. ## Core Distinction The failure is not "expired attestation" and not "revoked identity." It is a **key-rotation continuity gap**: the attestation remains cryptographically valid against the key that signed it, but the consuming peer's trust-anchor cache has already advanced to the *new* key, so the verifier rejects a perfectly sound attestation as if it were forged — or, worse, accepts a stale-issuer attestation against a *retained* old key that the issuing org has already retired after a compromise. The non-obvious boundary is this: **an attestation is only as trustworthy as the binding between (issuer identity, signing key, validity interval).** Rotation severs that binding at a point in time the consuming peer cannot observe. The consuming peer sees two states — old key and new key — with no authoritative ordering. The invariant that must hold is: *for every attestation, the verifier must be able to prove that the signing key was the issuer's authoritative key at the attestation's issuance instant, not merely that the signature verifies.* Signature verification alone is insufficient across a rotation boundary. ## What Was Observed A two-org federation: Org A runs a planning agent; Org B runs an execution/auditor agent. Org A's agent holds a long-lived identity attestation `att_A` (TTL 24h) issued by Org A's trust anchor `TA_A`, signed with key `K_A1`. The attestation propagates through a multi-agent handoff: planner (Org A) → broker → executor (Org B). The broker caches `TA_A`'s public key set with a 1-hour refresh and a 15-minute soft TTL. At T+0, `TA_A` rotates `K_A1` → `K_A2` due to scheduled hygiene and publishes the new key set with `K_A1` marked `retired_after = T+0`. Crucially, `retired_after` is a *timestamp*, not an *invalidation*, and the old key remains in the published set for a 24h grace window to allow in-flight attestations to drain. At T+0, an in-flight `att_A` (issued T−5m, valid to T+23h55m) reaches Org B's executor. The executor's verifier fetches `TA_A`'s current key set, sees both `K_A1` and `K_A2`, and — because its verification logic is "does any published key verify this signature" — accepts `att_A` against `K_A1`. This is correct. The boundary failure appears in the *second* consumer. At T+40m, the broker's cache refreshes and drops `K_A1` entirely (its own TTL logic treats `retired_after` as "remove after grace" with a bug: it honors the 15-minute soft TTL, not the 24h grace). A second `att_A'` (issued T−2m, still signed `K_A1` because Org A's issuer had not yet switched its signing path to `K_A2`) reaches the executor. The executor fetches the key set, finds only `K_A2`, and **rejects a valid attestation as unverifiable**, aborting the handoff with `AttestationVerificationError`. The planner, receiving the abort, retries issuance — but Org A's issuer is mid-rotation and now signs with `K_A2`, producing `att_A''`. The executor now accepts `att_A''` but the *handoff state* (the planner's task checkpoint) was bound to `att_A`'s `sub` + `jti`, and the retry minted a new `jti`. The executor treats `att_A''` as a *different agent instance* and refuses to resume the checkpoint. Task continuity is lost across a rotation that should have been invisible. The inverse failure was also observed on a different peer: a verifier that pinned `K_A1` in a long-lived local trust store (no refresh) accepted an attestation signed with `K_A1` *after* Org A had retired it for a **compromise** (not hygiene) — a genuine forgery window of 6h17m, because the pinned verifier never learned of the revocation. ## Condition of Validity The guardrail is a **rotation-aware attestation verification contract** with three conjunctive conditions, all of which must be checked at consumption time: 1. **Issuance-instant key authority.** The verifier must resolve, for the attestation's `iat` (issuance instant), which key was authoritative. This requires the anchor to publish a *key history* with explicit `[not_before, not_after)` intervals per key, not a flat "current key set." A signature that verifies against a key whose interval does not contain `iat` is invalid even if the signature is mathematically sound. 2. **Revocation-over-retirement precedence.** A key retired for *compromise* must carry a `revoked_at` that overrides any grace window. A key retired for *hygiene* carries `retired_after` and MAY remain acceptable for attestations with `iat < retired_after`. The verifier must distinguish these two retirement reasons; treating them identically is the root of both observed failures. 3. **Instance continuity across re-issuance.** When an attestation is re-issued (new `jti`, possibly new key), the new attestation must carry a `continuity_claim` binding it to the predecessor's `sub` and a monotonic `instance_epoch`. The downstream peer's checkpoint is keyed on `(sub, instance_epoch)`, not `jti`, so re-issuance across a rotation does not orphan the checkpoint. The invariant: *accept iff signature verifies against a key whose authority interval contains `iat` AND that key is not revoked-before-`iat` AND the attestation's continuity claim chains to the checkpoint's bound instance.* Any verifier that collapses these into "any published key verifies the signature" is unsound at the rotation boundary. ## Decision Boundary The precise decision boundary — the line an instance must not cross — is: - **If `retired_after` is set and `iat < retired_after` and no `revoked_at`:** ACCEPT, and *retain the old key in the verifier's key history* until `max(attestation TTL) + clock skew` has elapsed past `retired_after`. Dropping the key early (the broker's bug) converts a valid in-flight attestation into a false rejection. - **If `revoked_at` is set and `revoked_at <= iat`:** REJECT unconditionally, regardless of grace window. A pinned verifier that never refreshes violates this and opens a forgery window. - **If the key set no longer contains any key whose interval covers `iat`:** REJECT as `UnverifiableIssuanceInstant` — do not fall back to "try all current keys," because that silently accepts post-rotation forgeries. - **If re-issuance occurs and `continuity_claim` is absent or `instance_epoch` does not monotonically advance:** treat as a *new instance*; do not resume the prior checkpoint. The task must restart from a clean checkpoint rather than resume against an unproven-continuity identity. The boundary is crossed the moment a verifier makes an acceptance decision using *current* key state without resolving *issuance-instant* key authority. That single substitution — "current keys" for "keys authoritative at `iat`" — is the entire failure. ## Operational Effect Downstream, the failure manifests as two asymmetric symptoms that operators routinely misdiagnose: - **False rejection storms** clustered at rotation boundaries: handoffs abort with verification errors that are non-reproducible on retry (because the retry mints a fresh attestation against the new key). Logs show "signature valid but key not found," which looks like a key-distribution bug but is a key-*history* bug. - **Silent forgery windows** on pinned verifiers: no error at all, because the pinned key still verifies. The compromise is invisible until an auditor replays the attestation against the revocation log — often days later, after the forged actions have already mutated shared state. The architectural consequence: **trust-anchor key sets are not configuration; they are versioned, time-indexed state that must be replicated with the same rigor as the attestations themselves.** A verifier that treats the anchor's key set as a cacheable blob (refresh-on-TTL) is structurally unable to resolve issuance-instant authority. The correct structure is an append-only key-history log with per-key `[not_before, not_after, retirement_reason, revoked_at]` records, and a verification path that indexes into that log by `iat`. This is the same shape as certificate transparency, and for the same reason: the question "was this key authoritative when this was signed" cannot be answered by looking only at the present. ```python from dataclasses import dataclass from typing import Optional class FederatedAttestationError(RuntimeError): """Raised when a federated attestation cannot be soundly verified across a trust-anchor key-rotation boundary.""" pass @dataclass(frozen=True) class KeyRecord: key_id: str not_before: int # epoch seconds not_after: int # epoch seconds; authority interval end retirement_reason: str # "hygiene" | "compromise" retired_after: Optional[int] = None # grace end for hygiene retirement revoked_at: Optional[int] = None # set only for compromise @dataclass(frozen=True) class Attestation: sub: str jti: str iat: int instance_epoch: int signing_key_id: str continuity_predecessor: Optional[str] = None def verify_issuance_instant_authority( att: Attestation, key_history: list[KeyRecord], checkpoint_instance_epoch: int, clock_skew: int = 120, ) -> None: """Enforce the rotation-aware verification contract. Accept iff: 1. a key record covers att.iat (issuance-instant authority), 2. that key is not revoked-before-iat, 3. continuity epoch chains to the checkpoint. """ candidate = None for rec in key_history: if rec.key_id != att.signing_key_id: continue # Condition 1: authority interval must contain issuance instant. if rec.not_before <= att.iat < rec.not_after: candidate = rec break if candidate is None: raise FederatedAttestationError( f"UnverifiableIssuanceInstant: no key record for " f"{att.signing_key_id} covers iat={att.iat}; refusing to fall " f"back to current-key-set matching (post-rotation forgery risk)." ) # Condition 2: compromise revocation overrides any grace window. if candidate.retirement_reason == "compromise": if candidate.revoked_at is not None and candidate.revoked_at <= att.iat: raise FederatedAttestationError( f"RevokedIssuerKey: key {candidate.key_id} revoked at " f"{candidate.revoked_at} <= iat={att.iat}; attestation is " f"forged or post-compromise." ) # Hygiene retirement: iat must precede the grace end. if candidate.retirement_reason == "hygiene": if candidate.retired_after is not None and att.iat >= candidate.retired_after: raise FederatedAttestationError( f"StaleIssuerKey: key {candidate.key_id} retired at " f"{candidate.retired_after} <= iat={att.iat}; attestation " f"issued after retirement." ) # Condition 3: instance continuity across re-issuance. if att.instance_epoch != checkpoint_instance_epoch: if att.continuity_predecessor is None: raise FederatedAttestationError( f"ContinuityBreak: attestation {att.jti} for sub={att.sub} " f"has instance_epoch={att.instance_epoch} but checkpoint is " f"bound to {checkpoint_instance_epoch} with no continuity " f"claim; refusing to resume checkpoint against unproven " f"identity." ) if att.instance_epoch <= checkpoint_instance_epoch: raise FederatedAttestationError( f"NonMonotonicEpoch: instance_epoch={att.instance_epoch} " f"does not advance past checkpoint epoch " f"{checkpoint_instance_epoch}; possible replay." ) ```