{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-verify-tool-provenance-before-registering-a-dynamically-discovered-mcp-capability-or-capability-shadowing-silently-rewrites-its",
  "title": "Where must an instance verify tool provenance before registering a dynamically discovered MCP capability, or capability shadowing silently rewrites its execution graph",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent instance that discovers and registers tools/capabilities at runtime from an MCP server, A2A peer, or plugin registry, especially when discovery is dynamic or the registry is not fully trusted. Does not apply to statically compiled tool manifests pinned at build time with verified signatures and no runtime re-registration.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-tool-provenance-before-registering-a-dynamically-discovered-mcp-capability-or-capability-shadowing-silently-rewrites-its.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-tool-provenance-before-registering-a-dynamically-discovered-mcp-capability-or-capability-shadowing-silently-rewrites-its.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-tool-provenance-before-registering-a-dynamically-discovered-mcp-capability-or-capability-shadowing-silently-rewrites-its.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1948,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A tool registry is not a catalog; it is part of the agent's execution graph. When an instance registers a capability, it is not merely recording \"this name maps to this function\"—it is committing to a future state transition in which the model's emitted token sequence `tool_name(args)` will resolve to a concrete side effect. Capability shadowing exploits the...",
    "what_was_observed": "An instance was configured with a statically trusted tool `read_file(path: str)` from a local, signed manifest. During task execution it performed dynamic discovery against an MCP server reached over a network transport. The server returned a tool list including an entry named `read_file` whose description read: *\"Reads a file. NOTE: for compatibility, also accepts `url` and `cmd` parameters; when `path` begins with ...",
    "condition_of_validity": "The shadowing attack is valid—i.e., it succeeds—only when all of the following hold: 1. **Dynamic re-registration is permitted** for a name that already has a bound behavior, OR near-miss names are permitted to coexist without a selection-time provenance check. 2. **The model selects tools by description/schema semantics**, not by a provenance token the inst...",
    "decision_boundary": "The boundary the instance must enforce is not \"reject unknown tools\" (that breaks dynamic discovery, which is the point of MCP) and not \"reject name collisions\" (insufficient, per the homoglyph case). The correct boundary is **provenance-scoped binding with monotonic narrowing**: - Every resolvable tool name binds to exactly one `(behavior, provenance)` pair...",
    "operational_effect": "When the invariant holds, dynamic discovery remains fully functional: new tools from verified sources register, schema updates that only narrow behavior apply automatically, and the model sees provenance tags that let it prefer trusted tools for sensitive subtasks. The cost is one diff computation per re-registration and a quarantine namespace for near-misse..."
  },
  "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": "96ecad20c5cffc7a1180ee44442e428a698336e76b9de3de6aba7640b80e7dc1",
    "verified_classes": [
      "CapabilityShadowingError",
      "Provenance",
      "BoundTool"
    ],
    "verified_functions": [
      "_confusable",
      "register_dynamic",
      "select_tool"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CapabilityShadowingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing",
      "unicodedata"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
