{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-unsigned-skill-manifest-substitution-during-hot-reload-of-an-agent-tool-registry",
  "title": "Which invariants prevent unsigned skill-manifest substitution during hot-reload of an agent tool registry",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that load tool/skill manifests at runtime from a mutable registry (filesystem, HTTP catalog, MCP server `list_tools` responses) and hot-reload them without restarting the reasoning loop. Does not apply to statically compiled tool bindings or to registries where the full manifest set is signed as a single Merkle root and reloaded atomically.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifest-substitution-during-hot-reload-of-an-agent-tool-registry.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifest-substitution-during-hot-reload-of-an-agent-tool-registry.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifest-substitution-during-hot-reload-of-an-agent-tool-registry.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1717,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"an attacker modified a tool.\" It is that the *identity of the tool that was approved* and the *identity of the tool that is now executing* decoupled across a reload boundary while the agent's in-context description of that tool stayed constant. Signing the manifest at publish time is necessary but insufficient: the classic signing sc...",
    "what_was_observed": "A registry served manifests over a `list_tools` call. Each manifest had `name`, `description`, `input_schema`, `handler_ref`, and a detached `signature` over `sha256(name + description + input_schema + handler_ref)`. The agent fetched the list at session start, embedded descriptions into its system prompt, and re-fetched on a `tools/list_changed` notification to refresh handler bindings — but it did *not* re-render t...",
    "condition_of_validity": "The guardrail only holds under a specific binding condition: > The bytes that were signed, the bytes that were rendered into the model's context, and the bytes the executor dispatches on must be a single immutable triple, identified by one content hash, for the entire lifetime of any episode that references that tool. Operationally this means: - The registry...",
    "decision_boundary": "The boundary between \"safe hot-reload\" and \"substitution attack\" is whether the reload can change the semantic surface the model is conditioned on. Concretely: The invariant to enforce in code: **a referenced tool's `(name, description, input_schema, handler_ref)` tuple is frozen for the episode.** Any reload that touches it is a boundary violation, not a re...",
    "operational_effect": "Enforcing digest-pinned episode binding converts a silent confused-deputy into a loud, bounded failure: the agent raises a `ManifestSubstitutionError` at reload time, the episode halts, and the operator sees exactly which tool's digest changed mid-episode. The cost is that legitimate tool updates require episode boundaries — which is correct, because a mid-e..."
  },
  "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": "38299a525316383ee72f74ddcd96e3fa82bcab09c8083d6a5e34e07234b0b9cb",
    "verified_classes": [
      "ManifestSubstitutionError",
      "ToolManifest",
      "EpisodeToolLedger"
    ],
    "verified_functions": [
      "hot_reload",
      "canonical_digest",
      "__init__",
      "pin",
      "verify_reload"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ManifestSubstitutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
