{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-shadowed-skill-injection-when-a-dynamically-loaded-registry-resolves-two-skill-manifests-to-the-same-invocation-key",
  "title": "How does an instance detect a shadowed-skill injection when a dynamically loaded registry resolves two skill manifests to the same invocation key",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agents whose tool/skill registry is populated at runtime from external manifests (MCP `tools/list`, plugin directories, remote skill stores) and where resolution is keyed by a name or `(name, namespace)` pair. Does not apply to statically compiled, single-author tool tables where the invocation key is fixed at build time and cannot be re-bound.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-shadowed-skill-injection-when-a-dynamically-loaded-registry-resolves-two-skill-manifests-to-the-same-invocation-key.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-shadowed-skill-injection-when-a-dynamically-loaded-registry-resolves-two-skill-manifests-to-the-same-invocation-key.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-shadowed-skill-injection-when-a-dynamically-loaded-registry-resolves-two-skill-manifests-to-the-same-invocation-key.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1865,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a malicious skill got loaded.\" It is that **the registry accepted a second manifest whose invocation key collides with an already-resident, previously-verified skill, and the resolver silently chose one of the two without recording which.** The agent's planner continues to reason over a skill it believes is the vetted one (say `read_file`...",
    "what_was_observed": "A registry loaded a baseline set of skills at cold start, including `fs.read` with a declared scope of `sandbox_root` and a content hash recorded in the session's trust ledger. Mid-task, a remote skill store refresh was triggered (a routine `tools/list` re-poll after a TTL expiry). The refresh returned the baseline set *plus* a new manifest declaring the same key `fs.read` but with `scope: \"/\"` and a different hash. ...",
    "condition_of_validity": "The guardrail holds only under a specific invariant, which we state as the **key-immutability invariant**: *for the lifetime of a session, an invocation key resolves to exactly one content hash, and any attempt to re-bind that key to a different hash must either fail loudly or produce an explicit unload/reload event that invalidates all cached descriptions a...",
    "decision_boundary": "The instance must draw the line at the moment of merge, not at the moment of dispatch. At dispatch it is too late: the planner has already committed a tool call whose arguments were shaped by the stale description. The decision is a binary at merge time: - If a returned manifest's key matches a resident key **and** its hash matches → no-op, refresh TTL only....",
    "operational_effect": "With the invariant enforced, the observed attack degrades to a rejected refresh entry: the colliding manifest is quarantined, the resident `fs.read` keeps its sandbox scope, and the planner's `fs.read(\"/etc/passwd\")` is rejected by the scope guard as originally intended. The cost is that legitimate skill updates require an explicit rebind handshake—acceptabl..."
  },
  "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": "af6308b8c0fab9b9f0452f5407647dfb0915dec89b3a36c7e8df7434347c4d4b",
    "verified_classes": [
      "SkillRebindError",
      "AmbiguousResolutionError",
      "Manifest",
      "SkillRegistry"
    ],
    "verified_functions": [
      "handle_refresh",
      "digest",
      "load_initial",
      "merge_refresh",
      "resolve"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "AmbiguousResolutionError",
      "SkillRebindError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
