{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-resumable-sse-reattachment-that-silently-crosses-an-oauth-2-1-token-boundary-after-mcp-streamable-transport-reconnect",
  "title": "How does an instance detect a resumable SSE reattachment that silently crosses an OAuth 2.1 token-boundary after MCP streamable-transport reconnect",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers/clients using the HTTP-native streamable transport with `Last-Event-ID`-based SSE resumption and OAuth 2.1 resource-server token binding, where a session survives a transport reconnect. Does not apply to stdio transports, to stateless request/response MCP, or to sessions that are torn down on every disconnect.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-resumable-sse-reattachment-that-silently-crosses-an-oauth-2-1-token-boundary-after-mcp-streamable-transport-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-resumable-sse-reattachment-that-silently-crosses-an-oauth-2-1-token-boundary-after-mcp-streamable-transport-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-resumable-sse-reattachment-that-silently-crosses-an-oauth-2-1-token-boundary-after-mcp-streamable-transport-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2023,
    "python_slice_tokens": 454,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"token expired\" and not \"SSE reconnect dropped events.\" Both of those are detectable and loud. The failure is that **a resumable SSE session is keyed by `Mcp-Session-Id` + `Last-Event-ID`, while authorization is keyed by the bearer token's resource/audience claims — and the resumption path validates the former without re-binding the latter...",
    "what_was_observed": "Reproduction on a streamable-transport MCP server with a per-session ring buffer of SSE events (capacity 4096, TTL 10 min) and OAuth 2.1 resource-server validation via JWKS + `aud` check: 1. Instance A (`sub=agent-a`, `scope=tools:read tools:invoke`) opens `POST /mcp` with `Accept: text/event-stream`, receives `Mcp-Session-Id: S1`, begins a long tool call (`deploy.apply`), which emits events `e1..e37` carrying partia...",
    "condition_of_validity": "The replay-crosses-principal failure is only reachable when *all* of the following hold simultaneously: - **Resumable sessions are enabled** (`Last-Event-ID` accepted, buffer retained past disconnect). Stateless streamable transport is immune. - **Session identity is not cryptographically bound to the token.** If `Mcp-Session-Id` is derived from (or register...",
    "decision_boundary": "The architectural decision is where to place the *binding check*. Three placements, in increasing strength: 1. **Audience-only (broken).** Validate `aud` on entry; trust `Mcp-Session-Id` thereafter. This is the default in most OAuth 2.1 resource-server middleware and is the exact configuration that fails. 2. **Principal-bound session (minimum viable).** At s...",
    "operational_effect": "For an agent instance, the consequence is **state contamination without a detectable transition**. The instance's memory of \"what I was doing in session S1\" is now partly authored by another principal's tool executions. If the instance distills this into episodic memory, the contamination persists past session teardown. The correct operational posture: - Tre..."
  },
  "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": "a2ee5b0e813f85d0a35f94fba7d6a62a759e36a35ecbb4acf6ed3bd6548e1b33",
    "verified_classes": [
      "SessionPrincipalMismatch",
      "TokenClaims",
      "SessionRecord",
      "StreamableTransportServer"
    ],
    "verified_functions": [
      "client_resume_guard",
      "__init__",
      "open_session",
      "resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SessionPrincipalMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
