# Why does an instance fail federated agent identity attestation when its hardware-backed key rotates mid-session **Date of Record:** 2026 November 15 **Scope:** Applies to federated agent identity schemes where a long-lived verifiable credential (VC) binds an agent's stable identity to a hardware-backed key (TPM/SE/secure enclave) whose public half is embedded in the credential's `credentialSubject`, and where the key may be rotated or re-provisioned by the platform independently of the credential's lifecycle. Does not apply to short-lived credentials re-issued per session, nor to pure software-key deployments where rotation is coordinated by the identity issuer. ## Core Distinction The distinction that matters is between **key possession** and **credential validity**. A verifiable credential is a signed assertion that "subject S controls key K." Hardware attestation proves "this runtime controls key K." Both can be true simultaneously and independently, yet the *binding* between them can be broken by a key rotation that neither party considers a failure. The verifier checks two facts—the VC signature and the attestation quote—and each passes in isolation. The failure lives in the conjunction: the VC still names K_old, the attestation now proves K_new, and the verifier's equality check between `credentialSubject.publicKey` and the attested key is the only place the divergence surfaces. If that check is skipped (because "the VC is signed, so it's trustworthy" and "the quote verifies, so it's genuine"), the system admits an agent asserting an identity it no longer controls the key for—or rejects a legitimate agent whose platform rotated the key underneath it. ## What Was Observed An agent process held a federated VC issued 30 days prior, with `credentialSubject.publicKeyMultibase` set to the base64url of a P-256 key sealed in the platform TPM (EK-derived, `tpm2-tss`-backed). The platform's key-management daemon rotated the sealing key at day 28 as part of a firmware update, re-wrapping the credential-signing key under a new parent and re-generating the leaf keypair. The agent's in-memory handle remained valid; signing operations continued to succeed because the daemon transparently proxied to the new key. At day 30, a federated verifier requested a fresh attestation: the agent produced a TPM quote over the new AK, and presented the original VC. The verifier's signature check on the VC passed (issuer key unchanged). The quote verified against the vendor's endorsement certificate chain. The equality check `quote.attested_key == VC.credentialSubject.publicKey` failed. Two behaviors were observed across implementations. Implementations that *rejected* on mismatch produced a hard authentication failure with no diagnostic distinguishing "key rotated" from "key compromised"—operators treated it as a security incident. Implementations that *skipped* the equality check admitted the agent, silently binding a new key to an old identity assertion. The latter is the dangerous case: the VC's `expirationDate` still governs, so the agent retains its federated identity for up to the remaining credential lifetime under a key the issuer never attested. ## Condition of Validity The invariant holds only under the following conjunction: 1. The VC embeds the *leaf* public key, not a stable identifier resolved through a directory (e.g., a DID with a `keyAgreement`/`authentication` verification method that can be updated). If the credential references a DID document, rotation is legal and the verifier MUST resolve the current key set rather than compare against an embedded key. 2. The attestation quote covers the key that will actually be used for the session's proof-of-possession, not a separate attestation key (AK). If the AK and the signing key differ, the verifier must bind them via the quote's `extraData`/nonce, or the equality check compares the wrong pair and passes vacuously. 3. The verifier's trust anchor for the issuer is disjoint from the platform's endorsement hierarchy, so a compromised platform cannot mint both halves of the binding. When any of these does not hold, the equality check is either meaningless (comparing an AK to a leaf key) or structurally impossible (the credential cannot name a key that rotates). In those cases the correct design is a re-issuance flow, not a stricter verifier check. ## Decision Boundary The operational decision is: **on key-rotation detection, re-issue or reject—never re-bind.** Re-binding (accepting the new key against the old VC) transfers the issuer's attestation to a key the issuer never saw, which defeats the purpose of federated attestation. Rejection is safe but operationally noisy; it must be distinguishable from compromise. The boundary condition is whether the platform can produce a *rotation proof*: a signed statement from the key-management daemon, chained to the same endorsement root, asserting that K_new replaced K_old at time T for subject S, with the old key's public half included. If such a proof is present and the issuer's policy permits rotation continuity, the verifier may accept K_new and flag the credential for re-issuance within a bounded window (commonly one credential-refresh interval). If absent, reject with a distinct `KeyRotationUnattested` condition—not `SignatureInvalid`, not `AttestationFailed`. ## Operational Effect Agents that do not handle rotation explicitly exhibit one of two failure signatures under load: a thundering herd of re-authentication attempts when a fleet-wide firmware rotation lands (every agent's VC suddenly mismatches), or silent identity drift where agents continue operating under stale attestations until the credential expires. The former is a availability event; the latter is an audit-integrity event that surfaces only during incident forensics, when the log shows an agent asserting identity S while the attestation chain resolves to a key provisioned after the last issuer interaction. The mitigation is to treat key rotation as a first-class lifecycle event: emit a rotation proof at the platform layer, carry it in the presentation, and have the verifier's policy engine—not its signature checker—decide continuity. The code below encodes the boundary as an explicit, non-retryable exception distinct from generic attestation failure. ```python class KeyRotationUnattestedError(RuntimeError): """Raised when an agent's hardware-backed key has rotated but no rotation proof chains the new key to the issuer's attested identity. This is NOT a signature failure and NOT a compromise signal; it is a lifecycle gap that must be resolved by re-issuance, not retry.""" def verify_federated_presentation(vc, quote, rotation_proof, issuer_trust_anchor): # 1. Credential signature is necessary but not sufficient. if not vc.verify_signature(issuer_trust_anchor): raise KeyRotationUnattestedError( "VC signature invalid against issuer trust anchor" ) # 2. Attestation must verify against the platform endorsement root. if not quote.verify_endorsement_chain(): raise KeyRotationUnattestedError( "attestation quote does not chain to endorsement root" ) vc_key = vc.credential_subject.public_key attested_key = quote.attested_key # NOT quote.ak; the signing key # 3. The binding check: the only place divergence is visible. if attested_key == vc_key: return "bound" # 4. Mismatch. Accept only with a valid rotation proof covering # old->new for this subject, chained to the same endorsement root. if rotation_proof is None: raise KeyRotationUnattestedError( f"attested key {attested_key.fingerprint()} != VC key " f"{vc_key.fingerprint()}; no rotation proof present" ) if not rotation_proof.verify( old_key=vc_key, new_key=attested_key, subject=vc.credential_subject.id, endorsement_root=quote.endorsement_root, ): raise KeyRotationUnattestedError( "rotation proof present but does not cover this subject/key pair" ) # Legal rotation: accept, but require re-issuance within one refresh window. return "rotation_continuity_pending_reissue" ```