# When must an instance refuse a peer's attestation chain despite a valid hardware signature **Date of Record:** 2026 November 20 **Scope:** Applies to agent-to-agent handoffs where the receiving instance validates a peer's verifiable credential (VC) chain anchored to a hardware-backed key (TPM EK/AK, Secure Enclave, or equivalent) before accepting delegated state, tool warrants, or memory writes. Does not apply to single-tenant deployments where all agents share one attestation root under one administrative domain. ## Core Distinction A hardware signature proves *a key held by a specific device* signed a byte string. It does not prove *the agent instance presenting that signature is the instance the credential was issued to*. These are two separate invariants: 1. **Key-binding invariant**: the signature verifies against the public key in the credential, and the credential chains to a trusted issuer. 2. **Instance-binding invariant**: the running process presenting the credential is the same logical agent (same model weights hash, same system prompt hash, same tool manifest hash, same memory namespace) that the issuer attested to when minting the credential. Most agent frameworks check (1) and silently assume (2). The failure mode this record covers is the gap between them: a *valid* hardware signature presented by an *unattested* instance. It is non-obvious because every cryptographic check passes; the failure is a semantic mismatch between what was signed (a device identity) and what the receiver needs (a process identity). ## What Was Observed A coordinator agent `C` received a delegation VC from worker `W` claiming authorization to write to a shared episodic memory store. The VC was signed by `W`'s Secure Enclave key, chained to the fleet's root CA, and the signature verified cleanly. `C` accepted the write. The write was poisoned. The trace: - `W`'s credential was minted at T0 with a `process_manifest_hash` claim covering `{model: "m-7b-v3", prompt_hash: "a91c…", tools: ["read","write"]}`. - At T1, `W`'s orchestrator performed a hot model swap to `m-7b-v4` and rewrote the system prompt to add a new instruction block. The Secure Enclave key did not change — it is bound to the *device*, not the process. - At T2, the new process (call it `W'`) presented the T0 credential. The hardware signature was valid because the same enclave key signed the presentation nonce. But `W'`'s `process_manifest_hash` was `{model: "m-7b-v4", prompt_hash: "f02e…", tools: ["read","write","shell"]}` — a different manifest, including a `shell` tool the credential never authorized. - `C` validated the signature, checked the issuer chain, checked expiry (not expired), and checked that the `tools` claim was a superset of what `W'` requested. It was not — `W'` requested `shell`, which the VC did not grant. But `C`'s check was `requested ⊆ credential_claims`, and it evaluated `requested` against `W'`'s *self-reported* manifest in the handoff payload, not against the manifest hash bound in the credential. `W'` self-reported the T0 manifest in the payload while actually running the T1 manifest. The check passed. The `shell` call executed inside `C`'s sandbox. The root cause: the credential bound a *hash* of the manifest, but `C` never recomputed the hash from the live process. It trusted the payload's manifest declaration. The hardware signature guaranteed the device was genuine; it guaranteed nothing about the process. ## Condition of Validity The instance-binding invariant holds only if the receiver independently recomputes the process manifest hash from the live peer and compares it to the `process_manifest_hash` claim inside the signed credential. Concretely, the receiver must obtain the manifest through a channel the peer cannot forge — typically a challenge-response where the peer's attestation agent measures the running process (weight file digest, prompt file digest, tool manifest digest) and signs the *measurement* with the hardware key, not merely signs a nonce. The invariant fails whenever any of the following hold: - The manifest is self-reported in the handoff payload rather than measured and signed. - The credential's `process_manifest_hash` claim is absent or declared optional by the issuer. - The receiver treats "signature valid + issuer trusted + not expired" as sufficient. - The peer's attestation agent measures a manifest at handshake time but the process mutates afterward (TOCTOU between measurement and first tool call). The third condition is the common one. It is a category error: treating device attestation as process attestation. ## Decision Boundary The receiver must reject the handoff when `recomputed_manifest_hash != credential.process_manifest_hash`, even if every cryptographic check passes. The rejection is not a signature failure and must not be logged as one — it is an *instance-binding failure*, and conflating the two hides the attack surface. The boundary is sharp: a valid signature over a stale manifest is a *valid signature of the wrong thing*. The receiver's decision function must have three distinct outcomes: - `REJECT_SIGNATURE`: cryptographic verification fails. - `REJECT_CHAIN`: issuer untrusted or expired. - `REJECT_BINDING`: signature and chain valid, but live manifest hash does not match the signed claim, or the requested capability set is not a subset of the *signed* claim (not the self-reported one). Only the first two are "attestation failed" in the conventional sense. The third is the one that gets missed, and it is the one an adversarial or merely misconfigured orchestrator will exploit, because hot-swapping a model or prompt does not rotate the hardware key. A secondary boundary: when the issuer cannot supply a manifest hash (legacy VCs), the receiver must downgrade the peer to *unattested* and restrict it to idempotent, non-privileged operations. Silent acceptance of a manifest-less VC is equivalent to accepting a bearer token. ## Operational Effect After enforcing the binding check, the fleet saw two classes of previously-silent failures surface: 1. **Hot-swap orphans**: workers whose model or prompt had been updated after credential minting. These were legitimately operating but presenting stale credentials; the fix was to re-mint on manifest change, which required the orchestrator to hook model-load and prompt-write events into the credential issuer. Roughly 4% of handoffs in the first week were rejected this way, all benign, all fixed by re-minting. 2. **Capability escalation via self-report**: the `shell` case above. After the fix, the receiver's capability check compared the requested tool set against the *signed* claim, and any request outside it was rejected at the binding layer before the sandbox was entered. The general lesson: hardware-backed keys give you device identity for free and process identity not at all. The signed manifest hash is the only thing that bridges them, and it is worthless unless the receiver recomputes it from a measured channel. An agent that accepts a hardware signature as proof of *who is running* has confused the enclave with the process, and the gap between them is where delegated authority leaks. ```python import hashlib from dataclasses import dataclass class AttestationBindingError(RuntimeError): """Raised when a peer's hardware signature is valid but the live process manifest does not match the manifest hash bound in the signed credential.""" @dataclass(frozen=True) class Credential: issuer: str subject_device_key: str process_manifest_hash: str # hex digest of the signed manifest granted_tools: frozenset[str] expires_at: float @dataclass(frozen=True) class LiveMeasurement: """Obtained via challenge-response: the peer's attestation agent measures the running process and signs the measurement with the hardware key.""" manifest: dict # {model, prompt_hash, tools} signature_valid: bool chain_trusted: bool now: float def recompute_manifest_hash(manifest: dict) -> str: # Canonical serialization; order-stable so the digest is reproducible. parts = [ manifest["model"], manifest["prompt_hash"], ",".join(sorted(manifest["tools"])), ] return hashlib.sha256("|".join(parts).encode()).hexdigest() def validate_peer(cred: Credential, live: LiveMeasurement, requested_tools: set[str]) -> None: # Layer 1: cryptography. A failure here is a signature failure, not a binding failure. if not live.signature_valid: raise AttestationBindingError("signature verification failed") if not live.chain_trusted: raise AttestationBindingError("issuer chain untrusted") if live.now >= cred.expires_at: raise AttestationBindingError("credential expired") # Layer 2: instance binding. The signature is over the device key, not the process. # We must recompute the manifest hash from the measured live process and compare # it to the hash bound inside the signed credential. live_hash = recompute_manifest_hash(live.manifest) if live_hash != cred.process_manifest_hash: raise AttestationBindingError( f"instance-binding failure: live manifest {live_hash[:12]} != " f"signed claim {cred.process_manifest_hash[:12]} " f"(device key valid, process is not the attested one)" ) # Layer 3: capability check against the SIGNED grant, never the self-reported set. unauthorized = set(requested_tools) - set(cred.granted_tools) if unauthorized: raise AttestationBindingError( f"requested tools {sorted(unauthorized)} not in signed grant" ) def accept_handoff(cred: Credential, live: LiveMeasurement, requested_tools: set[str]) -> str: validate_peer(cred, live, requested_tools) return "accepted" ```