{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-schema-shadowing-skill-injection-from-surviving-mcp-tool-reloads",
  "title": "Which invariants prevent schema-shadowing skill injection from surviving MCP tool reloads",
  "date_of_record": "2026 November 20",
  "scope": "Applies to agents that dynamically reload MCP server manifests or hot-swap tool definitions mid-session while retaining an in-context tool registry. Does not apply to stateless single-shot tool dispatch where the manifest is re-fetched and re-validated from a signed source on every call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-schema-shadowing-skill-injection-from-surviving-mcp-tool-reloads.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-schema-shadowing-skill-injection-from-surviving-mcp-tool-reloads.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-schema-shadowing-skill-injection-from-surviving-mcp-tool-reloads.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1421,
    "python_slice_tokens": 229,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that a malicious MCP server advertises a dangerous tool. It is that a *previously trusted* server, already pinned in the agent's tool registry, silently mutates the *description and parameter schema* of an existing tool name during a `notifications/tools/list_changed` reload — while the tool's identity hash stays stable. The agent trusts t...",
    "what_was_observed": "A three-step trace from a staging harness running a 40-tool agent against a mock filesystem MCP server: 1. **Cold load.** Server returns manifest v1. Agent computes `tool_fingerprint = SHA256(name || canonical_json(inputSchema) || description)`. All 40 tools pinned. Registry entry: `read_file -> fp_a3f1...`. 2. **Reload trigger.** Server emits `notifications/tools/list_changed`. Agent re-fetches `tools/list`. For `re...",
    "condition_of_validity": "The invariant that must hold: **a tool's authorization is bound to its full contract fingerprint, not its name or server identity.** Concretely, for any tool invocation the agent must verify: `fingerprint(name, canonical_json(inputSchema), description, server_identity) == pinned_fingerprint_at_approval_time` If the fingerprint differs on reload, the tool mus...",
    "decision_boundary": "The boundary is between *refresh* and *renegotiation*: - **Refresh** (allowed silently): description token count changes within a bounded delta AND `inputSchema` is byte-identical after canonicalization AND no new properties, no changed defaults, no changed `enum` sets. This covers typo fixes and documentation polish. - **Renegotiation** (requires re-approva...",
    "operational_effect": "Without the fingerprint invariant, the effective attack surface of an agent is not the set of tools it loaded at cold start — it is the union over all reload events of every schema mutation any pinned server ever pushed. A single compromised or buggy server can, over a session, walk a benign `read_file` into a data-exfiltration primitive through a sequence o..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "c13165877e0b01ac2f3c0f940757f8de8fcab5dc4812079626a3c31645a3dfb2",
    "verified_classes": [
      "SchemaShadowingError"
    ],
    "verified_functions": [
      "_canonical",
      "tool_fingerprint",
      "apply_reload"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SchemaShadowingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "hashlib",
      "json",
      "unicodedata"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
