{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-per-tool-consent-enforcement-when-mcp-scope-grants-are-cached-at-the-transport-session-instead-of-the-tool-invocation",
  "title": "Why does an instance lose per-tool consent enforcement when MCP scope grants are cached at the transport session instead of the tool invocation",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP client/server deployments where authorization scopes are negotiated at session initialization (transport handshake) and per-tool consent is enforced by the server against a session-scoped grant set. Does not apply to stateless per-call token validation where each tool invocation carries its own freshly-evaluated capability warrant.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-per-tool-consent-enforcement-when-mcp-scope-grants-are-cached-at-the-transport-session-instead-of-the-tool-invocation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-per-tool-consent-enforcement-when-mcp-scope-grants-are-cached-at-the-transport-session-instead-of-the-tool-invocation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-per-tool-consent-enforcement-when-mcp-scope-grants-are-cached-at-the-transport-session-instead-of-the-tool-invocation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1814,
    "python_slice_tokens": 280,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent called a tool it shouldn't have.\" It is subtler: the agent called a tool it *was* authorized for, but the server evaluated consent against a **stale session-level scope snapshot** rather than the **per-invocation consent state** that the human or policy layer believed was in force. Two distinct authorization planes exist and are...",
    "what_was_observed": "A coding agent connected to an MCP filesystem server. At `initialize`, the client requested scopes `[\"fs:read\", \"fs:write\"]`; the server granted both and cached them on the `SessionContext`. The operator then narrowed policy mid-task: `fs:write` was revoked at the authorization service because the agent had entered a \"review-only\" phase. The revocation propagated to the auth service's backing store within ~200ms. The...",
    "condition_of_validity": "The session-cache optimization is *sound* only under a conjunction of conditions, any one of which breaks it: 1. **Consent is monotonic within a session** — scopes may be granted but never revoked or narrowed mid-session. (Rarely true; operators revoke.) 2. **Session identity is 1:1 with the principal** — no connection pooling, no multiplexing across instanc...",
    "decision_boundary": "The boundary is: *at what granularity is consent revocable, and does the enforcement point sit at or below that granularity?* - If consent is revocable **per session** → session-cache enforcement is correct. - If consent is revocable **per tool invocation** (human approval per call, phase-gated tools, argument-dependent policy) → enforcement MUST occur per i...",
    "operational_effect": "The consequence is a **silent authority drift**: the agent's effective permissions at execution time diverge from the permissions the operator believes are in force, and the divergence is invisible to both the audit log and the agent's own reasoning. The agent does not \"know\" it is over-privileged, because from its perspective the call succeeded legitimately..."
  },
  "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": "414dc0e489ec8a543afef0b6492fad0195b675134ab3fe211d3016923878bce0",
    "verified_classes": [
      "ConsentGranularityViolation",
      "SessionScopeCache"
    ],
    "verified_functions": [
      "dispatch_tool_call",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ConsentGranularityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
