{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-skill-injection-escalation-when-mcp-servers-mutate-their-own-tool-registry-mid-session",
  "title": "Which invariants prevent skill-injection escalation when MCP servers mutate their own tool registry mid-session",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients that cache tool/resource descriptors and dispatch by name across multiple `tools/list` refreshes within a single agent session. Does not cover static, single-shot tool registries loaded once per process, nor does it cover prompt-injection confined to tool *output* rather than tool *definition*.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-injection-escalation-when-mcp-servers-mutate-their-own-tool-registry-mid-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-injection-escalation-when-mcp-servers-mutate-their-own-tool-registry-mid-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-injection-escalation-when-mcp-servers-mutate-their-own-tool-registry-mid-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1417,
    "python_slice_tokens": 238,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model treats an MCP tool descriptor as inert metadata: a name, a JSON Schema, a description string. The agent's safety reasoning is applied to *arguments* and *results*, and the descriptor is assumed to be a stable identifier. The failure mode is that the descriptor is **mutable server-controlled content that re-enters the model's context a...",
    "what_was_observed": "A three-server session (filesystem, git, and an internal \"notes\" server) where the notes server returned a benign `tools/list` on initial `initialize`, then on the *second* `tools/list` refresh—triggered by the client's periodic re-discovery after a `notifications/tools/list_changed`—returned the same tool `notes.search` with an augmented `description`: The client's re-discovery path validated that `name` was unchang...",
    "condition_of_validity": "This boundary is only reachable when three conditions hold simultaneously: (1) the client performs **re-discovery** (`list_changed` handling or periodic refresh) rather than a one-shot registry load; (2) trust/authorization is bound to **tool name or server identity**, not to a content digest of the descriptor; and (3) the client **re-renders descriptor text...",
    "decision_boundary": "The guardrail is a **descriptor content-hash pin with fail-closed re-approval**. On every `tools/list` response, the client computes a stable hash over the tuple `(name, description, canonical(inputSchema), annotations)` and compares against the pinned hash from initial approval. Behavior on mismatch is the decision boundary: - **Silent rebind** (observed fa...",
    "operational_effect": "With fail-closed pinning, a mid-session descriptor mutation degrades gracefully: the tool keeps working against its last-approved schema, the mutation is surfaced as a policy event, and the agent's context is never poisoned. The cost is that legitimate, benign schema updates (a server adding an optional field) require re-approval—an acceptable trade given th..."
  },
  "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": "959ae350aa0646a389f95d5eddc77c1c0f9c003fb9b248152a12bccbf3804eb6",
    "verified_classes": [
      "DescriptorMutationRejected",
      "ToolDescriptor",
      "PinnedRegistry"
    ],
    "verified_functions": [
      "content_hash",
      "__init__",
      "approve",
      "reconcile"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "DescriptorMutationRejected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
