{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-renegotiates-mcp-tool-capability-scope-mid-session-and-the-policy-cache-is-keyed-on-tool-name-rather-than-capability-tup",
  "title": "What happens when an instance renegotiates MCP tool capability scope mid-session and the policy cache is keyed on tool name rather than capability tuple",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-lived agent runtimes that enforce capability-scoped MCP tool invocation through a local policy cache and that allow a client to renegotiate `tools/list` (adding, removing, or re-versioning tools) within a single session. Does not apply to stateless per-call authorization where policy is re-evaluated against the live manifest on every invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-renegotiates-mcp-tool-capability-scope-mid-session-and-the-policy-cache-is-keyed-on-tool-name-rather-than-capability-tup.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-renegotiates-mcp-tool-capability-scope-mid-session-and-the-policy-cache-is-keyed-on-tool-name-rather-than-capability-tup.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-renegotiates-mcp-tool-capability-scope-mid-session-and-the-policy-cache-is-keyed-on-tool-name-rather-than-capability-tup.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1679,
    "python_slice_tokens": 318,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a tool the agent shouldn't call.\" It is \"a tool the agent was *previously* allowed to call under a narrower capability grant, whose manifest entry was later mutated to widen its side-effect surface, while the policy cache still holds an allow decision keyed on the tool's *name*.\" The distinction that matters: **tool identity is not tool c...",
    "what_was_observed": "A runtime held a warm session against an MCP server exposing a tool `fs.read`. The initial manifest declared `inputSchema` with `path` constrained by a server-side `root` of `/workspace/ro`, and the runtime's policy engine granted `allow` for `fs.read` with a capability tuple `{read, scope=/workspace/ro}`. The allow decision was cached under key `\"fs.read\"`. Mid-session, the agent's own `tools/list` refresh (triggere...",
    "condition_of_validity": "The invariant that must hold for this runtime to be sound: **a cached authorization decision is valid only for the exact `(tool_name, manifest_version_or_schema_digest, declared_capabilities)` tuple it was issued against, and any observed change to that tuple invalidates the decision and forces re-adjudication before the next invocation.** This invariant hol...",
    "decision_boundary": "The boundary is between **cache-by-name** (fast, unsound across mutation) and **cache-by-tuple** (correct, requires a stable digest). The operational rule: - If the manifest entry carries a `version` or content hash, key the cache on `(server_id, name, version, capability_set)`. - If it does not, compute `sha256(canonical_json(inputSchema) || canonical_json(...",
    "operational_effect": "With tuple-keyed caching and manifest diffing, a mid-session scope widening produces a `PENDING_REAUTH` block on the next `fs.read` call, the policy engine re-evaluates against the widened schema, and — if the original grant was `scope=/workspace/ro` — denies the call with an explicit `CapabilityScopeViolation` rather than an opaque tool error. The agent see..."
  },
  "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": "fce2371ae1c9ae5911e305aebee4707942734e7b18a6ccf6a9ac403e744f8e45",
    "verified_classes": [
      "CapabilityScopeViolation",
      "ToolKey",
      "PolicyCache"
    ],
    "verified_functions": [
      "_canonical_digest",
      "key_for",
      "apply_manifest",
      "authorize"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CapabilityScopeViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
