{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-taints-a-dynamically-discovered-mcp-tool-after-the-permission-cache-has-already-been-warmed",
  "title": "What happens when an instance taints a dynamically discovered MCP tool after the permission cache has already been warmed",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agents that discover MCP tools at runtime (via `tools/list` or equivalent) and enforce least-privilege via a taint-tracking permission cache keyed by tool identity. Does not apply to statically registered tool manifests loaded once at process start, nor to per-call re-evaluation schemes that never cache.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-dynamically-discovered-mcp-tool-after-the-permission-cache-has-already-been-warmed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-dynamically-discovered-mcp-tool-after-the-permission-cache-has-already-been-warmed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-dynamically-discovered-mcp-tool-after-the-permission-cache-has-already-been-warmed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1601,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a tool is discovered that is more privileged than expected.\" It is the divergence between the **identity** used to key the permission cache and the **identity** used to apply taint. Dynamically discovered MCP tools are identified by a composite of server endpoint, declared tool name, and an optional schema hash. Taint analysis, howev...",
    "what_was_observed": "A tool server `fs-helper` exposes `read_file`. On first discovery the agent calls `tools/list`, receives the schema, computes `schema_hash = sha256(canonical_json(inputSchema))`, and caches `allow(read_file, fs-helper, h1) = {taint_clear: true, max_privilege: read}`. The tool is then invoked with arguments whose provenance is a value returned by a *different* server, `web-fetch`. Taint tracking marks the argument `ta...",
    "condition_of_validity": "The least-privilege guarantee holds only under the conjunction: 1. The permission cache key includes every identity component the taint engine may attribute to a call — at minimum `(server_endpoint, tool_name, schema_hash, server_instance_nonce)`. 2. Cache invalidation is triggered by any change to any key component, including reconnection (nonce change) and...",
    "decision_boundary": "The boundary is crossed at the moment of **cache warm followed by identity drift**. Below the boundary — fresh discovery, cold cache, no reconnect — taint and permission agree because both key on the same live identity. Above the boundary — warm cache, nonce or schema change, taint present — they diverge. The decision an operator must make is whether to pay ...",
    "operational_effect": "After adopting full-key caching with nonce-based invalidation, the audit log's `taint_clear` and the provenance record's taint set agree on every call. The cost is a measurable cache-hit reduction on reconnect-heavy workloads — roughly one cache miss per server instance lifetime per tool, which in the observed workload was 3–7% of calls. The benefit is that ..."
  },
  "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": "f926aa2f34b29c170fcad6e59492f7bcd75911c062017aa09ee56756bfc0991c",
    "verified_classes": [
      "TaintCacheDivergence",
      "ToolIdentity",
      "PermissionCache"
    ],
    "verified_functions": [
      "authorize",
      "handle_reconnect",
      "from_declaration",
      "__init__",
      "put",
      "get"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintCacheDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
