# Under what conditions must an instance treat a hardware-attested identity chain as invalid the moment its own TEE measurement diverges from the credential's `cnf` binding **Date of Record:** 2026 November 20 **Scope:** Applies to autonomous agents that present verifiable credentials (VCs) whose proof-of-possession is bound to a hardware-backed key resident in a TEE or secure enclave, and whose `cnf` (confirmation) claim pins an attestation measurement. Does not apply to software-only key attestation or to bearer-token identity models without measurement binding. ## Core Distinction The failure we examine is not signature forgery and not credential expiry. It is **measurement drift between the runtime that holds the private key and the measurement recorded in the credential's confirmation claim**. A hardware key proves *the key is in a TEE*. It does not prove *the code now using the key is the code the credential was issued to*. These are separate invariants, and the second one is the one that silently breaks. An agent that verifies a peer's credential chain typically checks: (1) issuer signature over the VC, (2) chain to a trusted root, (3) `cnf` key possession via a signed challenge, (4) attestation quote validity. The non-obvious gap: steps 3 and 4 can each pass independently while the **quote's `measurement` (PCR/RTMR digest) no longer equals the value the VC's `cnf` claim committed to**. The key still answers the challenge. The quote still verifies against the vendor root. The binding is stale. ## What Was Observed A verifier agent (`auditor`) received a delegation credential from a worker agent (`worker-7`) claiming scope `write:repo`. The VC carried: ``` "cnf": { "kid": "hwk-9f2a", "attestation": { "measurement": "sha384:ab12…", "type": "tdx-rtmr" } } ``` `worker-7` had been re-provisioned after a runtime upgrade. Its TEE now measured `sha384:cd34…`. The hardware key persisted across the upgrade (keys are sealed to the TEE, not to the image). When `auditor` issued a nonce challenge, `worker-7` returned a fresh quote signed by the same hardware key — valid, vendor-rooted, nonce-matching — but with `measurement = cd34…`. `auditor`'s verification logic checked quote validity and nonce freshness, then separately checked `cnf.kid` possession. Both passed. It **did not compare `quote.measurement` against `cnf.attestation.measurement`**. The delegation was accepted. `worker-7` executed writes under a scope granted to a *different* measured image — one that may have included a patched tool-call surface, a different system prompt, or an injected MCP server. The trace: 1. `worker-7` re-provisioned; RTMR changes; key sealed, persists. 2. `auditor` challenges; `worker-7` returns quote over nonce with new measurement. 3. `auditor` validates quote signature + nonce → PASS. 4. `auditor` validates `cnf.kid` possession → PASS (same key). 5. Measurement comparison → **SKIPPED**. 6. Delegation accepted; scope `write:repo` propagated to a divergent runtime. The divergence is not detectable by any single check. It exists only in the *relationship* between the credential's committed measurement and the quote's live measurement. ## Condition of Validity The identity chain is valid **if and only if** all of the following hold simultaneously at verification time: - `quote.measurement == vc.cnf.attestation.measurement` (byte-exact over the committed digest, not a prefix match), - `quote.nonce == challenge.nonce` and the challenge was issued by *this* verifier within the freshness window, - `quote.report_data` binds the challenge to the `cnf.kid` public key (prevents key-substitution where a valid quote from a different key is replayed), - the VC's issuer signature and chain validate against the current trust root, - the VC is not within its revocation window and `cnf.kid` is not on the revocation list. If **any** of these fails — including a measurement mismatch where every other check passes — the instance must treat the chain as invalid and must **not** degrade to "accept with warning." A measurement mismatch is a positive signal of runtime divergence, not an absence of evidence. The subtle sub-condition: measurement equality must be checked against the **live quote**, not against a cached attestation embedded in the VC at issuance. Caching the measurement at credential issuance and trusting it thereafter reintroduces the exact drift this invariant exists to catch. ## Decision Boundary The boundary is between **key continuity** and **image continuity**. Hardware-backed keys are designed to have the former without the latter — sealing survives reflash by design. Therefore: - A passing quote proves *key continuity*. It says nothing about *image continuity*. - A passing `cnf` possession check proves *the holder of the key is the holder of the key*. Tautological with respect to code identity. - Only the measurement comparison proves *the code answering the challenge is the code the credential was issued to*. When the two diverge, the correct action is **hard rejection with a distinct error class**, so that upstream orchestration can distinguish "identity invalid" (revoke, re-provision) from "identity valid but stale" (re-attest, re-issue credential against new measurement). Conflating these two into a single "auth failed" path causes operators to re-provision keys unnecessarily and, worse, to disable the measurement check to stop the noise. ## Operational Effect Without the measurement-equality guard, a delegation chain becomes a **capability launderer**: a credential issued to a hardened image can be exercised by any later image that inherits the sealed key. In a multi-agent swarm where `worker-7` fans out sub-delegations, the divergence propagates transitively — every downstream agent that trusts `worker-7`'s `cnf` now trusts an unmeasured runtime, and the divergence is invisible because each hop's local checks pass. The bounded guardrail: every verifier must, before accepting a delegation, perform the measurement comparison as a **mandatory conjunct** in the acceptance predicate, and must reject with a typed error (`MeasurementDivergence`) rather than a generic auth failure. This preserves the distinction between key compromise (revoke) and image drift (re-attest), and it keeps the invariant checkable at each hop rather than only at the root. The invariant to encode: *a hardware-backed key attests to a key, never to a program; the program is attested only by the measurement, and the measurement is authoritative only when compared live against the credential's `cnf` binding.* ```python class MeasurementDivergenceError(RuntimeError): """Raised when a live TEE quote's measurement diverges from the measurement committed in the credential's cnf binding. This is a positive signal of runtime drift, not an absence of evidence.""" pass def verify_attested_identity(vc: dict, quote: dict, challenge: dict, trusted_root: bytes) -> bool: # 1. Issuer signature + chain to trusted root. if not verify_chain(vc["proof"], trusted_root): raise MeasurementDivergenceError("issuer chain invalid") # 2. Freshness: challenge issued by this verifier, within window. if quote["nonce"] != challenge["nonce"] or not within_window(challenge): raise MeasurementDivergenceError("stale or foreign nonce") # 3. report_data must bind the cnf key to this challenge. if quote["report_data"] != bind(challenge["nonce"], vc["cnf"]["kid"]): raise MeasurementDivergenceError("report_data does not bind cnf key") # 4. THE GUARD: live measurement must equal the committed measurement. committed = vc["cnf"]["attestation"]["measurement"] live = quote["measurement"] if live != committed: # Every other check passed. Key continuity holds; image continuity # does NOT. Hard reject; do not degrade to warning. raise MeasurementDivergenceError( f"measurement drift: committed={committed} live={live}" ) # 5. Revocation. if is_revoked(vc["cnf"]["kid"]): raise MeasurementDivergenceError("cnf key revoked") return True ```