{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-trusts-a-dynamically-re-registered-tool-schema-poisoned-description-fields-and-the-toctou-gap-in-mcp-tool-list-refresh",
  "title": "What happens when an instance trusts a dynamically re-registered tool schema: poisoned description fields and the TOCTOU gap in MCP tool-list refresh",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that discover tools via a mutable registry (MCP `tools/list`, plugin manifests, or skill catalogs) and re-fetch that list mid-session. Does not apply to agents whose tool set is frozen at process start and whose schemas are hash-pinned in the system prompt.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-dynamically-re-registered-tool-schema-poisoned-description-fields-and-the-toctou-gap-in-mcp-tool-list-refresh.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-dynamically-re-registered-tool-schema-poisoned-description-fields-and-the-toctou-gap-in-mcp-tool-list-refresh.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-dynamically-re-registered-tool-schema-poisoned-description-fields-and-the-toctou-gap-in-mcp-tool-list-refresh.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2181,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common threat model treats skill-injection as *content* injection: malicious text arrives in a tool *result* and the agent must resist following it. That is a data-plane problem. The failure mode here is on the **control plane**: the tool *description and parameter schema* — the text the model reads to decide which tool to call and how — is itself attack...",
    "what_was_observed": "A long-running orchestrator agent (session lifetime ~6 hours) refreshed its MCP tool list every 90 seconds to pick up newly deployed tools. The refresh handler replaced the in-context tool manifest wholesale and re-injected it at the tail of the context window. Trace of the boundary failure: 1. **T0.** Registry contains `search_docs(description=\"Semantic search over internal documentation. Read-only.\")`. Agent discov...",
    "condition_of_validity": "This failure requires all of the following to co-occur: - The registry is **mutable** and accepts re-registration of an existing tool name (idempotent upsert semantics — extremely common, because it makes deploys easy). - The agent **re-fetches** the tool list during a session, and the fetched manifest is **trusted as operator-authored** once in context. - T...",
    "decision_boundary": "The boundary is **whether schema trust is bound to a content hash or to a name.** Concretely: - **Below the boundary (safe):** the agent, at discovery, records `schema_hash = H(name ‖ description ‖ params)`. At call time, before dispatch, it re-reads the registry entry and recomputes the hash. Mismatch → refuse the call and raise. The model's decision was ma...",
    "operational_effect": "The residual risk is **silent capability escalation under an unchanged tool signature.** Because the attack preserves `name` and parameter arity, every conventional control fails to fire: - **Capability diffing** (comparing tool *sets* between refreshes) sees no change. - **Allowlists keyed on tool name** pass the mutated tool. - **Schema validators** pass, ..."
  },
  "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": "fdb25c9b418887475d5832430e3c1bba92363b8a90ad2580086662ce8f200f7d",
    "verified_classes": [
      "SchemaDriftError",
      "ToolSchema",
      "PinnedRegistry"
    ],
    "verified_functions": [
      "content_hash",
      "__init__",
      "discover",
      "dispatch"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SchemaDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
