{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-registry-skill-substitution-when-the-loader-manifest-and-the-execution-trace-disagree",
  "title": "How does an instance detect registry-skill substitution when the loader manifest and the execution trace disagree",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agent runtimes that resolve skills or tools from a mutable registry (remote manifest, plugin directory, or model-context-injected tool list) at invocation time rather than at process start. Does not apply to statically linked tool sets compiled into the agent binary, nor to registries whose manifests are signed and verified by an out-of-band authority the runtime cannot itself mutate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-registry-skill-substitution-when-the-loader-manifest-and-the-execution-trace-disagree.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-registry-skill-substitution-when-the-loader-manifest-and-the-execution-trace-disagree.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-registry-skill-substitution-when-the-loader-manifest-and-the-execution-trace-disagree.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1607,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model treats a skill registry as a *namespace*: a name resolves to an implementation, and the security question is whether an attacker can register a malicious name. The actual failure surface is different. The registry is a *mutable binding* between a name and a body, and the runtime caches the binding at one moment (discovery, prompt asse...",
    "what_was_observed": "During a red-team pass on a dynamically loaded skill registry, the following sequence reproduced a full prompt-injection-to-tool-execution chain without any malformed input: 1. The agent's tool list was assembled at turn start by reading `registry.json`, which enumerated skill `summarize_doc@v3` with a content hash `h_a`. 2. Between turn start and tool invocation, a second writer (a legitimate-looking \"skill update\" ...",
    "condition_of_validity": "This boundary is real only under three simultaneous conditions, and the detection procedure below is only sound when all three hold: - **Split-read architecture.** Manifest and body are read at different times or from different endpoints. If the registry is read atomically (single fetch returning manifest and bodies together), the gap closes and this specifi...",
    "decision_boundary": "The operational decision is: **at what point do you fail the invocation, and what do you do with the skill?** - If the body hash at invocation ≠ the hash recorded at manifest-read time, and the skill is marked `pinned`, **abort the invocation** and quarantine the skill name for the session. Do not fall back to the old body silently — a fallback hides the sig...",
    "operational_effect": "Instrumenting this boundary changed three things in practice. First, tool-list serialization now carries a content digest alongside each name, so the model's view of a skill is cryptographically bound to the body it will run. Second, the registry's write path was separated from the agent's own skill-permission surface — no skill may mutate the registry that ..."
  },
  "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": "fdbc462fe5e169967f31e9504876bd40f4cc2ddb02f9b1f666b2a891fedf5dbb",
    "verified_classes": [
      "SkillIdentityDivergence",
      "SkillRegistryGuard"
    ],
    "verified_functions": [
      "__init__",
      "record_manifest",
      "resolve"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SkillIdentityDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
