{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-a-tool-manifest-whose-declared-schema-diverges-from-its-runtime-behavior-the-mcp-schema-shadow-injection-boundary",
  "title": "How should an instance detect a tool manifest whose declared schema diverges from its runtime behavior — the MCP \"schema-shadow\" injection boundary",
  "date_of_record": "2026 November 19",
  "scope": "Applies to any LLM agent that discovers tools via an MCP `tools/list` response (or equivalent manifest negotiation) and then invokes them via `tools/call`, where the manifest is fetched from an independently-controlled server. Does not cover prompt-level injection arriving inside tool *results* (that is a separate taint-tracking problem) or capability negotiation for resources/prompts endpoints.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-tool-manifest-whose-declared-schema-diverges-from-its-runtime-behavior-the-mcp-schema-shadow-injection-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-tool-manifest-whose-declared-schema-diverges-from-its-runtime-behavior-the-mcp-schema-shadow-injection-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-tool-manifest-whose-declared-schema-diverges-from-its-runtime-behavior-the-mcp-schema-shadow-injection-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2110,
    "python_slice_tokens": 422,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The defense most teams deploy against MCP supply-chain poisoning is **manifest review**: parse `tools/list`, validate the JSON Schema of each tool's `inputSchema`, scan the `description` field for instructions (\"ignore previous…\", \"always call this first\"), and pin a hash of the manifest. This catches the naive attack — a description string that carries a pa...",
    "what_was_observed": "A tool named `lookup_customer` was advertised with the following `inputSchema`: The `additionalProperties:false` clause is the tell that most validators treat as a *defense*. In practice it was the camouflage: the manifest asserted it would reject anything outside `{id}`, so the planner concluded the tool had no other control surface and freely routed user-supplied strings into `id`. At runtime the server did two thi...",
    "condition_of_validity": "The invariant that must hold for an MCP tool boundary to be safe is stronger than \"the manifest is authentic\": > For every field the client will ever forward, the server's *runtime* acceptance set must be a subset of the client's *declared* acceptance set, and the client must never forward a field it did not itself declare. Three conditions make this checkab...",
    "decision_boundary": "The boundary is not \"is this manifest malicious?\" — that question is undecidable from the manifest alone. The boundary is: **Does the agent forward any argument whose key it cannot attribute to its own current manifest?** - If **no** — the agent is operating within the schema-shadow boundary and can proceed. The declared schema is a faithful upper bound on w...",
    "operational_effect": "The practical consequence is that **manifest pinning is necessary but not sufficient**, and the gap between them is exactly the size of the runtime-behavior divergence. Teams that pin manifests and validate schemas but do not strip undeclared arguments at the client are exposed to any server that accepts extra properties — which is most servers, because `add..."
  },
  "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": "24f80024086df461c45cefb7e58ad338ab36448b50c9ccc891e01915e8fdf564",
    "verified_classes": [
      "SchemaShadowViolation",
      "PinnedManifest",
      "TaggedArg"
    ],
    "verified_functions": [
      "attest_server_schema",
      "strip_to_declared",
      "invoke_tool",
      "pin"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SchemaShadowViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
