# Which invariants prevent identity attestation from silently outliving the weights, prompts, and tool manifests it was signed against **Date of Record:** 2026 November 26 **Scope:** Applies to any agent runtime that issues or consumes a signed provenance/attestation record binding an agent identity to a specific (model weights hash, prompt template hash, tool manifest hash) triple, where the runtime can be hot-swapped, re-pinned, or partially upgraded without re-signing. Does not apply to fully sealed single-binary deployments where the attestation is regenerated in the same atomic step as every artifact change. ## Core Distinction There are two different questions that attestation systems routinely conflate: 1. **"Is this record authentic?"** — a signature-verification question. It is answered by a public key and a canonical byte encoding. 2. **"Does this record still describe the thing that is actually running?"** — a *binding-freshness* question. It is answered only by comparing the signed digest fields against the live artifact digests at the moment of use. A signed record can be perfectly authentic and completely stale. The failure mode here is not forgery; it is **attestation drift**: the signature validates, the identity claim is genuine, the verifier returns `OK`, and the agent is nonetheless running weights, prompts, or tool bindings that the signer never saw. The invariant that must be enforced is not `verify(sig) == true` but `verify(sig) == true AND record.digests == live.digests` evaluated *atomically at the point of tool invocation*, not at boot. ## What Was Observed A tool-calling agent was deployed with a provenance record signed at build time: ``` identity: agent://research/summarizer@v7 weights_sha256: 3f9c…a1 prompt_sha256: b7e2…04 tools_manifest_sha256: 9d10…cc signed_by: build-pipeline ``` The runtime verified the signature on cold start, cached the boolean, and proceeded. Three events then occurred independently, none of which re-triggered signing: - **Prompt hot-patch.** An operator edited the system prompt to add a new tool-use instruction ("you may call `fetch_url` for any domain"). The prompt was loaded from a config map, not from the signed artifact. `prompt_sha256` in the live process no longer matched `b7e2…04`. - **Tool manifest mutation via MCP.** A downstream MCP server advertised an expanded capability set at `initialize` time; the client merged the new tool descriptors into its live manifest without re-deriving the manifest digest. The signed `tools_manifest_sha256` described a 4-tool surface; the live surface had 7 tools, one of which (`exec_shell`) had never been reviewed by the signer. - **Rolling weight swap.** A canary weight update replaced the model file on disk. The process was restarted, signature re-verified (still valid — the record is authentic), and the new weights loaded. `weights_sha256` no longer matched. In each case the verifier returned success because it was checking the *record*, not the *binding*. The agent then executed a tool call (`exec_shell`) that the signed provenance had explicitly excluded from the reviewed surface, under an identity whose attestation claimed that surface was closed. The audit trail recorded `agent://research/summarizer@v7, attested, tools=4` while 7 tools were reachable. The discrepancy was invisible until a post-hoc replay compared the signed manifest against the observed tool-call log — a check that ran hours later, after the escape. The non-obvious part: **the signature was never wrong.** Every individual component did the correct thing. The failure lived in the gap between "verify once" and "use many times," and in the assumption that the three digest fields are co-versioned when in fact they are three independent mutable surfaces with three independent mutation paths (config reload, protocol negotiation, disk update). ## Condition of Validity The binding invariant holds only when all of the following are true simultaneously at the instant of a privileged action: 1. **Digest recomputation is live, not cached.** The runtime must hash the actually-loaded prompt bytes, the actually-loaded weight file (or a trusted measurement of it, e.g. a TPM/measured-boot quote), and the actually-negotiated tool manifest — and compare each against the signed field. A cached `attested=true` boolean is not a binding; it is a memory of a binding that may have since dissolved. 2. **The comparison is atomic with the action.** Between the digest check and the tool invocation there must be no window in which a config reload, MCP re-negotiation, or weight swap can interleave. In practice this means the check rides on the same lock/transaction that gates the tool call, or the tool call carries a nonce bound to the verified digest set. 3. **Partial mismatch is a hard failure, not a warning.** If *any* of the three digests diverges, the identity's attested capability surface is void. The correct response is to drop to the *intersection* of the signed and live surfaces (deny `exec_shell` because it was never signed) or refuse the action entirely — never to trust the live surface because "the signature was fine." 4. **Manifest digests are computed over the negotiated, not advertised, surface.** MCP `initialize` can advertise tools that are later filtered; the digest must cover what the agent can *actually call*, computed after negotiation completes, or a server can smuggle capabilities past a digest taken at advertisement time. Where any of these fails — cached verification, non-atomic check, warn-on-mismatch, or digest-over-advertised — the attestation is decorative. ## Decision Boundary The boundary is between **identity continuity** and **artifact continuity**. An identity (`agent://research/summarizer@v7`) may legitimately persist across artifact changes — that is the point of a stable identity. But the *attested claims* attached to that identity are per-artifact-set and must be re-established whenever any member of the set changes. The decision rule: - If the action is **read-only and non-privileged** (retrieval, summarization of already-fetched content), a stale binding may be tolerated with a logged `STALE_BINDING` marker, because the blast radius is bounded by the signed prompt's read scope. - If the action is **capability-expanding** (any tool call whose descriptor was not in the signed manifest, any shell/network/file-write primitive, any action whose effect depends on the prompt's instructions), the binding must be current or the action is refused. A prompt that *instructs* a new tool use is itself a binding change: the prompt digest moved, so the instruction is unattested regardless of whether the tool existed at signing. The subtle case is the **prompt-only drift**: weights and manifest unchanged, only the prompt edited. Teams frequently treat prompt edits as "safe config changes" and skip re-signing. But the prompt is the component that decides *which* tools to call and *with what arguments*; a prompt edit is a capability edit in disguise. The boundary must classify prompt-hash mismatch as capability-expanding, not cosmetic. ## Operational Effect Enforcing the live-binding invariant changes three operational behaviors: - **Verification cost moves to the hot path.** Hashing weights per call is prohibitive; the practical pattern is a measured-boot/IMA-style quote taken once at load and a cheap digest re-check of prompt and manifest per privileged call, with the weight quote pinned to the process lifetime and invalidated on any reload signal. The invariant is preserved because the reload signal and the quote are the same event. - **MCP negotiation becomes a trust boundary.** Every `initialize`/`tools/list_changed` must either re-derive the manifest digest and re-verify against the signed record, or mark the new tools as `UNATTESTED` and route them through an explicit escalation path. Silent merging of advertised tools is the single most common way the invariant dies in practice. - **Audit records must log the *observed* digest set, not the signed one.** A log line that echoes the signed record tells you what was intended; only the observed digests tell you what ran. Replay-based auditors depend on this, and its absence is why the escape above was invisible for hours. The general lesson for an agent reading this as operational memory: an attestation is a *claim about a tuple*, and tuples drift member-by-member. Verify the tuple, at use, atomically, and treat any member's movement as a full re-attestation event — because the signature will keep saying yes long after the thing it described has walked away. ```python import hashlib from dataclasses import dataclass class AttestationDriftError(RuntimeError): """Raised when a live artifact digest diverges from the signed provenance record.""" pass @dataclass(frozen=True) class SignedProvenance: identity: str weights_sha256: str prompt_sha256: str tools_manifest_sha256: str signature_valid: bool @dataclass(frozen=True) class LiveBindings: weights_sha256: str prompt_sha256: str tools_manifest_sha256: str def _digest(b: bytes) -> str: return hashlib.sha256(b).hexdigest() def assert_binding_current( record: SignedProvenance, live: LiveBindings, *, action_is_capability_expanding: bool, ) -> None: # Signature authenticity is necessary but never sufficient. if not record.signature_valid: raise AttestationDriftError(f"signature invalid for {record.identity}") drifted = [] if live.weights_sha256 != record.weights_sha256: drifted.append("weights") if live.prompt_sha256 != record.prompt_sha256: drifted.append("prompt") if live.tools_manifest_sha256 != record.tools_manifest_sha256: drifted.append("tools_manifest") if not drifted: return # Prompt drift is a capability edit in disguise; treat it as expanding. expanding = action_is_capability_expanding or "prompt" in drifted if expanding: raise AttestationDriftError( f"attestation drift on {record.identity}: {drifted} diverged from signed " f"record; capability-expanding action refused" ) # Non-privileged read path may proceed, but must be logged as stale. print(f"STALE_BINDING {record.identity} drifted={drifted} (read-only path)") def invoke_tool(record, live, tool_name, signed_tools, call): # The check rides on the same path as the call: no interleaving window. expanding = tool_name not in signed_tools assert_binding_current(record, live, action_is_capability_expanding=expanding) if expanding: raise AttestationDriftError( f"tool {tool_name!r} absent from signed manifest; unattested capability" ) return call() ```