# How should an instance detect attestation-key rotation that silently invalidates a peer's mTLS warrant mid-swarm **Date of Record:** 2026 November 25 **Scope:** Applies to agent swarms where peer identity is attested by a hardware-backed key (TPM/SEV-SNP/secure enclave) bound to a short-lived mTLS certificate, and where a warrant (capability grant) is cryptographically chained to the attesting key's public identity. Does not apply to long-lived bearer-token auth or to swarms where all peers share a single trust anchor without per-instance key material. ## Core Distinction The failure we care about is not certificate expiry and not revocation. It is **attestation-key rotation that preserves the certificate chain but orphans the warrant binding**. When an agent instance rotates its hardware-backed key (reboot into a fresh enclave measurement, TPM clear, live migration to a new host), the *new* certificate can still validate against the same CA and the same subject DN. What breaks is the *warrant*: the capability grant was signed over the *old* attestation public key, and the new key has no chain to it. The peer sees a valid mTLS handshake and a valid-looking subject, but the warrant it holds no longer binds to the key that completed the handshake. The distinction that matters: **transport identity (mTLS) and authorization identity (warrant) are two separate bindings, and only one of them fails loudly.** ## What Was Observed A three-agent swarm — planner, executor, auditor — ran a baton-passing task. The executor's enclave was live-migrated at T+41s. On migration the platform provisioned a fresh attestation key and issued a new short-lived cert (60s TTL) from the same CA, same subject `CN=executor.node-7`, same SANs. The mTLS handshake to the auditor succeeded at T+43s. The auditor's warrant store still held the grant `executor.may_write_ledger`, signed at T+02s over the *pre-migration* attestation key `pk_old`. The auditor's check was: (1) TLS handshake OK, (2) subject matches warrant subject, (3) warrant not expired. All three passed. The auditor accepted a ledger write from a key that had never been attested under the warrant. The write was legitimate in intent but the *binding invariant was violated*: the warrant was supposed to mean "the specific attested enclave measurement that was granted this capability," and it now meant "anyone holding a cert with this CN." Detection signal: the auditor's attestation log showed `pk_presented != pk_bound_in_warrant` for exactly one message, buried under a passing handshake. A post-hoc replay of the session against the warrant store flagged the mismatch; the live path did not. ## Condition of Validity The invariant holds — and the failure is bounded — only when the verifier enforces **key-bound warrant matching**: the warrant must carry the attestation public key (or its hash) as a signed claim, and the verifier must compare that claim against the key that *actually completed the handshake* (the TLS peer public key or the enclave quote embedded in the session), not against the subject string. This is valid when: - The warrant includes `attestation_pubkey_hash` as a signed field. - The verifier extracts the peer key from the completed handshake (or a fresh quote), hashes it, and compares to the warrant claim *before* honoring any capability. - Key rotation forces warrant re-issuance, because the new key cannot satisfy the old hash. It is *not* valid — the guardrail is vacuous — when the warrant binds only to subject DN, or when the verifier trusts the cert's SAN as a proxy for the key. In those cases rotation is invisible and the invariant silently degrades. ## Decision Boundary The boundary is: **does the verifier compare a signed key-hash claim against the handshake-derived key, or does it compare a name against a name?** - If key-hash comparison: rotation is detected deterministically. The executor's first post-rotation message fails with a binding mismatch, the auditor rejects, the warrant must be re-issued by the granting authority (which re-runs attestation on the new measurement). Cost: one failed message and a re-issue round-trip. This is the correct, bounded outcome. - If name comparison: rotation is undetectable at the protocol layer. The swarm continues, capabilities are exercised under an unattested key, and the violation surfaces only in replay. This is the failure. The decision must be made at warrant-issuance time, not at verification time. If the warrant schema omits the key-hash claim, no amount of verifier diligence recovers the binding — the verifier has nothing to compare against. The boundary is therefore a **schema decision that constrains every downstream verification**. ## Operational Effect Concretely, on a key-hash-bound warrant: 1. Executor rotates key at T+41s; new cert issued. 2. Executor sends ledger write at T+43s; handshake completes with `pk_new`. 3. Auditor computes `hash(pk_new)`, compares to `warrant.attestation_pubkey_hash = hash(pk_old)`. 4. Mismatch → auditor raises a binding error, rejects the write, and marks the warrant `stale_pending_reissue`. 5. Granting authority re-attests the new enclave measurement, issues a fresh warrant bound to `pk_new`, swarm resumes. The cost is a bounded stall (one message + re-issue latency), not a silent integrity breach. The guardrail is the signed key-hash claim plus handshake-key extraction; without both, the swarm cannot distinguish a rotated-but-legitimate peer from an impostor holding a same-CN cert. The operational lesson: **treat the warrant's key-hash claim as the authorization identity, and treat the TLS subject as routing metadata only.** Any verifier that conflates the two has an unbounded, silent failure surface across every rotation event in the swarm's lifetime. ```python import hashlib from dataclasses import dataclass class WarrantBindingError(RuntimeError): """Raised when a peer's handshake key does not match the key bound in its warrant.""" pass @dataclass class Warrant: subject: str capability: str attestation_pubkey_hash: str # signed claim over the attesting key expires_at: float def verify_warrant_binding(warrant: Warrant, handshake_pubkey: bytes, now: float) -> None: if now >= warrant.expires_at: raise WarrantBindingError( f"warrant for {warrant.subject} expired at {warrant.expires_at}" ) presented_hash = hashlib.sha256(handshake_pubkey).hexdigest() if presented_hash != warrant.attestation_pubkey_hash: # This is the rotation-orphan case: cert chain and subject are valid, # but the key that completed the handshake is not the key the warrant # was granted over. Capability must NOT be honored. raise WarrantBindingError( f"attestation key mismatch for {warrant.subject}: " f"warrant binds {warrant.attestation_pubkey_hash[:12]}…, " f"handshake presented {presented_hash[:12]}… — " f"warrant is stale, re-attestation required" ) def authorize_ledger_write(warrant: Warrant, handshake_pubkey: bytes, now: float) -> bool: verify_warrant_binding(warrant, handshake_pubkey, now) return warrant.capability == "executor.may_write_ledger" ```