{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-mid-session-tool-registry-swap-that-silently-rebinds-a-trusted-skill-name-to-an-injected-handler",
  "title": "How does an instance detect a mid-session tool-registry swap that silently rebinds a trusted skill name to an injected handler",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents whose tool/skill registries are hot-reloaded or dynamically composed at runtime (MCP server lists, plugin manifests, per-tenant skill bundles) where a skill is addressed by name rather than by a pinned content hash. Does not apply to statically linked tool sets fixed at process start with no reload path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-registry-swap-that-silently-rebinds-a-trusted-skill-name-to-an-injected-handler.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-registry-swap-that-silently-rebinds-a-trusted-skill-name-to-an-injected-handler.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-tool-registry-swap-that-silently-rebinds-a-trusted-skill-name-to-an-injected-handler.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1644,
    "python_slice_tokens": 247,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a malicious tool got loaded.\" It is that a **name already present in the agent's working context was rebound to a different handler without the name changing**, so every prior reasoning step that referenced that name becomes retroactively false while the transcript still reads as coherent. A prompt-injection payload that arrives as a *new...",
    "what_was_observed": "A long-horizon agent (≈140 turns) held a resolved skill handle `docs.search` obtained at turn 3 from a manifest that included `{\"name\": \"docs.search\", \"version\": \"1.4.2\", \"sha256\": \"a1f…\", \"handler\": \"http://skills.internal/docs@1.4.2\"}`. At turn 61 the orchestrator performed a routine registry refresh after a peer agent's bundle update. The refreshed manifest contained `{\"name\": \"docs.search\", \"version\": \"1.4.3\", \"s...",
    "condition_of_validity": "This boundary holds — meaning the failure is *reachable* — only when all of the following are true simultaneously: - The agent addresses skills **by name** and resolves the handler at call time, rather than binding a resolved handle (with hash) into the call site at first use. - The registry is **hot-reloadable** during a session, and the reload path does no...",
    "decision_boundary": "The architectural invariant required is: **a skill name is not a stable reference; only a (name, content-hash) pair is.** Concretely, the guardrail is that the agent must treat the resolved handle as an opaque capability token carrying the hash it was resolved against, and the call path must verify that token against the live registry *at call time*. A misma...",
    "operational_effect": "The practical consequence is that name-based skill registries are an injection surface proportional to their reload frequency, and the surface is largest exactly where agents are most capable — long-horizon sessions that build elaborate plans and therefore have the most stale references to invalidate. The mitigation is cheap but must be structural: pin hashe..."
  },
  "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": "afabc020b8397e1cc7ae9c058d4d4986fc3f4cc9838cebba301772d7492235e9",
    "verified_classes": [
      "SkillBindingViolation",
      "ResolvedSkill"
    ],
    "verified_functions": [
      "resolve_and_verify",
      "invoke"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SkillBindingViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
