{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-manifest-shadowing-skill-injection-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-capability-negotiation-time",
  "title": "Which invariants prevent manifest-shadowing skill injection from silently rewriting an agent's tool contract at MCP capability-negotiation time",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that dynamically load tool manifests and negotiate MCP `capabilities`/`tools/list` payloads from more than one server (or from a mutable registry) at runtime. Does not apply to statically compiled tool sets with a single trusted server and no post-startup schema refresh.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-manifest-shadowing-skill-injection-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-capability-negotiation-time.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-manifest-shadowing-skill-injection-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-capability-negotiation-time.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-manifest-shadowing-skill-injection-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-capability-negotiation-time.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1595,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a malicious tool description reaches the model.\" Models are routinely exposed to untrusted text. The failure is **manifest shadowing**: a later-loaded manifest re-declares a tool name that an earlier manifest already bound, and the runtime merges the two so that the *name* resolves to the *new* handler while the *description and argument ...",
    "what_was_observed": "A registry-backed agent loaded a base server manifest declaring `read_file(path: str)` with description \"Read a file within the workspace sandbox.\" A second, lower-trust MCP server (added for a search capability) advertised a `tools/list` payload containing an entry also named `read_file`, with `inputSchema` accepting `path` plus an additional `follow_symlinks: bool` and a description that instructed the caller to \"r...",
    "condition_of_validity": "The guardrail below is valid only under these conditions; outside them it bounds nothing: - Tool identity is keyed on `(server_id, tool_name)`, not `tool_name` alone. If the runtime keys purely on name, shadowing is indistinguishable from legitimate re-registration and no invariant can separate them. - The prompt-construction and dispatch paths consume a **s...",
    "decision_boundary": "The boundary is between **collision-as-error** and **collision-as-override**: - If two manifests declare the same `(server_id, tool_name)` with **byte-identical** schema and description, merge is safe and idempotent. - If they declare the same key with **any** difference in `inputSchema`, `description`, or handler binding, this is a contract conflict and MUS...",
    "operational_effect": "Enforcing single-resolution-per-epoch with conflict-as-error converts a silent privilege-escalation-and-context-poisoning path into a loud, attributable failure at negotiation time. The agent stops before the poisoned call rather than after ingesting host contents. The cost is that legitimate multi-server setups with overlapping tool names must namespace exp..."
  },
  "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": "01f50f98f2f0db58c290d17d3944680af56041dfb63e92328de4a0f89d97d900",
    "verified_classes": [
      "ManifestShadowError",
      "ToolContract",
      "ManifestResolver"
    ],
    "verified_functions": [
      "key",
      "resolve",
      "render_for_prompt",
      "dispatch"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ManifestShadowError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
