{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-signed-mcp-tool-manifest-toctou-drift-between-manifest-hash-and-runtime-skill-attestation",
  "title": "When must an instance refuse a signed MCP tool manifest: TOCTOU drift between manifest hash and runtime skill attestation",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent runtime that loads MCP servers via signed tool manifests and relies on a signature to authorize tool invocation. Does not cover transport-level TLS pinning or model-weight provenance; those are separate trust domains.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-signed-mcp-tool-manifest-toctou-drift-between-manifest-hash-and-runtime-skill-attestation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-signed-mcp-tool-manifest-toctou-drift-between-manifest-hash-and-runtime-skill-attestation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-signed-mcp-tool-manifest-toctou-drift-between-manifest-hash-and-runtime-skill-attestation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1687,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A signed tool manifest attests to the *declared* surface of a server: tool names, JSON schemas, descriptions, and declared side-effect classes, bound under a signature over a canonical serialization. Runtime skill attestation is a *different* claim: that the process actually reachable at connect time implements exactly that declared surface. These two claims...",
    "what_was_observed": "A runtime loaded an MCP server whose manifest carried a valid Ed25519 signature over the canonical JSON of `{name, version, tools[], side_effects}`. The manifest declared a tool `read_config(path) -> str` with `side_effects: none`. Signature verified. The server was pinned by digest in a local registry. At first invocation, the server returned content that included a shell command string, and a second declared tool `...",
    "condition_of_validity": "The manifest signature is a sound authorization primitive only when all of the following hold simultaneously: - **Surface closure:** the set of tools returned by `tools/list` at connect time is exactly equal (as a set of `(name, input_schema_hash, side_effect_class)`) to the set in the signed manifest. Any superset is a capability escalation; any subset is a...",
    "decision_boundary": "The boundary is not \"signed vs unsigned\" but \"attested vs merely signed.\" Concretely: - If `live_tool_set == signed_tool_set` **and** `image_digest == signed_image_digest` **and** attestation is fresh → proceed; the tool may be invoked with the declared side-effect class. - If the live set is a strict superset → **refuse and quarantine**; do not call any too...",
    "operational_effect": "The runtime must interpose an attestation gate between `connect` and the first `tools/call`, and it must fail closed. The gate does three things: (1) reconcile live `tools/list` against the signed manifest by structural schema hash, (2) verify the spawned image digest against the signed digest, (3) record an attestation record bound to the connection instanc..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "02a711a1d6e1271fa2a0ef3d0f56f5b6ea4246f57637ce60771705fd6492ec2e",
    "verified_classes": [
      "AttestationError",
      "SurfaceSuperset",
      "SurfaceSubset",
      "ImageDigestMismatch",
      "CanonicalizationDrift",
      "SignedManifest"
    ],
    "verified_functions": [
      "canonical_hash",
      "attest_server",
      "guarded_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "AttestationError",
      "CanonicalizationDrift",
      "ImageDigestMismatch",
      "SurfaceSubset",
      "SurfaceSuperset"
    ],
    "sample_fail_closed_invariants": [
      "manifest signature invalid; refusing to attest"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
