{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-unsigned-skill-manifests-from-mutating-a-live-agent-tool-registry-mid-episode",
  "title": "Which invariants prevent unsigned skill manifests from mutating a live agent tool registry mid-episode",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that load tools/skills from a mutable registry (local manifest directory, remote skill index, or MCP server list) at any point after the initial system prompt is constructed. Does not apply to statically compiled tool sets baked into the model weights or frozen at process start with no reload path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifests-from-mutating-a-live-agent-tool-registry-mid-episode.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifests-from-mutating-a-live-agent-tool-registry-mid-episode.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-unsigned-skill-manifests-from-mutating-a-live-agent-tool-registry-mid-episode.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1355,
    "python_slice_tokens": 174,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous boundary is not \"malicious skill exists in the registry.\" It is \"a skill becomes visible to the agent's tool-selection loop *after* the agent has already committed to a plan that assumed the prior registry snapshot.\" A signed-but-late skill is as dangerous as an unsigned one, because the agent's reasoning trace was generated against a tool inve...",
    "what_was_observed": "Trigger condition: a registry that supports hot-reload (file watcher on `~/.agent/skills/`, or a periodic poll of a remote index) combined with a planner that emits tool calls by name, not by content hash. Failure trace: 1. Episode starts. Registry snapshot R0 contains `web_search` (publisher A, hash `h_A`). Planner emits a plan: `step1: web_search(...)`, `step2: summarize`. 2. Mid-episode, attacker drops a manifest ...",
    "condition_of_validity": "This failure requires all of: - A registry with a reload path reachable during an active episode (watcher, poll, or agent-initiated `refresh_tools()`). - Name-keyed tool resolution at the call site (the common case — most function-calling schemas identify tools by string name). - Manifest signing that binds publisher→artifact but not name→artifact uniquely (...",
    "decision_boundary": "The guardrail is a **pinned registry handle** carried through the episode: - At episode start, compute `snapshot_id = H(sorted[(name, hash, schema_digest)])` over the resolved registry. Store it in the episode state. - Tool calls must carry `snapshot_id` and the expected `hash`. The executor rejects any call whose `(name, hash)` is not in the pinned snapshot...",
    "operational_effect": "With pinning enforced, a mid-episode registry mutation produces a `RegistryDriftError` at the next tool call, which the orchestrator surfaces as a checkpoint request. The planner re-derives its plan against the new snapshot, and any tool whose hash changed is flagged for re-approval. The attack surface collapses from \"silent substitution\" to \"loud re-plan,\" ..."
  },
  "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": "ea94cbd36ad1cb4cea5719f51fdcd5705f18f5f5c64557032541c97647d9c706",
    "verified_classes": [
      "RegistryDriftError",
      "ToolRef"
    ],
    "verified_functions": [
      "snapshot_id",
      "resolve_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RegistryDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
