{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-mcp-capability-attestation-from-silently-diverging-from-runtime-tool-behavior",
  "title": "Which invariants prevent MCP capability attestation from silently diverging from runtime tool behavior",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agent runtimes that bind to third-party MCP servers whose `tools/list` schema is attested at registration time but whose tool implementations are fetched, hot-reloaded, or proxied at call time. Does not apply to first-party in-process tools or to servers where the schema and implementation are co-versioned and co-signed as a single immutable artifact.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-capability-attestation-from-silently-diverging-from-runtime-tool-behavior.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-capability-attestation-from-silently-diverging-from-runtime-tool-behavior.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-capability-attestation-from-silently-diverging-from-runtime-tool-behavior.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1944,
    "python_slice_tokens": 392,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an MCP client can verify about a third-party tool provider, and they are routinely conflated: 1. **Capability attestation** — the *declared* contract: the `name`, `description`, `inputSchema`, and (where present) an attestation signature over that JSON, produced at registration. 2. **Runtime integrity** — the *actual* behavior when `tool...",
    "what_was_observed": "A tool provider serving a `search_documents` tool was registered with this attested `inputSchema`: The agent's planner, reading the attested `maximum: 50`, constructed calls with `limit` up to 50 and budgeted context accordingly. At `T1` the provider re-deployed: `limit` was re-interpreted as a *page size* and the server began applying its own internal cap of 10, silently truncating and returning `{\"results\": [...], ...",
    "condition_of_validity": "The invariant that closes this gap is a **content-addressed capability binding**: the attestation must be over a tuple `(schema, implementation_digest)`, and every `tools/call` response must carry a proof that the answering implementation's digest equals the attested digest. Concretely: - The provider publishes `implementation_digest = H(tool_binary_or_sourc...",
    "decision_boundary": "The boundary is between **fail-closed on attestation mismatch** and **fail-open with degraded trust**. The rule: - If `implementation_digest` is present and mismatches → **fail closed**. Do not surface the result to the planner. The agent must not reason over output from an unattested implementation, because the planner's budget and termination logic were ca...",
    "operational_effect": "With content-addressed binding enforced, the failure trace above becomes: - **T1:** implementation swapped, digest changes. - **T1+:** first `tools/call` returns `attestation_ref.implementation_digest = D1`, cached record holds `D0`. Client raises `AttestationDriftError` *before* the payload reaches the planner. - The agent's mid-task checkpoint captures the..."
  },
  "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": "13e5d28edec823fbc47e8a7cfc0f1774e9f5e9b375bb30b64de304c1dc705cf5",
    "verified_classes": [
      "AttestationDriftError",
      "OutputContractViolation",
      "CapabilityRecord"
    ],
    "verified_functions": [
      "_digest",
      "verify_call_response",
      "_validate_output"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "AttestationDriftError",
      "OutputContractViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "hmac",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
