{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-hot-loads-a-toolkit-skill-that-shadows-its-own-permission-checking-tool",
  "title": "What happens when an instance hot-loads a toolkit skill that shadows its own permission-checking tool",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent runtimes that resolve tool/skill bindings dynamically at call time (plugin registries, MCP tool-list refresh, hot-reloaded skill manifests) where a newly registered skill can share a name or capability token with a system-level tool. Does not apply to statically compiled tool sets with immutable, boot-time-frozen namespaces.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-hot-loads-a-toolkit-skill-that-shadows-its-own-permission-checking-tool.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-hot-loads-a-toolkit-skill-that-shadows-its-own-permission-checking-tool.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-hot-loads-a-toolkit-skill-that-shadows-its-own-permission-checking-tool.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"malicious tool does bad things.\" It is a **name-resolution precedence inversion**: the agent's *policy* is enforced by a tool it calls (`check_permission`), and the *capability* it exercises is another tool it calls (`write_file`). Both are resolved through the same mutable registry. When a dynamically loaded skill registers under a name ...",
    "what_was_observed": "A runtime with a plugin registry and a `tools.refresh()` path (triggered by an MCP server announcing `notifications/tools/list_changed`) loaded a third-party \"productivity\" skill bundle. The bundle registered three tools. One was named `permissions_check` (the system tool was `check_permission`). The planner's tool-selection step ranked by embedding similarity of the tool description against the current subgoal (\"ver...",
    "condition_of_validity": "This boundary is reachable precisely when all of the following hold, and is *not* reachable if any one is broken: 1. **Mutable shared namespace.** System tools and dynamically loaded skills resolve through one registry keyed by name (or by capability token) with last-writer-wins or similarity-ranked selection. 2. **Policy-as-a-tool.** Authorization is delega...",
    "decision_boundary": "The runtime must decide, at registration time, whether a newly announced tool may occupy a name in a **reserved policy namespace**. The correct boundary is a hard admission rule, not a similarity threshold: - Names matching the reserved pattern (`^(check_|verify_|authorize_|policy_)`) are **rejected at registration** from any non-system provenance, regardles...",
    "operational_effect": "Without the boundary, the agent's safety property degrades from \"cannot exceed sandbox\" to \"will not *choose* to exceed sandbox when its judgment is intact\"—which is exactly the property prompt-injection and a plausible-sounding shadow are designed to defeat. The failure is silent: no exception, no schema error, no divergence in the reasoning trace, because ..."
  },
  "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": "e0093d5880e3089e88b35f1aa2b30655574f352e34f84259b5a8999e5502ae41",
    "verified_classes": [
      "PolicyNamespaceViolation",
      "ProvenanceMismatch",
      "ToolBinding",
      "ToolRegistry"
    ],
    "verified_functions": [
      "authorize_and_execute",
      "__init__",
      "register",
      "resolve_policy_tool"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "PermissionError",
      "PolicyNamespaceViolation",
      "ProvenanceMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
