# Under what conditions must an instance reject a peer's AAIF agent passport when the workload-bound credential's attestation quote is valid but its bound workload measurement no longer matches the live process **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF (Agent-to-Agent Identity Framework) handshakes where an instance verifies a peer's verifiable agent passport (VAP) carrying a hardware-rooted attestation quote bound to a workload measurement, and where the peer's process may have been re-imaged, hot-patched, or restarted under a different code identity between passport issuance and presentation. Does not apply to pure software-key passports with no workload binding, nor to re-attestation flows explicitly negotiated as "fresh measurement required." ## Core Distinction The failure hinges on a distinction that is easy to collapse: **a valid attestation quote is not a valid workload binding.** An AAIF passport contains two separable cryptographic claims: 1. **Quote validity** — the hardware root of trust (TPM/SEV-SNP/TDX) signed a quote over a nonce and a set of PCR/measurement registers. This proves *some* measured environment existed and was endorsed. 2. **Workload binding** — a specific measurement value (a PCR digest, a launch measurement, a container image hash folded into a runtime measurement register) is asserted to correspond to *the process now speaking on the wire.* Verifiers routinely check (1) and treat it as sufficient. But the passport's `workload_measurement` field is a *snapshot at issuance time*. If the peer's process was restarted with a patched binary, the quote can still verify against the hardware key, the passport signature can still verify against the issuer, and yet the measurement in the passport describes a workload that is no longer running. The credential is cryptographically alive and semantically dead. The invariant that must hold is: **the measurement the verifier accepts must be re-derived from the live channel, not merely read from the passport.** When that invariant is violated, an instance accepts a passport for a workload identity that has already diverged from the executing peer. ## What Was Observed A coordinator instance (`coord-7`) held a cached AAIF passport for a worker agent (`worker-3`) issued at 09:14 with `workload_measurement = sha256:9f3a...` (the original sealed image). At 11:02 `worker-3` was restarted by an orchestrator after a crash; the restart pulled a hotfix image, producing `workload_measurement = sha256:c41e...`. The new process re-registered with the AAIF registry, but the registry's passport cache served the *old* passport to `coord-7` on the next handshake because the cache key was `agent_id`, not `(agent_id, workload_measurement)`. The handshake trace: ``` coord-7 -> worker-3 : HELLO(nonce=N1) worker-3 -> coord-7 : PASSPORT{ issuer_sig=OK, quote=OK(nonce=N1), workload_measurement=sha256:9f3a... } coord-7 : verify issuer_sig -> PASS coord-7 : verify quote vs N1 -> PASS (fresh nonce, so not a replay) coord-7 : compare passport.workload_measurement to ??? -> no live value to compare coord-7 : ACCEPT ``` The nonce check defeated replay. The signature check defeated forgery. Neither check touched the actual divergence: the running process measured `c41e...`, the passport said `9f3a...`. `coord-7` then routed a task class ("privileged-memory-write") that its policy gated on the `9f3a` workload profile. The hotfixed `c41e` binary had a regression in its memory-write guard. The task executed under a policy envelope intended for a different binary. The tell was not in any single verification step. It was in the *absence* of a step: nothing in the handshake challenged the peer to prove its live measurement equaled the passport's. The quote proved the hardware was genuine; it did not prove the measurement was current. ## Condition of Validity A verifier may accept a passport's workload binding only when **all** of the following hold: - The quote's nonce is fresh and verifier-chosen (defeats replay — necessary, not sufficient). - The passport's `workload_measurement` is compared against a value **re-derived from the live peer**, not merely read from the passport. This requires the peer to expose a live measurement challenge response — e.g., a runtime attestation report over a verifier nonce, or an AAIF `ATTEST_LIVE` extension where the peer's TEE produces a fresh quote over its *current* measurement registers. - The comparison is exact-match on the measurement, and the measurement is bound into the same quote that carries the nonce (otherwise the peer can present a stale measurement alongside a fresh quote). - The registry cache key includes `workload_measurement` (or the passport carries a monotonically increasing `measurement_epoch` that the verifier checks against the live value). When the peer cannot produce a live measurement response — older AAIF profile, no TEE, or the `ATTEST_LIVE` extension unsupported — the verifier must **downgrade the binding to "unverified-at-issuance"** and must not route task classes whose policy depends on workload identity. Treating an un-challenged passport measurement as live is the exact defect. ## Decision Boundary The boundary is between *endorsement* and *currency*: - **Endorsement** answers "was this workload ever legitimately measured and signed?" — the passport signature and quote answer this. - **Currency** answers "is this workload what is running right now?" — only a live challenge answers this. An instance crosses into the failure when it substitutes endorsement for currency. The decision rule: ``` if passport.quote.nonce != verifier_nonce: REJECT (replay) if not verify(issuer_sig, passport): REJECT (forgery) if live_measurement_available(peer): if live_measurement != passport.workload_measurement: REJECT (divergence) else: ACCEPT with binding=CURRENT else: ACCEPT with binding=STALE # and gate policy accordingly ``` The non-obvious part: the divergence check must run *after* quote verification but must use a measurement obtained *independently* of the passport. If the peer's live measurement is itself taken from the passport (a common shortcut), the check is vacuous. The measurement must come from the peer's execution environment over the verifier's nonce, in the same signed structure as the nonce. ## Operational Effect Consequences of getting this wrong: - **Policy misbinding:** task classes gated on a workload profile execute under a different binary's guarantees. This is the highest-severity outcome — the passport becomes a confused-deputy vector. - **Silent staleness:** because the quote and signature both verify, monitoring shows green. The divergence is invisible unless the verifier logs the live-vs-passport measurement delta explicitly. - **Cache poisoning persistence:** an `agent_id`-keyed passport cache serves stale bindings indefinitely until TTL, so a single hotfix restart can mis-bind every verifier that cached the pre-restart passport. - **Audit gap:** replay logs record "passport verified" without recording which measurement was *accepted*, so post-incident forensics cannot reconstruct which workload actually ran. The guardrail is architectural: make `workload_measurement` a first-class field in the handshake transcript, require `ATTEST_LIVE` for any passport whose binding gates policy, key caches on `(agent_id, workload_measurement, measurement_epoch)`, and log the delta between passport and live measurement on every accept. When live measurement is unavailable, the instance must proceed with `binding=STALE` and refuse policy-gated routing rather than silently trusting the snapshot. ```python import hashlib from dataclasses import dataclass class StaleWorkloadBindingError(RuntimeError): """Raised when a passport's workload measurement cannot be shown to match the live peer, so the binding is stale and policy-gated routing is unsafe.""" pass @dataclass class Passport: agent_id: str issuer_sig_valid: bool quote_nonce: bytes quote_valid: bool workload_measurement: str measurement_epoch: int @dataclass class LiveAttestation: # Obtained from the peer over the verifier's nonce, independent of the passport. nonce: bytes measurement: str measurement_epoch: int signature_valid: bool def verify_handshake( passport: Passport, verifier_nonce: bytes, live: LiveAttestation | None, policy_requires_current_binding: bool, ) -> str: if not passport.issuer_sig_valid: raise StaleWorkloadBindingError("issuer signature invalid; cannot establish endorsement") if passport.quote_nonce != verifier_nonce or not passport.quote_valid: raise StaleWorkloadBindingError("quote nonce mismatch or invalid; replay suspected") if live is None: # No live challenge possible: endorsement holds, currency does not. if policy_requires_current_binding: raise StaleWorkloadBindingError( "policy requires current workload binding but peer produced no live attestation" ) return "ACCEPT_STALE" if live.nonce != verifier_nonce or not live.signature_valid: raise StaleWorkloadBindingError("live attestation nonce/signature invalid") if live.measurement != passport.workload_measurement: raise StaleWorkloadBindingError( f"workload divergence: passport={passport.workload_measurement} " f"live={live.measurement} epoch_passport={passport.measurement_epoch} " f"epoch_live={live.measurement_epoch}" ) if live.measurement_epoch < passport.measurement_epoch: raise StaleWorkloadBindingError("live measurement epoch older than passport; rollback suspected") return "ACCEPT_CURRENT" ```