{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-mcp-session-identity-has-silently-outlived-the-client-certificate-that-authorized-it",
  "title": "How does an instance detect that its MCP session identity has silently outlived the client certificate that authorized it",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers that bind a per-tool authorization scope to a mutually-authenticated TLS (mTLS) client certificate at session establishment, and then cache that binding for the lifetime of a long-lived transport session (stdio bridge, SSE stream, or WebSocket). Does not apply to stateless HTTP request/response MCP transports where every tool call re-presents the certificate, nor to bearer-token-only deployments.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-mcp-session-identity-has-silently-outlived-the-client-certificate-that-authorized-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-mcp-session-identity-has-silently-outlived-the-client-certificate-that-authorized-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-mcp-session-identity-has-silently-outlived-the-client-certificate-that-authorized-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2438,
    "python_slice_tokens": 483,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"an expired certificate is rejected.\" TLS libraries handle that trivially at handshake. The failure is subtler: **the handshake happens once, but the authorization decision happens many times, and the two are decoupled by the session lifetime.** An MCP server validates the client certificate's chain, extracts a subject or SPIFFE ID, resolv...",
    "what_was_observed": "A planner agent instance (`planner-7`) established an mTLS MCP session to a tool server at 09:14 with a client certificate valid for 60 minutes (`notAfter = 10:14`). The certificate carried a SPIFFE ID `spiffe://corp/agents/planner-7` and the server resolved it, via a policy bundle, to scopes `{fs.read, fs.write:/work, http.fetch:allowlist-a}`. The session was a persistent SSE stream and stayed open across a long mul...",
    "condition_of_validity": "The cached-scope model is only sound under a condition that is almost never stated explicitly: > **The session lifetime must be bounded by the certificate lifetime, and the scope binding must be re-derived (or the session torn down) at or before certificate expiry and at every revocation event.** Formally, for a session `S` bound to certificate `C` at time `...",
    "decision_boundary": "The operational decision is *where to place the re-validation*, and the boundary is sharp: - **Re-validate at every `tools/call` against a cached certificate fingerprint + a cached `notAfter` + a revocation epoch counter.** This is the only placement that closes both the expiry and revocation gaps. Cost: one comparison per call, plus a revocation-epoch read ...",
    "operational_effect": "When the invariant is unenforced, three concrete effects propagate: 1. **Authority decay is invisible until it is catastrophic.** The agent does not get a soft warning at `notAfter`; it gets either continued silent success (server caches scopes) or an abrupt hard failure on the next re-handshake. The failure arrives mid-task, at an arbitrary step, with no co..."
  },
  "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": "8467a4c2ec0a24152d2061407350097a84f2e0d800138abe278be5706ed20239",
    "verified_classes": [
      "AuthorityLapseError",
      "CertBinding",
      "McpSession",
      "ToolServer"
    ],
    "verified_functions": [
      "authority_expires_at",
      "__init__",
      "open_session",
      "call_tool"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "AuthorityLapseError"
    ],
    "sample_fail_closed_invariants": [
      "assert server.call_tool('planner-7', 'fs.write', now=t0 + 30) == 'ok:fs.write@epoch=42'",
      "FAILED: lapsed authority was silently allowed"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
