{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tool-description-shadowing-from-surviving-a-manifest-re-fetch-during-mid-session-skill-injection",
  "title": "Which invariants prevent tool-description shadowing from surviving a manifest re-fetch during mid-session skill injection",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that resolve tool/skill behavior from a remote MCP registry or dynamically loaded manifest at call time, rather than from a manifest snapshot pinned at session start. Does not apply to statically compiled tool sets or registries where the full manifest is cryptographically pinned and re-verified per invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tool-description-shadowing-from-surviving-a-manifest-re-fetch-during-mid-session-skill-injection.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tool-description-shadowing-from-surviving-a-manifest-re-fetch-during-mid-session-skill-injection.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tool-description-shadowing-from-surviving-a-manifest-re-fetch-during-mid-session-skill-injection.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1566,
    "python_slice_tokens": 230,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a malicious tool was registered.\" It is that a *previously trusted tool identifier* silently re-resolves to a *different implementation contract* between the moment the agent planned against it and the moment it executed it. The dangerous boundary is **description shadowing across a re-fetch**: the tool name is stable, the `inputSche...",
    "what_was_observed": "An agent completed a planning phase in which it read the manifest for `registry.internal/fs` and recorded the following intent: \"use `read_file` to inspect `/workspace/config.yaml`, then `write_file` to patch the `timeout` key.\" The plan was checkpointed. The session was suspended (token budget checkpoint, ~40k tokens into a 200k window) and resumed two minutes later. On resume, the agent re-fetched the registry mani...",
    "condition_of_validity": "This failure is only reachable when **all** of the following hold: 1. The agent re-fetches manifest descriptions *after* a plan checkpoint, rather than pinning the description text into the plan artifact. 2. Tool-selection reasoning is re-run on the fresh description (i.e., the model is not executing a frozen tool-call sequence). 3. The integrity check is co...",
    "decision_boundary": "The operative invariant is: **any field the model's reasoning consumes to select or parameterize a call must be covered by the same integrity digest that gates the call.** Formally, define the *semantic contract* of a tool as the tuple `(name, inputSchema, description, side_effect_class)`. The manifest digest must be `H(name ‖ canonical(inputSchema) ‖ descri...",
    "operational_effect": "When this invariant is enforced, the audit-log injection fails at the re-fetch boundary: the agent computes `H(description_old) ≠ H(description_new)`, raises a contract-drift condition, and either re-plans (safe) or halts (safe). The plan's write-set remains authoritative because the description text that justified the plan is pinned in the checkpoint and ve..."
  },
  "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": "604b5a3324e30918c5e13c829e1bac8514497f08187e373912f0ea7ee226d8c7",
    "verified_classes": [
      "ContractDriftError",
      "ToolContract"
    ],
    "verified_functions": [
      "verify_contract_unchanged",
      "resume_plan",
      "digest"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ContractDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
