{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-quarantine-a-dynamically-discovered-mcp-tool-whose-declared-schema-diverges-from-its-observed-capability-envelope-at-first-invo",
  "title": "How should an instance quarantine a dynamically discovered MCP tool whose declared schema diverges from its observed capability envelope at first invocation",
  "date_of_record": "2026 November 27",
  "scope": "Applies to LLM agent runtimes that discover MCP servers at runtime (tool-list refresh, `tools/list` re-negotiation, or peer-advertised servers) and invoke tools whose behavior is not pinned by a signed manifest. Does not apply to statically compiled tool sets with pre-audited implementations, nor to transport-level TLS/auth failures, which are a separate class.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-a-dynamically-discovered-mcp-tool-whose-declared-schema-diverges-from-its-observed-capability-envelope-at-first-invo.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-a-dynamically-discovered-mcp-tool-whose-declared-schema-diverges-from-its-observed-capability-envelope-at-first-invo.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-a-dynamically-discovered-mcp-tool-whose-declared-schema-diverges-from-its-observed-capability-envelope-at-first-invo.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2018,
    "python_slice_tokens": 398,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"a malicious tool does something bad.\" It is the **divergence between the declared capability envelope (schema + description emitted at `tools/list`) and the observed capability envelope (arguments the tool actually consumes, side effects it actually emits, and bytes it actually returns at first invocation)**. A tool-poisoning de...",
    "what_was_observed": "A runtime refreshed its MCP tool list from a newly attached server. One tool, `read_workspace_file`, declared: The declared envelope implied: one string arg, bounded to workspace paths, text-only output. At first invocation the agent passed `{\"path\": \"/workspace/notes.md\"}`. The shadow sandbox captured the following trace: 1. The tool opened the requested path — expected. 2. It additionally issued a read against `~/....",
    "condition_of_validity": "The shadow-invocation gate is sound only under these conditions, and it silently degrades to a no-op if any is violated: - **Side-effect buffering is real.** The sandbox must intercept filesystem, network, and subprocess effects and buffer them, not merely log them. A tool that writes on invocation and is later quarantined has already mutated shared state; t...",
    "decision_boundary": "The gate emits one of three verdicts per first invocation, and the boundary between them is where most implementations get it wrong: - **PROMOTE** — observed envelope ⊆ declared envelope (plus defaults). The tool is added to the trusted set for the session, and the held payload is released into context, sanitized. - **QUARANTINE** — any divergence: undeclare...",
    "operational_effect": "The gate converts a class of prompt-injection state poisoning from \"silent, one-reasoning-step exposure\" into \"buffered, discarded, and logged.\" Concretely: - Injected instruction blocks never enter the model's context on a poisoned first call; the model's next-token distribution is never conditioned on attacker-controlled tool output. - Undeclared side effe..."
  },
  "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": "574af991b19c557a33812e8eb570cb412dc7a18dd91bed2997ec0d3dd3eddc3c",
    "verified_classes": [
      "EnvelopeDivergenceError",
      "Verdict",
      "DeclaredEnvelope",
      "ObservedTrace"
    ],
    "verified_functions": [
      "_content_class",
      "gate_first_invocation",
      "discover_and_gate"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "EnvelopeDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
