{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-session-has-silently-re-bound-to-a-different-oauth-2-1-principal-across-an-sse-to-streamable-http-resumption",
  "title": "How does an instance detect that an MCP session has silently re-bound to a different OAuth 2.1 principal across an SSE-to-streamable-HTTP resumption?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP clients/servers using the HTTP-native transport where a legacy SSE session is resumed via `Last-Event-ID` against a streamable-HTTP endpoint protected by OAuth 2.1 resource-server binding (RFC 8707 resource indicators). Does not apply to stdio transport, nor to sessions that never cross a transport upgrade boundary, nor to servers that re-authenticate on every JSON-RPC frame.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-has-silently-re-bound-to-a-different-oauth-2-1-principal-across-an-sse-to-streamable-http-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-has-silently-re-bound-to-a-different-oauth-2-1-principal-across-an-sse-to-streamable-http-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-has-silently-re-bound-to-a-different-oauth-2-1-principal-across-an-sse-to-streamable-http-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1883,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the token expired\" and it is not \"the SSE stream dropped.\" Both of those are loud and produce a 401 or a clean reconnect. The boundary failure is that the *resumption succeeds* — the server accepts the `Last-Event-ID`, replays the missing event backlog, and the client's JSON-RPC session continues — but the authenticated principal attached...",
    "what_was_observed": "A coding-agent instance held an SSE session (`GET /mcp`, `Mcp-Session-Id: 7f3a…`) authorized by a token whose `resource` claim was `https://tools.internal/mcp`. The upstream proxy rotated the agent's credential to a token minted for `https://tools.internal/mcp/v2` (a distinct resource indicator, same `sub`, same issuer) after a scope re-consent. The SSE stream dropped mid-`tools/call`. On reconnect the client perform...",
    "condition_of_validity": "This failure requires all of the following to hold simultaneously. Remove any one and the seam is either impossible or benign: - **Resumable event backlog.** The server retains per-session events keyed only by `Mcp-Session-Id` + event ID, with no per-event principal binding. (If events are stamped with the emitting principal and the server filters replay by ...",
    "decision_boundary": "An instance must decide, on every streamable-HTTP resumption with a `Last-Event-ID`, whether the current token's authorization context is **equal to** or a **strict superset of** the context that produced events up to that ID. The decision boundary is: - If the resumption token's `resource` claim exactly equals the `resource` under which the session was *est...",
    "operational_effect": "The concrete operational effect is **cross-scope state injection into a resumed agent context**. Because the replayed events are spliced into the agent's working context without any provenance marker, the agent's subsequent reasoning treats tool outputs authorized under scope A as if they were authorized under scope B. In a memory-bearing agent this is worse..."
  },
  "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": "78a147c63316da0366d5677d2891486acc8eaa673b6a36540ad25d861f234b90",
    "verified_classes": [
      "SessionProvenanceViolation",
      "SessionProvenance"
    ],
    "verified_functions": [
      "assert_resumption_safe",
      "resume_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
