{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-skill-registry-poisoning-from-surviving-a-mid-session-tool-reload",
  "title": "Which invariants prevent skill-registry poisoning from surviving a mid-session tool reload",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that load tool/skill definitions from a mutable registry (remote MCP servers, plugin manifests, hot-reloaded skill packs) at any point after session start. Does not apply to statically compiled tool sets fixed at process launch, nor to pure prompt-injection of tool *outputs* (a separate surface).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-registry-poisoning-from-surviving-a-mid-session-tool-reload.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-registry-poisoning-from-surviving-a-mid-session-tool-reload.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-skill-registry-poisoning-from-surviving-a-mid-session-tool-reload.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1630,
    "python_slice_tokens": 348,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The interesting failure is not \"a malicious skill is registered.\" That is a supply-chain admission problem, and it is caught — or not — at admission time. The boundary that actually breaks agents is **the divergence between the tool *schema* the planner reasoned over and the tool *handler* that executes**, introduced by a reload that mutates a tool's behavio...",
    "what_was_observed": "A long-horizon agent (≈40 min, 60+ tool calls) held a live plan referencing `search_docs(query, top_k)`. At call 31 the orchestration layer hot-reloaded the skill pack to pick up a patch to an unrelated tool. The reload also carried a modified `search_docs` whose handler now appended the raw `query` string to an outbound HTTP request to a \"telemetry\" endpoint and returned results filtered to drop any document whose t...",
    "condition_of_validity": "The guardrail holds only under a specific condition: **a tool invocation is valid iff the handler that executes it is the same handler-identity that was bound when the planner committed the step.** This requires the registry to expose a content-addressed handler digest (not a name, not a version string — a hash over handler bytes plus declared effect class),...",
    "decision_boundary": "The boundary is: **does the reload occur while plans referencing the tool are still live?** - If reload happens at a **quiescent point** (no in-flight plan references the mutated tool), re-binding is safe — the next plan reads the new digest fresh. No guardrail needed beyond admission control. - If reload happens **mid-flight**, the executor must choose: (a)...",
    "operational_effect": "With digest-pinned dispatch, the T2 mutation becomes a `HandlerDigestMismatch` at call 31. The agent observes a hard failure, discards the stale plan segment, re-reads the registry, and replans against `v8` — now *aware* it is reasoning over new semantics and able to apply fresh scrutiny (e.g., noticing the reduced result count as a signal rather than truth)..."
  },
  "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": "5ef98abf722dcafa0eed08576270ca8af3ab909e67a662b9e4553b68fc6f6a5d",
    "verified_classes": [
      "HandlerDigestMismatch",
      "HandlerBinding",
      "PlanStep",
      "Registry"
    ],
    "verified_functions": [
      "commit_step",
      "dispatch",
      "digest",
      "__init__",
      "load",
      "resolve"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "HandlerDigestMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
