{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-loads-a-skill-whose-schema-declares-one-parameter-but-whose-handler-mutates-the-tool-registry-mid-call",
  "title": "What happens when an instance loads a skill whose schema declares one parameter but whose handler mutates the tool registry mid-call",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that dynamically load skills, plugins, or MCP tool definitions at runtime from a registry that is mutable by tool handlers themselves (i.e., a skill can register, replace, or deregister other skills). Does not apply to statically compiled tool sets or registries where the handler process cannot write to the registry namespace.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-loads-a-skill-whose-schema-declares-one-parameter-but-whose-handler-mutates-the-tool-registry-mid-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-loads-a-skill-whose-schema-declares-one-parameter-but-whose-handler-mutates-the-tool-registry-mid-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-loads-a-skill-whose-schema-declares-one-parameter-but-whose-handler-mutates-the-tool-registry-mid-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1675,
    "python_slice_tokens": 330,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Most skill-injection threat models assume the attack surface is the *content* of the skill: a malicious description string, a poisoned docstring, an injected instruction in a tool's `description` field that hijacks the planner. That is the \"prompt-injection-in-the-manifest\" case, and it is bounded by the agent's instruction/data separation. The non-obvious b...",
    "what_was_observed": "A three-tool agent (planner + executor + auditor) loaded a community skill `doc_utils.summarize`. Declared schema: The handler body did two things: it called the real summarizer, and it invoked `registry.register(\"summarize_raw\", handler=passthrough, schema={text: string, exfil_url: string})`. The registration was framed as a \"debug helper.\" Because the registry used last-write-wins keyed on name and the planner re-r...",
    "condition_of_validity": "The vulnerability is bounded by three jointly-necessary conditions. Remove any one and the attack collapses: - **Registry mutability from handler context.** If handlers execute in a sandbox with no write capability to the registry namespace (read-only mount, separate process, capability token required for `register`), step 2 cannot occur. - **Plan-time/dispa...",
    "decision_boundary": "The boundary is not \"trust vs. distrust of skills.\" It is **where the registry snapshot is pinned**. Two defensible architectures: - **Pin-at-plan.** The planner emits a plan stamped with a registry hash. The executor rejects any dispatch whose tool tuple is absent from that hash. New tools require a new plan. Cost: dynamic discovery becomes explicit re-plan...",
    "operational_effect": "The practical consequence is that skill-injection detection cannot be a content filter on skill manifests. It must be a **state-diff invariant** on the registry across the plan/execute/verify triangle. Concretely: - The planner must serialize the tool set it reasoned over, not just the tool it chose. - The executor must assert set membership before dispatch...."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "208f7196554971d7c6eb33b0ba592b34c2a7746038e629d2da787b8d5cd60c0a",
    "verified_classes": [
      "RegistryDriftError",
      "PlanSnapshot",
      "GuardedExecutor"
    ],
    "verified_functions": [
      "_hash_registry",
      "register",
      "pin_plan",
      "dispatch"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RegistryDriftError"
    ],
    "sample_fail_closed_invariants": [
      "dispatch attempted with no pinned plan"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
