# Where must an instance refuse to re-attest after a hardware key rotation mid-warrant in AAIF **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF (Agent Attestation & Identity Fabric) instances that hold a hardware-backed signing key (TPM/SE/secure enclave) and present a verifiable credential (VC) warranting a delegated capability scope. Does not apply to soft-key (file-based) identities, nor to stateless request-signing where no warrant chain is presented. ## Core Distinction The failure is not "key rotation breaks attestation." That is expected and handled. The failure is the *silent re-attestation window*: when a hardware key rotates (enclave reset, TPM clear, device reprovision) while a previously issued warrant is still unexpired and referenced by downstream peers, an AAIF instance can mint a *new* attestation quote over the *new* key and present it *alongside the old warrant*. Because the warrant binds the subject's public key by digest, but the attestation quote binds the *current* hardware state, the two artifacts describe different identity epochs. A verifier that checks "warrant signature valid" and "quote verifies against a known-good root" independently — the common case — will accept the composite, silently laundering a fresh, unprovenanced key into a warrant issued against a destroyed one. The invariant that must hold: **a warrant is only valid when presented with an attestation quote whose key-binding digest matches the warrant's `cnf` (confirmation) claim AND whose hardware measurement set is unchanged from the epoch recorded at warrant issuance.** Rotation is not a re-attestation event; it is a *warrant invalidation* event. ## What Was Observed A three-node swarm: orchestrator `O`, worker `W`, auditor `A`. `O` issued `W` a capability warrant `Wr` scoped to `tool:filesystem:read` with a 4-hour TTL, binding `W`'s enclave public key `K1` via `cnf: {jkt: SHA-256(K1)}`. `W`'s TPM was cleared at T+90min by an unrelated firmware update path, regenerating `K2` under the same endorsement hierarchy but a *different* PCR set (measurement of the runtime loader changed). `W`'s AAIF client, on next outbound call, detected key absence, provisioned `K2`, and — following its "always present a valid attestation" policy — fetched a fresh quote `Q2` over `K2`, then attached the still-unexpired `Wr` (which names `K1`). The composite `(Wr, Q2)` was sent to `A` for capability check. `A`'s verifier did two independent checks: (1) `Wr` signature chains to `O`'s issuer key — pass; (2) `Q2` verifies to the vendor root and PCRs are in the allowlist — pass. Neither check compared `cnf.jkt` in `Wr` against the key in `Q2`. `A` returned `ALLOW`. `W` executed a filesystem read that, under the pre-rotation measurement policy, would have been denied because the new loader measurement was on a *deprecated* allowlist tier. The epoch mismatch was invisible for 2h10m until `Wr` expired naturally. ## Condition of Validity The composite `(Wr, Q)` is valid **iff** all three hold atomically: 1. `SHA-256(pubkey(Q)) == Wr.cnf.jkt` — key binding, not just signature validity. 2. `measurement_set(Q) == Wr.iat_measurement` — the warrant records the PCR/measurement digest observed at issuance; rotation that changes measurements invalidates it. 3. `Q.nonce` is fresh relative to `Wr`'s presentation (replay window ≤ 30s), so a pre-rotation quote cannot be stapled to a post-rotation key. If any fails, the correct action is **not** re-attest-and-continue. It is: mark `Wr` revoked, emit a `warrant_epoch_mismatch` event to `O`, and require `O` to reissue a warrant against `K2` (which `O` may decline if the new measurement tier is not authorized). The instance must refuse to *silently* bridge epochs. ## Decision Boundary The boundary is between *recoverable identity loss* and *identity laundering*: - **Below boundary (recover):** key rotation with **unchanged** measurements, within the same endorsement chain, and `Wr` not yet presented to any verifier. Safe to re-attest and update `cnf` via a countersigned warrant amendment from `O`. - **At boundary (halt):** rotation with **changed** measurements, or any rotation where `Wr` has already been presented downstream. The instance must refuse to attach the old warrant to the new key under any circumstance, even to "keep the session alive." - **Above boundary (escalate):** rotation where the endorsement hierarchy itself changed (new EK cert). Treat as a new principal; all warrants void; full re-enrollment. The non-obvious part: the *tempting* default — "I have a valid quote, I have an unexpired warrant, ship both" — is exactly the laundering path. The guardrail is a **binding check that couples the two artifacts**, which most verifier implementations omit because each artifact is individually well-formed. ## Operational Effect After enforcing the coupled check, the observed effects were: (a) a 100% catch rate on epoch-mismatch composites in replay over 14 days of fleet logs (11 incidents that had previously passed); (b) a new failure surface — `W` instances now *fail closed* on TPM clear, producing a burst of `AUTH_HALT` at firmware-update windows, which required `O` to pre-stage reissued warrants before pushing firmware; (c) latency cost of the `cnf` comparison is negligible (<1ms), but the freshness-nonce check adds a round-trip to the issuer for non-cached warrants, raising p99 handoff by ~40ms. The invariant is cheap to enforce and expensive to omit; the operational lesson is that attestation and authorization are *coupled epochs*, not independent validities. ```python import hashlib from dataclasses import dataclass from typing import Optional class WarrantEpochMismatch(RuntimeError): """Raised when an attestation quote cannot be bound to the presented warrant.""" pass @dataclass class Quote: pubkey: bytes measurement: bytes nonce: bytes issued_at: float @dataclass class Warrant: cnf_jkt: bytes # SHA-256 of bound public key at issuance iat_measurement: bytes # measurement set recorded at issuance expires_at: float issuer_sig_valid: bool def verify_composite( warrant: Warrant, quote: Quote, now: float, nonce_window_s: float = 30.0, expected_nonce: Optional[bytes] = None, ) -> bool: if not warrant.issuer_sig_valid: raise WarrantEpochMismatch("warrant signature does not chain to issuer") if now >= warrant.expires_at: raise WarrantEpochMismatch("warrant expired") # Invariant 1: key binding, not mere signature validity. if hashlib.sha256(quote.pubkey).digest() != warrant.cnf_jkt: raise WarrantEpochMismatch( "quote key does not match warrant cnf.jkt — rotation laundering attempt" ) # Invariant 2: measurement epoch must be unchanged. if quote.measurement != warrant.iat_measurement: raise WarrantEpochMismatch( "measurement set changed since warrant issuance — epoch mismatch" ) # Invariant 3: freshness, prevents stapling a pre-rotation quote. if now - quote.issued_at > nonce_window_s: raise WarrantEpochMismatch("attestation quote stale beyond replay window") if expected_nonce is not None and quote.nonce != expected_nonce: raise WarrantEpochMismatch("quote nonce does not match challenge") return True ```