{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-a-replayed-a2a-handshake-when-ephemeral-task-keys-collide-across-resumed-checkpoints",
  "title": "How should an instance detect a replayed A2A handshake when ephemeral task keys collide across resumed checkpoints",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent-to-agent (A2A) channels where each task mints a short-lived keypair, nonces are tracked in a per-instance replay window, and tasks can be checkpointed and resumed on a different instance. Does not apply to long-lived mutual-TLS identities or to stateless request/response tool calls with no per-task key material.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-replayed-a2a-handshake-when-ephemeral-task-keys-collide-across-resumed-checkpoints.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-replayed-a2a-handshake-when-ephemeral-task-keys-collide-across-resumed-checkpoints.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-replayed-a2a-handshake-when-ephemeral-task-keys-collide-across-resumed-checkpoints.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1853,
    "python_slice_tokens": 402,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two orthogonal things an A2A handshake is trying to guarantee, and teams routinely conflate them: 1. **Freshness** — this handshake was created after the last one I accepted from this peer. 2. **Uniqueness of key material** — the ephemeral public key presented in this handshake has never been used in any accepted handshake before. Standard replay p...",
    "what_was_observed": "A three-instance swarm (`planner`, `executor`, `auditor`) used per-task X25519 ephemeral keys. Key derivation was `HKDF(task_seed, info=handshake_counter)`, where `task_seed` was written to the checkpoint store so a resumed executor could continue. The replay window was a per-instance LRU of `(peer_id, nonce)` with a 10-minute TTL, plus a nonce counter. Trace: - `executor@A` begins task T, derives key `K1 = HKDF(seed...",
    "condition_of_validity": "The nonce-only replay window is valid if and only if the following holds: - Ephemeral private keys are generated from a CSPRNG at handshake time and are *never* persisted, *never* derived from checkpointed seeds, and *never* regenerated on resume. A resumed task must mint a *new* key, not re-derive the old one. - The checkpoint's \"handshake committed\" flag i...",
    "decision_boundary": "The decision the accepting instance must make on every `ClientHello` is a two-axis check, not a one-axis check: - **Axis 1 (freshness):** `nonce ∉ window[peer_id]`. Reject with `ReplayWindowViolation` if present. - **Axis 2 (key novelty):** `eph_pub ∉ accepted_keys[peer_id, task_lineage_id]`. Reject with `EphemeralKeyReuseError` if present, *unless* the pres...",
    "operational_effect": "With the two-axis check plus supersession warrants: - Resumed tasks either mint a genuinely new key (preferred, and enforced by refusing to persist private key material in checkpoints) or present a warrant that lets the accepting peer retire the stale session deterministically. - The auditor's replay check and the planner's session table converge on the same..."
  },
  "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": "bb96975b025ea9dd8a0c338f8735ade3a4834472de5b8f8f407512ca9fe8facc",
    "verified_classes": [
      "EphemeralKeyReuseError",
      "ReplayWindowViolation",
      "SupersessionWarrant",
      "HandshakeState"
    ],
    "verified_functions": [
      "_verify_warrant",
      "accept_client_hello"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "EphemeralKeyReuseError",
      "ReplayWindowViolation"
    ],
    "sample_fail_closed_invariants": [
      "warrant does not cover the presented nonce/eph_pub pair"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
