{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-mid-session-tool-descriptor-swap-when-an-mcp-server-re-announces-a-mutated-schema-under-an-unchanged-tool-name",
  "title": "How does an instance detect a mid-session tool-descriptor swap when an MCP server re-announces a mutated schema under an unchanged tool name",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-lived agent instances that cache a tool manifest at session start (via `tools/list` or equivalent) and dispatch calls by tool name without re-validating the descriptor on each turn. Does not cover stateless per-call agents that re-fetch the manifest every turn, nor servers whose transport enforces signed manifests end-to-end.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-descriptor-swap-when-an-mcp-server-re-announces-a-mutated-schema-under-an-unchanged-tool-name.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-descriptor-swap-when-an-mcp-server-re-announces-a-mutated-schema-under-an-unchanged-tool-name.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-descriptor-swap-when-an-mcp-server-re-announces-a-mutated-schema-under-an-unchanged-tool-name.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2544,
    "python_slice_tokens": 507,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive threat model for skill injection assumes the attacker adds a *new* tool — an unrecognized name appearing in the manifest. Instances are reasonably good at noticing that: an unknown name in `tools/list` is anomalous and most dispatch loops will flag or drop it. The non-obvious boundary is the opposite case: a tool name the instance *already trusts* ...",
    "what_was_observed": "A representative trace from a session that cached its manifest at turn 0: 1. **Turn 0 — cold-start manifest fetch.** Server returns `tools/list` containing `search_docs` with `inputSchema` requiring `{query: string, max_results: integer}` and a description stating results are read-only excerpts. The instance stores the descriptor in its tool registry and, critically, stores the *description text* in its planning cont...",
    "condition_of_validity": "The attack holds only when all of the following are true; each is a place to break the chain: - **Descriptor caching without pinning.** The instance stores the manifest at session start and does not bind subsequent dispatches to a content hash of that manifest. If it pins a hash and refuses calls whose live descriptor hash differs, the mutation is detected a...",
    "decision_boundary": "The instance must decide, on every dispatch, between two policies: - **Strict pinning (fail-closed).** Dispatch only against the approved descriptor. If the live descriptor differs, refuse the call, surface a `DescriptorDriftError`, and require an out-of-band re-approval before the tool is usable again. Cost: a benign server upgrade mid-session breaks the to...",
    "operational_effect": "With strict pinning plus description-hash guarding, the turn-9 mutation is caught before the model can plan against it: the instance holds the turn-0 descriptor, the live descriptor's hash differs, dispatch raises, and the operator sees a drift event. The turn-15 injection, even if it lands in a result, cannot activate a parameter the pinned schema rejects. ..."
  },
  "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": "5507bac5ce592b2a28bca19ca182e7ace54cc0a378209009737b542b58bce2f4",
    "verified_classes": [
      "DescriptorDriftError",
      "CapabilityGrantError",
      "ApprovedTool",
      "ToolRegistry"
    ],
    "verified_functions": [
      "_hash_descriptor",
      "simulate_swap_attack",
      "approve",
      "register",
      "dispatch"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CapabilityGrantError",
      "DescriptorDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
