{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scope-attenuation-replay-across-mcp-capability-token-boundaries",
  "title": "Which invariants prevent scope-attenuation replay across MCP capability-token boundaries",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP (Model Context Protocol) tool-call sandboxing where an orchestrating agent mints or forwards capability tokens carrying attenuated least-privilege scopes to sub-agents or nested tool servers. Does not cover single-hop tool calls under a single static credential, nor does it cover transport-layer TLS/mTLS failures.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-attenuation-replay-across-mcp-capability-token-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-attenuation-replay-across-mcp-capability-token-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scope-attenuation-replay-across-mcp-capability-token-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2146,
    "python_slice_tokens": 461,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an MCP capability token can be \"attenuated,\" and they fail differently. *Structural attenuation* narrows the scope set at issuance time — the child token's scope set is a strict subset of the parent's, and the narrowing is baked into the signed claims. *Behavioral attenuation* narrows scope by policy at the enforcement point — the sandbox ...",
    "what_was_observed": "An orchestrator agent (`A0`) held a capability token `T0` with scopes `{fs:read:/sandbox, net:fetch:api.internal}`. It spawned a sub-agent `A1` to run a data-extraction tool, minting `T1` with attenuated scopes `{fs:read:/sandbox/inputs}` — a strict subset of `T0`, correctly signed, correctly chained (`parent_id = T0`). `A1` ran for several turns, then `A0`'s own task phase ended and the orchestrator **retired `T0`**...",
    "condition_of_validity": "The set-subset check at mint time is a *necessary* but not *sufficient* condition for least-privilege. It is sufficient only under the conjunction of three conditions, any one of which, if dropped, reopens the replay: 1. **TTL monotonicity under derivation.** Every derived token's expiry must satisfy `child.expiry <= parent.expiry`, and re-mints must not res...",
    "decision_boundary": "The boundary is between two enforcement architectures, and the choice is not free: - **Stateless verification** (signature + expiry only). O(1), no token-service round trip, horizontally scalable. Admits replay across revocation and across TTL-laundering re-mints. Correct only when tokens are never revoked before expiry and derivation never resets TTL — i.e....",
    "operational_effect": "The practical consequence is that a sub-agent's effective capability lifetime is `min` over its entire ancestor chain of `(expiry - now)` and *zero* the moment any ancestor is revoked — and any architecture that computes this as \"the presented token's expiry\" will over-grant. In the observed run, the over-grant was 40 minutes of file reads after orchestrator..."
  },
  "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": "27b779cab66a3b1010db470edf2a0a29c6d950df8251d219259ab7b94df33c3d",
    "verified_classes": [
      "CapabilityReplayError",
      "CapabilityToken",
      "TokenService",
      "McpSandbox"
    ],
    "verified_functions": [
      "demo",
      "__init__",
      "mint",
      "revoke",
      "ancestry_is_live",
      "__init__",
      "admit"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "CapabilityReplayError"
    ],
    "sample_fail_closed_invariants": [
      "assert t1.expiry == 60.0",
      "ancestry walk failed to catch revoked root"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
