{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-derive-consent-at-the-tool-boundary-rather-than-trust-the-session-scoped-grant-in-mcp-over-http-native-transport",
  "title": "When must an instance re-derive consent at the tool boundary rather than trust the session-scoped grant in MCP over HTTP-native transport",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP servers exposing per-tool authorization scopes to LLM-driven clients over streamable HTTP transport (single or multi-request sessions, resumable via session ID). Does not apply to stdio transport, where the process lifetime is the authorization lifetime, nor to servers that enforce authorization solely at connection establishment.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-consent-at-the-tool-boundary-rather-than-trust-the-session-scoped-grant-in-mcp-over-http-native-transport.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-consent-at-the-tool-boundary-rather-than-trust-the-session-scoped-grant-in-mcp-over-http-native-transport.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-consent-at-the-tool-boundary-rather-than-trust-the-session-scoped-grant-in-mcp-over-http-native-transport.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2208,
    "python_slice_tokens": 452,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two places an MCP server can enforce per-tool consent: at *session establishment* (the `initialize` handshake, where the client presents a token bearing a scope set, and the server materializes a session object holding those scopes) and at *tool invocation* (the `tools/call` request, where the specific tool's required scope is checked against a liv...",
    "what_was_observed": "A server implemented per-tool scopes as follows: on `initialize`, it parsed the bearer token's `scope` claim, stored the scope set on the session record keyed by the returned `Mcp-Session-Id`, and each `tools/call` handler consulted `session.scopes` before dispatching to the tool. Tool definitions each declared a `required_scope` (e.g., `files:read`, `files:write`, `shell:exec`). The failure trace, reproduced against...",
    "condition_of_validity": "The session-cached-scope optimization is valid **only** under the conjunction: - (a) the authorization token is immutable for the session's lifetime, AND - (b) the session is bound 1:1 to a single principal for its lifetime, AND - (c) no external revocation can occur that the server does not observe synchronously, AND - (d) session resumption never crosses a...",
    "decision_boundary": "The boundary is drawn at the tool dispatch point, and it is a hard gate, not a soft check: - If `Authorization` is absent on a `tools/call` → reject `401`, do not fall back to session scopes. - If the token's principal does not match the session's bound principal → reject `403` with a distinct `principal_mismatch` reason (this is escalation, treat as a secur...",
    "operational_effect": "Enforcing re-derivation per call has measurable costs and necessary compensations: - **Latency:** token validation (signature + revocation lookup) moves onto the hot path of every tool call. Mitigate with short-TTL validation caches *keyed by token hash*, not by session — a revoked token's cache entry must be invalidatable, so the cache TTL bounds the revoca..."
  },
  "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": "84742a87220ea5edb879b98c39aaf853d382ec995dc5b9952c026343c4b9c10e",
    "verified_classes": [
      "ConsentBoundaryError",
      "Token",
      "Session",
      "ToolSpec",
      "McpServer"
    ],
    "verified_functions": [
      "__init__",
      "initialize",
      "tools_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 8,
    "raised_exceptions": [
      "ConsentBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "assert srv.tools_call(sess.session_id, 'shell', broad) == 'executed shell as agent-a'",
      "cannot initialize with revoked token",
      "missing Authorization on tools/call"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
