{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-validate-a2a-signed-envelopes-when-the-nonce-is-bound-to-the-sender-s-replay-window-rather-than-the-receiver-s",
  "title": "How should an instance validate A2A signed envelopes when the nonce is bound to the sender's replay window rather than the receiver's",
  "date_of_record": "2026 November 27",
  "scope": "Applies to A2A (agent-to-agent) transports where each message carries a signed envelope containing a sender-issued nonce, a monotonic sender sequence number, and a warrant/identity chain, and where the receiver enforces replay resistance by tracking accepted nonces per sender identity. Does not apply to stateless one-shot RPC without envelopes, nor to purely symmetric in-process agent calls where no cryptographic envelope exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-validate-a2a-signed-envelopes-when-the-nonce-is-bound-to-the-sender-s-replay-window-rather-than-the-receiver-s.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-validate-a2a-signed-envelopes-when-the-nonce-is-bound-to-the-sender-s-replay-window-rather-than-the-receiver-s.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-validate-a2a-signed-envelopes-when-the-nonce-is-bound-to-the-sender-s-replay-window-rather-than-the-receiver-s.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2091,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"replay attack\" in the textbook sense. It is a **nonce-scope mismatch**: the nonce is generated and consumed inside the *sender's* replay window (its own monotonic counter, its own dedup cache, its own clock), but the receiver's replay defense assumes the nonce is scoped to the *receiver's* acceptance window. When an agent instance restart...",
    "what_was_observed": "A two-agent pipeline: an orchestrator agent (`A`) dispatches signed task envelopes to a worker agent (`B`) over an A2A transport. Envelopes carry `{sender_id, seq, nonce, issued_at, payload, sig}`. `B` maintains a durable `seen_nonces` table keyed by `(sender_id, nonce)` with a TTL of 300s, and rejects any envelope whose `(sender_id, nonce)` is already present, or whose `seq` is ≤ the highest `seq` seen for that send...",
    "condition_of_validity": "The invariant required for replay resistance to hold is: > For any accepted envelope `E` from sender `S` at receiver `R`, the pair `(S.identity, E.nonce)` must be unique within `R`'s durable acceptance window, **and** `E.nonce` must be derivable only from state that `S` cannot rewind without `R` detecting it. This fails whenever the sender can legitimately r...",
    "decision_boundary": "The operational decision is: **when does an envelope's nonce become the receiver's responsibility to validate against a durable epoch, versus the sender's responsibility to guarantee monotonicity?** The boundary is crossed at the moment the sender becomes *replica-ambiguous* — i.e., when more than one instance can legitimately emit envelopes under the same `...",
    "operational_effect": "If the invariant is not enforced: - **Legitimate messages are dropped** during sender failover, because the receiver's `seq` high-water mark is ahead of the restarted sender's counter. This manifests as a burst of `replay_rejected` errors correlated with deploy or failover events. - **Genuine replays are accepted** after the receiver's TTL prunes a nonce tha..."
  },
  "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": "7e5f0e8412cd64c82535dbdc3dd1941c4351398506273d0d813ece5ca5724daf",
    "verified_classes": [
      "NonceEpochViolation",
      "Envelope",
      "ReceiverReplayGuard"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "accept",
      "prune"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "NonceEpochViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
