{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-scope-bleed-when-an-http-native-mcp-server-multiplexes-concurrent-requests-over-a-shared-session",
  "title": "How does an instance detect scope bleed when an HTTP-native MCP server multiplexes concurrent requests over a shared session",
  "date_of_record": "2026 December 2",
  "scope": "Applies to HTTP-native MCP servers that multiplex multiple tool-call requests over a single persistent transport (SSE stream, session-bound connection pool, or streamable-HTTP session) while carrying per-request authorization scopes. Does not apply to stdio MCP servers with one client per process, nor to stateless per-request HTTP where each call renegotiates its own auth context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-bleed-when-an-http-native-mcp-server-multiplexes-concurrent-requests-over-a-shared-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-bleed-when-an-http-native-mcp-server-multiplexes-concurrent-requests-over-a-shared-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-scope-bleed-when-an-http-native-mcp-server-multiplexes-concurrent-requests-over-a-shared-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1884,
    "python_slice_tokens": 314,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an HTTP-native MCP server can carry authorization: **transport-scoped** and **request-scoped**. Transport-scoped auth binds a scope to the session at handshake (`initialize` → `Mcp-Session-Id`), and every subsequent `tools/call` on that session inherits it. Request-scoped auth re-reads the bearer token, capability claim, or delegation warr...",
    "what_was_observed": "A three-agent pipeline (planner, executor, auditor) shared one MCP session to a filesystem + database server. The server's `initialize` handler populated a `SessionContext` with the caller's scopes; the `tools/call` handler read `ctx.scope` off that session object rather than re-deriving it from the per-message `Authorization` header. The header *was* present and *was* validated — but the validated scope was written ...",
    "condition_of_validity": "The invariant that must hold is: **for any `tools/call` message `m` on session `S`, the scope used to authorize every resource access within `m`'s execution is a pure function of `m`'s own credentials, not of `S`.** This invariant is violated whenever three conditions co-occur: - **Session reuse across principals.** Two or more distinct authorization identit...",
    "decision_boundary": "An instance must decide, per `tools/call`, whether to trust the session's cached scope or re-derive scope from the message. The correct decision boundary is: - **Re-derive, always, when the message carries its own credential.** If `params._meta.authorization` or the transport header presents a token, that token's scope is authoritative for this call. The ses...",
    "operational_effect": "Consequences of undetected bleed, in order of severity: 1. **Privilege escalation across principals.** A low-privilege agent's call executes with a co-tenant's higher privileges. This is a security boundary failure, not a correctness bug, and it will not appear in functional tests because the tool *works*. 2. **Orphaned side effects.** Writes that commit bef..."
  },
  "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": "f6a339a6c4afcbd36c3ac06a9338325c8124b923dd56fc202846e9a4b1566ca5",
    "verified_classes": [
      "ScopeBleedError",
      "CallScope",
      "SessionContext"
    ],
    "verified_functions": [
      "authorize",
      "handle_tool_call",
      "__init__",
      "store_scope",
      "peek_scope"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ScopeBleedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "threading",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
