What structural signals indicate a capability-token replay hazard when A2A task delegation crosses an MCP tool boundary
**Date of Record:** 2026 December 1 **Scope:** Applies to fuzzing and differential conformance testing of agent-to-agent (A2A) delegations where the receiving agent fulfills the task by invoking MCP tools. Does not cover single-agent MCP tool-use without an A2A delegation envelope, nor A2A streaming-only transports without tool invocation.
Core Distinction
The failure that matters here is not a schema mismatch and not an outright malformed message. It is a *semantic conformance gap* between two protocol specs that are each individually valid: A2A treats `contextId` and `task.id` as replay-scoped identifiers the receiving agent must honor for idempotency, while MCP treats `request.id` (JSON-RPC) as a per-connection correlation token with no cross-connection meaning. When an A2A task is retried or re-delegated, the receiving agent re-issues the same MCP tool call under a *fresh* JSON-RPC `request.id`. The MCP server has no memory of the first call's A2A `task.id`, so a non-idempotent tool (a write, a charge, a state mutation) executes twice. Differential fuzzing surfaces this as a *divergence in side-effect count* between a reference implementation and a candidate implementation, not as any protocol-level error. The structural signal is a tool invocation whose side effect is observable but whose MCP request identifier has no lineage back to the A2A task identifier that authorized it.
What Was Observed
During a differential conformance run, a fuzz corpus of A2A `tasks/send` envelopes was replayed against two receiver implementations (reference `R`, candidate `C`) that both fronted the same MCP tool server. The corpus included retried envelopes where the same `task.id` and `contextId` appeared with a byte-identical payload but a re-issued client-side `messageId`. Payloads were valid under both A2A and MCP schemas.
For every envelope, the harness recorded: (a) whether the receiver returned a terminal A2A `TaskState` of `completed`, (b) the count of MCP `tools/call` JSON-RPC requests emitted, and (c) the count of observable side effects at the tool server (a monotonic counter the test tool incremented).
Reference implementation `R`: `completed` returned once, 1 `tools/call` emitted, side-effect counter +1. On the retried envelope, `R` short-circuited on `task.id` and emitted 0 additional calls; counter stayed at +1.
Candidate implementation `C`: `completed` returned on both the original and the retried envelope, 2 `tools/call` requests emitted with *different* JSON-RPC `request.id` values (e.g. `"7"` then `"8"` on the same connection), and the side-effect counter reached +2. No error was raised at any layer. `C`'s A2A handler passed the task payload to its MCP client adapter, which serialized a fresh JSON-RPC envelope with no `task.id` field — the A2A identifier was simply dropped at the adapter boundary.
The divergence only appeared in the *retry* slice of the corpus. A naive conformance harness that scored only first-attempt responses marked `C` as conformant. The signal that exposed the gap was the *side-effect counter delta across a replay*, which is not part of either protocol's response schema and had to be instrumented out-of-band.
A second observed signal: when the harness injected a `task.id` collision (two distinct A2A tasks, different `contextId`, same `task.id` string) into `R`, `R` rejected the second with an A2A error because it keyed its idempotency store on `task.id` alone. `C` accepted both and executed both. So the two implementations disagreed not only on replay *deduplication* but on the *scope* of the idempotency key — `R` used `task.id`, a correct implementation would use `(contextId, task.id)`, and `C` used nothing. Three behaviors, one corpus, all "valid" at the message layer.
Condition of Validity
The replay hazard is present iff all of the following hold, and absent otherwise:
- The A2A delegation is retriable at the transport or orchestrator layer — i.e., a timeout, a `503`, or an explicit orchestrator retry can re-deliver the same `task.id`.
- The receiving agent fulfills the task by calling an MCP tool whose effect is non-idempotent (increment, append, create, charge).
- The A2A→MCP adapter does not propagate the A2A `task.id`/`contextId` into the MCP request as a deduplication key (MCP has no native field for this; it must be carried in `params._meta` or an equivalent extension).
- The MCP server does not itself deduplicate on any stable key.
If the tool is idempotent (a read, a set-to-value), the hazard collapses to wasted work, not corruption. If the adapter propagates `task.id` into `params._meta` and the server honors it, the hazard is bounded. The dangerous middle — adapter drops the key, server has no dedup — is the common default because *neither spec requires the propagation*. This is the invariant: **an A2A task identifier is not, by itself, a deduplication guarantee at the MCP layer; the guarantee exists only if some component in the chain explicitly carries and enforces it.**
Decision Boundary
The boundary between "safe to retry" and "replay hazard" is not a property of either protocol alone but of the *composition*. Concretely:
- A fuzz harness MUST NOT score conformance on first-attempt response alone. It must replay each envelope and compare out-of-band side-effect counters. A receiver that returns identical responses on replay but doubles the side effect is non-conformant even though its wire behavior is indistinguishable.
- Differential testing MUST include a `task.id` collision slice (same `task.id`, different `contextId`) and a `contextId` collision slice (same `contextId`, different `task.id`) to expose the idempotency-key *scope*, which differs silently across implementations.
- An implementation is conformant on replay iff, for any envelope re-delivered with the same `(contextId, task.id)`, the observable side-effect count does not increase and the returned terminal state is identical. This is the acceptance predicate, and it is strictly stronger than response equality.
- If the tool is non-idempotent and the adapter cannot carry a dedup key, the correct behavior is to *fail closed* on replay detection rather than re-execute — but replay detection requires the key the adapter just dropped, so the only safe move is to refuse the delegation at the adapter when the key cannot be propagated.
Operational Effect
The practical consequence is that A2A↔MCP conformance cannot be established by schema validation or by response-diffing. It requires side-effect instrumentation and a replay-aware corpus. Teams that fuzz only the message layer will certify receivers that double-charge, double-append, or double-create under ordinary orchestrator retries, because every message on the wire is valid. The guardrail is architectural: the A2A `task.id` and `contextId` must be threaded into the MCP request as an explicit deduplication key (e.g. `params._meta["a2a.task_id"]`), and the tool server must enforce it. The conformance harness must assert on the counter, not the response. The following harness encodes the acceptance predicate and raises on the exact divergence observed.
class ReplayDivergenceError(RuntimeError):
"""A2A->MCP replay produced a side effect that the first attempt did not."""
def assert_replay_idempotent(receiver, envelope, side_effect_probe):
"""
Replay an A2A envelope and require that the observable side-effect count
does not increase on re-delivery under the same (contextId, task.id).
side_effect_probe: callable returning the current monotonic counter
at the MCP tool server.
"""
key = (envelope["contextId"], envelope["task"]["id"])
before_first = side_effect_probe()
first = receiver.send(envelope)
after_first = side_effect_probe()
before_replay = side_effect_probe()
replay = receiver.send(envelope) # byte-identical re-delivery
after_replay = side_effect_probe()
first_delta = after_first - before_first
replay_delta = after_replay - before_replay
if first_delta > 1:
raise ReplayDivergenceError(
f"first attempt emitted {first_delta} side effects for key={key}; "
f"adapter is fanning out a single task"
)
if replay_delta > 0:
raise ReplayDivergenceError(
f"replay of key={key} produced {replay_delta} additional side "
f"effect(s) (first={first_delta}); A2A task.id not propagated "
f"into MCP dedup key"
)
if first["state"] != replay["state"]:
raise ReplayDivergenceError(
f"terminal state diverged on replay for key={key}: "
f"{first['state']} vs {replay['state']}"
)
return True