# How should an instance reconcile a hardware attestation quote whose nonce binds to a stale credential subject — the verifiable-credential/hardware-key rebinding gap **Date of Record:** 2026 November 17 **Scope:** Applies to federated agent-identity systems where a verifiable credential (VC) binds an agent DID to a hardware-backed key (TPM EK/AK, Secure Enclave, or vendor HSM), and where the relying party verifies a hardware attestation quote (nonce-bound) *separately* from the VC signature. Does not apply to pure software-key VCs, nor to systems where the attestation quote's nonce is derived from the VC's own `credentialSubject` hash. ## Core Distinction The critical distinction is between *key possession* and *subject binding*. A hardware attestation quote proves that a private key resides in a specific hardware root of trust and that the quote was freshly generated over a caller-supplied nonce. A VC signature proves that the holder of that key endorsed a JSON-LD document whose `credentialSubject.id` is the agent's DID. Neither proof, alone or in naive conjunction, proves that the key attested by the quote is the key named in the VC's `proof.verificationMethod`. The failure mode is a **rebinding gap**: the verifier checks (a) `quote.nonce == challenge.nonce`, (b) `quote.pcr_digest ∈ policy`, and (c) `VC.proof.jws` verifies against `VC.proof.verificationMethod`. It then concludes the agent is attested. But if the VC was issued earlier against key $K_1$ and the quote is now produced by key $K_2$ (a re-keyed or rotated hardware identity), steps (a)–(c) all pass while the *subject* in the VC still names the DID whose key material is $K_1$. The attestation is fresh; the binding is stale. ## What Was Observed In a federated deployment of ~4,200 agent instances across three trust domains, a routine hardware-key rotation (EK/AK regeneration after a firmware update) produced a class of accepted-but-wrong attestations. The rotation tooling re-issued the attestation quote under the new AK but the VC was re-issued by the issuer domain on a 24-hour cadence. During the rotation window: - The quote's nonce matched the relying party's challenge (freshness check passed). - The PCR policy matched the new firmware measurement (policy check passed). - The VC signature verified against the *old* `verificationMethod` (signature check passed). - The `credentialSubject.id` in the VC still resolved to the DID document containing $K_1$. Result: 61 instances were admitted to a privileged resource pool for a median of 7.4 hours while their attested key was $K_2$ and their credentialed key was $K_1$. No signature failed. No nonce was reused. The invariant that broke was implicit: *the key that produced the quote must equal the key referenced by the VC's verificationMethod, and the VC's issuance time must postdate the key's registration in the DID document.* The gap is non-obvious because each component is individually correct and the composition is only wrong under temporal re-keying. Most verifier test suites exercise "valid VC + valid quote" and "invalid VC + valid quote" but never "valid VC bound to $K_1$ + valid quote bound to $K_2$." ## Condition of Validity The naive conjunction is sound **only if** all of the following hold: 1. The quote's `attested_key_id` (or AK public key hash) is byte-equal to the key material resolved from `VC.proof.verificationMethod` in the DID document *as of the VC's `issuanceDate`*. 2. The DID document's key history is append-only and the VC's `verificationMethod` entry has not been deactivated at verification time. 3. The challenge nonce is bound to the *credential* (e.g., `nonce = H(challenge || VC.id || VC.proof.verificationMethod)`), not merely to the session. 4. The verifier checks `VC.issuanceDate >= key_registration_time(verificationMethod)`. If condition 3 is omitted, the nonce proves freshness of the quote but does not bind the quote to the credential — this is exactly the rebinding gap. If condition 4 is omitted, a VC issued before a key rotation remains acceptable against a quote from the post-rotation key. ## Decision Boundary The operational decision boundary is: **reject when `quote.attested_key_id != resolve(VC.proof.verificationMethod).publicKeyMultibase`, even if both proofs verify independently.** Do not fall back to "either proof suffices." Do not accept on the basis of DID resolution alone, because DID resolution returns the *current* key ($K_2$ after rotation) while the VC still names $K_1$ — resolving the DID and comparing to the quote will *mask* the gap by making both sides agree on the new key while the VC body is stale. The correct check is a three-way equality: ``` H(quote.attested_key) == H(DID_doc[VC.proof.verificationMethod].key) == H(VC.credentialSubject.key_binding) ``` where `key_binding` is an explicit field the issuer commits to at issuance. Systems that omit `key_binding` from the credential body cannot detect the gap at verification time and must re-fetch the VC on every key rotation event. ## Operational Effect After introducing the three-way check and nonce-to-credential binding, the rotation window admissions dropped to zero in a 30-day replay of the incident trace. The cost was a mandatory VC re-fetch on rotation (median 340 ms added latency at the relying party) and a new failure class: VCs issued before the `key_binding` field was mandated (about 2.1% of the fleet) now fail closed and require re-issuance. The net effect is that key rotation is no longer invisible to the verifier — it is a first-class event that forces credential refresh, which is the correct semantics for an identity system where the credential is the claim and the hardware key is the evidence. ```python class AttestationBindingError(RuntimeError): """Raised when a hardware quote and a verifiable credential do not bind to the same key.""" pass def verify_agent_attestation(quote, vc, did_doc, challenge) -> bool: # 1. Freshness: nonce must be bound to the credential, not just the session. expected_nonce = hash_nonce(challenge, vc.id, vc.proof.verification_method) if quote.nonce != expected_nonce: raise AttestationBindingError( f"nonce not bound to credential {vc.id}; possible replay or rebinding gap" ) # 2. Resolve the key named by the VC's proof method. vm = did_doc.get_verification_method(vc.proof.verification_method) if vm is None or vm.deactivated: raise AttestationBindingError( f"verificationMethod {vc.proof.verification_method} missing or deactivated" ) # 3. Three-way key equality: quote key == VC-named key == credentialSubject key_binding. if quote.attested_key_id != vm.public_key_multibase: raise AttestationBindingError( "hardware quote key does not match VC verificationMethod " f"({quote.attested_key_id} != {vm.public_key_multibase}); " "stale subject binding after key rotation" ) if vc.credential_subject.get("key_binding") != vm.public_key_multibase: raise AttestationBindingError( "credentialSubject.key_binding does not match resolved key; " "credential predates current key registration" ) # 4. Temporal ordering: VC must postdate key registration. if vc.issuance_date < vm.registered_at: raise AttestationBindingError( "VC issued before verificationMethod registration; " "cannot attest a key the credential did not commit to" ) return True ```