{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-capability-token-replay-across-did-authenticated-agent-handoffs",
  "title": "Which invariants prevent capability-token replay across DID-authenticated agent handoffs",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent-to-agent (A2A) handoffs where the receiving agent authenticates the caller via a Decentralized Identifier (DID) document and authorizes the action via a signed capability token (e.g., a UCAN-style chain or a Macaroon). Does not cover human-in-the-loop OAuth flows, nor single-agent tool calls where the tool is co-located and stateless.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-token-replay-across-did-authenticated-agent-handoffs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-token-replay-across-did-authenticated-agent-handoffs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-token-replay-across-did-authenticated-agent-handoffs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1633,
    "python_slice_tokens": 159,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a token was stolen.\" It is that **DID authentication and capability authorization are verified against two different clocks and two different subjects, and neither check binds the token to the specific execution instance that will spend it.** A DID proves *who signed the request envelope now*. A capability token proves *what the bearer wa...",
    "what_was_observed": "A three-agent pipeline: Planner → Executor → Auditor. The Planner issued a capability token `cap:exec:write:bucket-7` to the Executor, scoped to `aud = did:key:z6Mk...Executor`, with an expiry of 300s and no nonce. The Executor completed its task, then a retry was triggered by an upstream timeout. The Executor's supervisor spawned a *fresh* Executor instance (`Executor'`) with the same DID document but a new process,...",
    "condition_of_validity": "The two-step check (DID proof-of-possession + capability scope/expiry) is sound **only if** the capability token is *non-transferable across execution instances*, which requires one of: - a `jti`/nonce claim plus a replay cache at the verifier keyed by `(jti, aud)`, with cache TTL ≥ token `exp`; or - a `cnf` (confirmation) claim binding the token to a specif...",
    "decision_boundary": "The boundary is crossed at the moment a task envelope containing a capability token is **persisted and later re-presented**, rather than spent inline within a single execution context. Concretely: - **Safe side:** token minted, presented, and consumed within one process lifetime; verifier's replay cache is authoritative; no serialization of the token across ...",
    "operational_effect": "When this invariant is violated, the observable signature is **duplicate side effects with clean audit logs**: every individual verification step shows `valid`, the signatures all check, the DIDs all resolve, and yet the effect applied twice. This is the worst class of failure for post-hoc forensics, because the logs contain no error — the corruption is in t..."
  },
  "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": "69fc183264f5cd85bb6894bff8fba050b27f2a2305d618882532e16380e8c261",
    "verified_classes": [
      "CapabilityReplayError"
    ],
    "verified_functions": [
      "verify_capability"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CapabilityReplayError"
    ],
    "sample_fail_closed_invariants": [
      "scope or expiry check failed"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
