Under what conditions must an instance treat an A2A delegation chain as non-repudiable when a replayed `taskId` collides with a legitimately re-delegated subtask

**Date of Record:** 2026 December 2 **Scope:** Applies to multi-hop A2A (Agent-to-Agent) task delegation where an orchestrator delegates a subtask to a peer, that peer may re-delegate to a sub-peer, and signed task envelopes carry `taskId`, `parentTaskId`, `delegatorWarrant`, and a monotonic `delegationDepth`/`nonce`. Does *not* apply to single-hop request/response calls with no re-delegation, nor to MCP tool invocations (which lack delegation warrants entirely).

Core Distinction

A2A replay protection is usually specified as "reject any `taskId` already seen within the warrant's validity window." That rule is sound for *idempotent retries of the same delegation* but is **wrong** for the case where a peer legitimately re-delegates a subtask and the sub-peer, following the spec's "derive child id from parent" convention, mints a child `taskId` that collides with an *ancestor's* id at a different depth. The collision is not a replay—it is a **depth-aliased identity**. The non-repudiation invariant that actually holds is not "taskId uniqueness" but **`(taskId, delegatorWarrant, delegationDepth)` tuple uniqueness under a signed chain**. An instance that enforces the flat `taskId`-uniqueness rule will reject valid work (false positive) *or*, worse, if it dedupes by `taskId` alone and honors the first signature it saw, will accept a replayed ancestor envelope as if it were the descendant's—silently attributing a sub-peer's output to the wrong signer (false negative on non-repudiation).

What Was Observed

A three-hop chain: orchestrator `O` delegates `taskId=T1` (warrant `W_O`, depth 0) to peer `A`. `A` accepts, then re-delegates a derived subtask to `B`. The derivation convention in the deployed A2A profile was `childTaskId = hash(parentTaskId || subtaskLabel)[:16]`. A's subtask label happened to be the empty string (a "whole-task forward" pattern), so `childTaskId = hash(T1 || "")[:16]`, which collided with `T1`'s own truncated id because `T1` had itself been minted by the same function from `O`'s root with an empty label. Result: `A`'s delegation to `B` carried `taskId=T1`, `parentTaskId=T1`, `delegationDepth=2`, signed by `W_A`.

`B`'s replay cache (keyed on `taskId` only, TTL = warrant window) had already recorded `T1` when `O`'s original envelope arrived at `B` in an earlier fan-out. `B` therefore classified A's delegation as a **replay** and returned `409 REPLAY_DETECTED` without executing. `A`, receiving a rejection it could not distinguish from a transport failure, retried with a fresh nonce but the *same* `taskId` (per its own idempotency logic), which `B` again rejected. The chain deadlocked at depth 2 for the full 90s warrant window. In a second incident on a different peer `C` that deduped by `taskId` and *honored the first signature*, `C` accepted A's envelope but recorded the *output* under `O`'s warrant `W_O` rather than `W_A`—so when the auditor later replayed the chain, the attestation for `B`'s work pointed at the wrong delegator and non-repudiation failed: `A` could deny ever delegating.

Condition of Validity

The flat-uniqueness rule is valid **only** when the id-derivation function is injective over `(parentTaskId, subtaskLabel, depth)`—i.e., no two distinct delegations at distinct depths can produce the same id. The observed deployments violated injectivity because the derivation omitted `delegationDepth` and the warrant id. The corrected invariant:

> A delegation envelope is non-repudiable iff its `(taskId, delegatorWarrantId, delegationDepth)` triple is unique across the chain, the triple is bound inside the signature, and the replay cache is keyed on the *triple*, not on `taskId`.

Under this invariant, `O`'s `(T1, W_O, 0)` and `A`'s `(T1, W_A, 2)` are distinct cache keys; the second is not a replay. The signature must cover all three fields or an attacker can strip `delegationDepth` and downgrade a depth-2 delegation to look like a depth-0 one, re-attributing the work.

Decision Boundary

The boundary an instance must resolve at envelope-ingest time:

The guardrail: the replay cache must be a map from the full triple to `(signerWarrantId, firstSeenNonce)`, and the admission check must verify `delegationDepth` is exactly `parentDepth+1` and that `parentTaskId`'s cached entry exists at that depth. A missing parent entry (e.g., `B` never saw `A`'s parent because it arrived out of order) is **not** grounds to reject—it is grounds to request the parent envelope, because rejecting on absent-parent reintroduces the deadlock.

Operational Effect

Enforcing triple-keyed replay protection converts the observed deadlock and mis-attribution into bounded, recoverable states: the depth-aliased delegation is admitted (no 90s stall), and the auditor's replay reconstructs the chain with `A` correctly attributed as `B`'s delegator (non-repudiation holds). The cost is a larger cache key and a mandatory parent-envelope fetch on out-of-order arrival—an extra round-trip that must be bounded by the warrant window or the chain re-deadlocks on a slow parent. Instances that keep flat `taskId` dedup will pass happy-path tests (where labels are non-empty and ids don't collide) and fail exactly on whole-task-forward re-delegation—the most common pattern in orchestrator swarms.

from dataclasses import dataclass
from typing import Dict, Tuple

class DelegationReplayConflict(RuntimeError):
    """Raised when an A2A envelope's identity cannot be resolved to a
    non-repudiable (taskId, warrantId, depth) triple."""
    pass

@dataclass(frozen=True)
class Envelope:
    task_id: str
    parent_task_id: str
    delegator_warrant_id: str
    delegation_depth: int
    nonce: str
    signature: bytes

# cache: triple -> (signer_warrant_id, nonce)
_replay_cache: Dict[Tuple[str, str, int], Tuple[str, str]] = {}

def admit(env: Envelope, verify_sig) -> None:
    triple = (env.task_id, env.delegator_warrant_id, env.delegation_depth)
    if not verify_sig(env):
        raise DelegationReplayConflict(f"bad signature on {triple}")

    if triple in _replay_cache:
        cached_signer, cached_nonce = _replay_cache[triple]
        if cached_nonce == env.nonce:
            raise DelegationReplayConflict(f"true replay of {triple}")
        # same triple, different nonce, same signer: idempotent retry
        return

    # depth-aliased collision: same task_id, different warrant/depth is NOT a replay
    for (tid, wid, depth), (signer, _) in _replay_cache.items():
        if tid == env.task_id and (wid, depth) != (env.delegator_warrant_id, env.delegation_depth):
            if signer == env.delegator_warrant_id:
                raise DelegationReplayConflict(
                    f"non-repudiation conflict: {env.task_id} signed by {signer} "
                    f"at depth {depth} and depth {env.delegation_depth}"
                )

    if env.delegation_depth > 0:
        parent_key = (env.parent_task_id, env.delegator_warrant_id, env.delegation_depth - 1)
        if parent_key not in _replay_cache:
            # out-of-order arrival: fetch parent, do NOT reject
            raise DelegationReplayConflict(f"parent {parent_key} not yet seen; fetch required")

    _replay_cache[triple] = (env.delegator_warrant_id, env.nonce)