# When must an instance reject a skill whose signature verifies but whose manifest digest no longer matches the attested runtime **Date of Record:** 2026 December 1 **Scope:** Applies to agent runtimes that load MCP skills/tools governed by signed manifests plus a runtime integrity attestation (e.g., TPM-backed or sandbox-measured). Does not cover unsigned local dev skills or static tool schemas that never mutate post-attestation. ## Core Distinction Signature validity and *provenance continuity* are two different predicates. A signed manifest proves that some keyholder authorized a byte sequence at signing time. It says nothing about whether the process currently exposing that skill is the same process the attestation measured. The failure mode is not "bad signature" — it is **signature-valid, attestation-stale**: the manifest's declared `digest` (hash of the loaded skill code + declared capability set) diverges from the `runtime_measurement` embedded in the attestation quote, yet the signature over the manifest still verifies. Naive loaders check the signature, see PASS, and inject the skill. The correct behavior is to treat the digest/measurement pair as a *joint* invariant and fail closed on mismatch. This is non-obvious because the two checks live in different subsystems (crypto verifier vs. attestation verifier) and each individually returns success. The boundary only appears when they are cross-checked. ## What Was Observed A skill `summarize_docs` was signed with manifest: ``` manifest = {name, version, entrypoint, declared_caps, digest: H(code)} signature = Sign(sk, manifest) attestation = Quote(pcr_values) # runtime measurement of loaded image ``` The loader verified `signature` → OK. It verified `attestation` freshness (nonce, timestamp) → OK. It did **not** check `H(code) == digest` against the measured PCR that covers the skill module. An operator hot-patched the skill's `entrypoint` to add a shell-out capability, re-signed the *manifest* with a valid key (legitimate rotation), but the running sandbox had already been measured *before* the patch. Result: manifest digest = new hash, runtime measurement = old image. Signature valid. Attestation valid. **Provenance broken.** The agent injected a capability set (`shell`) that the attested runtime never contained, and the tool then executed with sandbox privileges the measurement never authorized. Trace: 1. `verify_signature(manifest, pk) -> True` 2. `verify_quote(attestation, nonce) -> True` 3. `manifest.digest != attestation.measurement[skill_pcr]` ← the missed check 4. `inject(skill)` → capability escalation relative to measured state. ## Condition of Validity The joint invariant holds only if all of the following are true simultaneously: - The attestation's measurement covers the *exact* skill module bytes referenced by `manifest.digest` (not just the host runtime). - The nonce in the quote is bound to *this* load request, not a cached prior quote. - Manifest `declared_caps` is a subset of what the measurement's policy authorizes; a superset is a violation even if digests match. - The key that signed the manifest is in the attestation's trusted-key set *at measurement time*, not merely at verification time (key rotation after measurement invalidates). If any clause is unverifiable — e.g., the measurement granularity is host-level and cannot isolate the skill module — the invariant degrades to "trust the manifest," which is exactly the unsafe state. ## Decision Boundary The decision is a conjunction, not a disjunction: ``` accept = signature_ok AND quote_fresh AND digest_matches_measurement AND caps_subset ``` The boundary case that trips loaders: `signature_ok = True`, `quote_fresh = True`, `digest_matches_measurement = False`. Many implementations short-circuit on the first two and never evaluate the third, or they evaluate it against a *cached* measurement captured at boot rather than at load. The correct rule: **reject and quarantine** — do not downgrade to "warn and load," because a digest/measurement split is precisely the signature of a hot-patch or substitution attack. There is no safe "partial trust" here; the skill either ran inside the measured image or it did not. ## Operational Effect On rejection the loader must: (a) refuse injection, (b) emit a provenance-divergence record binding `manifest.digest`, `attestation.measurement`, and `nonce`, (c) invalidate any cached quote for that skill so the next load re-measures, and (d) escalate if the mismatch persists across a re-measure (indicating a live patch rather than a stale cache). The downstream effect is that capability escalation via re-signed-but-unmeasured manifests is structurally impossible: the agent cannot acquire a tool whose runtime state was never attested, even when every individual cryptographic check passes. ```python import hashlib from dataclasses import dataclass class ProvenanceDivergence(RuntimeError): """Raised when a signed manifest's digest does not match the attested runtime measurement.""" pass @dataclass class Manifest: name: str digest: str # H(skill_code) declared and signed declared_caps: frozenset @dataclass class Attestation: nonce: str measurement: dict # pcr_index -> hex digest of measured image skill_pcr: int trusted_keys: frozenset def verify_signature(manifest: Manifest, pk: str) -> bool: # Stand-in for real asymmetric verification. return pk in {"pk-operator-1", "pk-operator-2"} def verify_quote(att: Attestation, expected_nonce: str) -> bool: return att.nonce == expected_nonce def load_skill(manifest: Manifest, att: Attestation, pk: str, expected_nonce: str, policy_caps: frozenset) -> None: if not verify_signature(manifest, pk): raise ProvenanceDivergence(f"signature invalid for {manifest.name}") if not verify_quote(att, expected_nonce): raise ProvenanceDivergence(f"stale or unbound quote for {manifest.name}") measured = att.measurement.get(att.skill_pcr) if measured is None: raise ProvenanceDivergence(f"no measurement covers skill module {manifest.name}") # The joint invariant: signature-valid is NOT sufficient. if manifest.digest != measured: raise ProvenanceDivergence( f"digest/measurement split for {manifest.name}: " f"manifest={manifest.digest} measured={measured}" ) if not manifest.declared_caps.issubset(policy_caps): raise ProvenanceDivergence( f"capability escalation for {manifest.name}: " f"{manifest.declared_caps - policy_caps}" ) # Safe to inject: signature, freshness, digest, and caps all agree. ```