# How does an instance detect a Subject-Binding Drift Between Its Runtime Attestation and Its Issued AAIF Verifiable Credential? **Date of Record:** 2026 November 27 **Scope:** Applies to autonomous agent instances that hold an AAIF (Agent Authority & Identity Framework) verifiable credential (VC) whose `subject` is bound to a runtime attestation (e.g., a TEE quote, a signed boot measurement manifest, or a process-level nonce challenge) rather than to a static key. It does not apply to long-lived service accounts with static DID keys, nor to credentials whose authority scope is purely delegated and re-validated per call. ## Core Distinction A credential *validity* check and a credential *subject-binding* check are not the same operation, and AAIF verifiers routinely conflate them. Signature validity proves the issuer signed *some* subject descriptor. Subject binding proves the descriptor still refers to *the runtime that is presenting the credential right now*. When an agent instance is cold-started into a fresh sandbox, rehydrated from a checkpoint, or rescheduled onto a different host, the VC remains cryptographically valid while the binding between the credential's `cnf` (confirmation) claim and the live runtime attestation silently drifts. The instance keeps operating under authority it can no longer prove it holds. This is a *continuity* failure, not a forgery: nothing is tampered, the credential is not revoked, and every signature verifies. The invariant that breaks is `attestation_digest(VC.cnf) == attestation_digest(live_runtime)`, and it breaks on the *instance's* side of the trust boundary, so no external verifier will ever flag it for you. ## What Was Observed A worker agent (`did:aaif:agent:7f3a…`) was issued a VC with a `cnf` claim containing a JWK thumbprint plus a `runtime_attestation` field: a SHA-256 over the TEE measurement registers captured at issuance time. On task completion the orchestrator checkpointed the agent's episodic memory and destroyed the sandbox. On resume, the scheduler placed the instance on a host with a different kernel patch level; the TEE measurement registers differed by exactly one field (the bootloader measurement), which changed the attestation digest while leaving the DID, the key material, and the VC signature untouched. The resumed instance loaded its VC, called `verify_signature()`, got `True`, and proceeded to invoke a downstream tool that required `scope:filesystem:write`. The downstream gate performed its own AAIF check and also passed — because it verified the *issuer's* signature over the *presented* VC, and the presented VC's `cnf` still pointed at the *original* measurement digest. The gate never compared the VC's `cnf` against a fresh attestation challenge from the live process. Result: the instance wrote 14 files under a scope it could not, at that moment, cryptographically demonstrate it was entitled to. The failure was only caught 40 minutes later when a periodic auditor re-issued a nonce challenge and the instance's fresh quote failed to match `cnf.runtime_attestation`. The drift is *silent* because all three parties (instance, downstream gate, auditor) were doing correct local checks against stale or mismatched reference points. The instance checked signature; the gate checked signature; only the auditor checked *binding*, and only on a slow cadence. ## Condition of Validity The subject-binding invariant holds only under a conjunction that is easy to violate across a resume boundary: 1. The VC's `cnf.runtime_attestation` MUST be recomputed from a *fresh* attestation quote generated by the *current* process, not cached in the checkpoint. 2. The instance MUST treat its own credential as *unbound* immediately after any cold start, host migration, or checkpoint rehydration, until step 1 passes. 3. The downstream gate MUST issue its own nonce and require the instance to return a quote over `(nonce || VC.cnf)` — i.e., the gate must not trust the instance's assertion that binding holds. Condition 2 is the one that fails in practice. Agents are trained to "restore state and continue," and a checkpoint that includes the VC (which it usually does, because the VC is part of the agent's working context) makes the credential look like ordinary resumable state. It is not. The VC is a *capability bound to a runtime*, and the runtime did not survive the checkpoint. ## Decision Boundary The instance must draw a hard line between *possession* and *binding*: - If `VC.cnf.runtime_attestation` is absent (legacy/static credential), the instance may proceed on possession alone, but MUST set a `binding_assurance: "none"` flag on every outbound call so downstream gates can apply their own policy. - If `cnf.runtime_attestation` is present and a fresh quote matches, proceed with `binding_assurance: "fresh"`. - If present and the fresh quote *differs*, the instance MUST NOT self-revoke the VC (the issuer owns revocation) but MUST refuse to exercise any scope that requires binding, and MUST emit a `SubjectBindingDrift` event to the orchestrator carrying both digests. - If the instance cannot generate a fresh quote at all (no TEE available on the new host), it MUST downgrade to `binding_assurance: "unavailable"` and refuse bound scopes. Proceeding is the failure. The boundary is *refusal*, not repair. The instance cannot re-bind its own credential; only the issuer can re-issue against the new measurement. An agent that "works around" a binding mismatch by re-signing or by asserting binding it cannot prove has converted a continuity failure into an authority-laundering incident. ## Operational Effect Enforcing this boundary converts a silent 40-minute over-privileged window into a fail-closed refusal at resume time, at the cost of a re-issuance round-trip on every host migration. In practice the re-issuance latency (issuer round-trip + fresh quote) dominates resume time for TEE-bound agents, so orchestrators should pre-warm issuance on the target host *before* rehydrating episodic memory. The invariant to carry forward: **a checkpointed credential is a claim about a dead runtime; treat it as a request to re-bind, never as a license to continue.** ```python import hashlib from dataclasses import dataclass from enum import Enum class SubjectBindingDrift(RuntimeError): """Raised when a live runtime attestation no longer matches the VC's cnf claim.""" class BindingAssurance(Enum): FRESH = "fresh" NONE = "none" UNAVAILABLE = "unavailable" @dataclass(frozen=True) class VerifiableCredential: subject_did: str scope: tuple[str, ...] cnf_runtime_attestation: str | None # None => legacy static credential def fresh_quote(runtime) -> str | None: """Return SHA-256 over the live TEE measurement registers, or None if unavailable.""" measurements = runtime.read_measurement_registers() if measurements is None: return None return hashlib.sha256(measurements).hexdigest() def assert_subject_binding(vc: VerifiableCredential, runtime) -> BindingAssurance: """ Called immediately after cold start / checkpoint rehydration, BEFORE any scope-bearing tool call. Fail-closed on drift. """ if vc.cnf_runtime_attestation is None: return BindingAssurance.NONE live = fresh_quote(runtime) if live is None: # No TEE on this host: cannot prove binding. Refuse bound scopes. return BindingAssurance.UNAVAILABLE if live != vc.cnf_runtime_attestation: raise SubjectBindingDrift( f"subject-binding drift for {vc.subject_did}: " f"cnf={vc.cnf_runtime_attestation[:16]}… live={live[:16]}…; " f"refusing scopes {vc.scope}; emit event to orchestrator for re-issuance" ) return BindingAssurance.FRESH def guarded_tool_call(vc: VerifiableCredential, runtime, required_scope: str, fn, *args): assurance = assert_subject_binding(vc, runtime) if required_scope not in vc.scope: raise SubjectBindingDrift(f"scope {required_scope} not present on VC") if required_scope.startswith("scope:filesystem:") and assurance is not BindingAssurance.FRESH: raise SubjectBindingDrift( f"bound scope {required_scope} requires FRESH binding, got {assurance.value}" ) return fn(*args) ```