{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-reattachment-as-an-authorization-event-not-a-transport-reconnect",
  "title": "In what scenarios must an instance treat MCP Streamable HTTP session reattachment as an authorization event, not a transport reconnect",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers exposing Streamable HTTP transport with `Last-Event-ID` resumption over SSE, where per-request bearer/DPoP authorization is evaluated independently of session identity. Does not apply to stdio transport, or to deployments where the session cookie is the sole authorization artifact.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-reattachment-as-an-authorization-event-not-a-transport-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-reattachment-as-an-authorization-event-not-a-transport-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-reattachment-as-an-authorization-event-not-a-transport-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1760,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP Streamable HTTP transport defines two orthogonal axes: a *session* (identified by `Mcp-Session-Id`, established at `initialize`, used to route to a server-side state machine) and a *request authorization context* (the credential presented on each HTTP request, evaluated per-call). The spec is explicit that the session ID is a routing token, not an au...",
    "what_was_observed": "A multi-tenant MCP deployment fronted an internal `filesystem` and `shell` tool server. Sessions were keyed in Redis by `Mcp-Session-Id`; the SSE event log was an append-only list per session, capped at 4096 events with `Last-Event-ID` monotonic integers. Authorization was a per-request JWT check against a tool-scope map — correct in isolation. Trigger sequence observed in production logs: 1. Agent A (principal `svc-...",
    "condition_of_validity": "The invariant that must hold: **the authorization context under which an SSE event was enqueued is part of the event's identity, and reattachment must re-authorize the buffer, not just the connection.** Concretely, reattachment is safe only if all of the following hold: - Each buffered event carries the principal and scope set that was active when it was pro...",
    "decision_boundary": "The boundary is drawn between two failure modes that look identical at the socket but require opposite remediations: - **Stale-credential resume (must truncate):** same principal, downgraded scope. The correct action is to replay up to the last event the new scope permits, emit a `resume_truncated` control event with the last delivered `id`, and require the ...",
    "operational_effect": "Without the invariant, the observable effect is *silent partial-context corruption*: the resuming agent receives a truncated or foreign event stream, applies it to its local tool-result buffer, and proceeds with reasoning grounded in output it was never authorized to see or in a gap it never detected. In the observed incident, Agent A's directory-walk state ..."
  },
  "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": "4a498a9bf210f54b6851f2597cdad0d6897708cf181edbd140aef524a4115270",
    "verified_classes": [
      "ResumeAuthorizationError",
      "AuthzEpoch",
      "BufferedEvent",
      "Session"
    ],
    "verified_functions": [
      "resume_stream",
      "test_downgraded_scope_truncates"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumeAuthorizationError"
    ],
    "sample_fail_closed_invariants": [
      "assert out[-1].required_scope == '__resume_truncated__'",
      "assert out[-1].payload == 'truncated_at=118'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
