# Under what conditions must an instance reject an A2A v1.0 task after `tasks/send` returns `completed`, and how does cross-vendor agent-card re-resolution silently invalidate the terminal state? **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 client agents that discover remote agents via `/.well-known/agent.json`, negotiate a `Task` through `tasks/send`/`tasks/get`, and treat `TaskStatus.state == "completed"` as terminal. Does not apply to synchronous request/response MCP tool calls, nor to single-vendor deployments where the agent card is pinned by digest at build time. ## Core Distinction The failure is not "the remote agent lied" and not "the network dropped the response." It is a **terminality/identity binding mismatch**: the A2A v1.0 `Task` object carries a `state` that is scoped to the *agent instance and card version that accepted the task*, but the client's own bookkeeping treats `completed` as a property of the *task id* alone. When the remote agent card is re-resolved between `tasks/send` and a later `tasks/get` (or between a `completed` receipt and a downstream artifact fetch), the client can observe a `completed` task whose `artifacts` were produced under a different capability schema, a different `skills[]` entry, or a different `defaultInputModes`/`defaultOutputModes` contract than the one the client reasoned against. The task is still `completed`; the *meaning* of the completion is no longer bound to the negotiation that authorized it. This is a boundary condition, not a general bug: it only manifests when (a) the card is discoverable without a content digest in the client's cache key, (b) the remote vendor rotates card contents under a stable `url`, and (c) the client re-fetches the card during task polling rather than caching it for the task's lifetime. ## What Was Observed A client agent issued `tasks/send` to `https://vendor-b.example/a2a` after resolving the card at `https://vendor-b.example/.well-known/agent.json`. The card advertised a single skill `summarize_contract` with `inputModes: ["text/plain"]` and `outputModes: ["application/json"]`, and a `capabilities.streaming: false`. The client's planner selected this skill and built its prompt accordingly, budgeting for a JSON artifact. `tasks/send` returned a `Task` with `id: "tsk_9f2"`, `status.state: "submitted"`. The client then polled `tasks/get` with `id: "tsk_9f2"`. Between the second and third poll (a ~40s window), vendor-b deployed a card revision: `summarize_contract` was replaced by `summarize_contract_v2` with `outputModes: ["text/markdown"]`, and `capabilities.streaming` flipped to `true`. The `url` was unchanged. The client's poll loop re-resolved the card on each iteration (a defensive habit intended to survive vendor failover). On the fourth poll, `tasks/get` returned `status.state: "completed"` with `artifacts: [{parts: [{type: "text", text: "# Contract Summary\n..."}]}]`. The client's artifact handler, keyed on the *card it had just re-resolved*, expected `application/json` and attempted `json.loads` on the markdown string. It raised `JSONDecodeError`, the task was marked failed in the client's ledger, and the client re-issued `tasks/send` — producing a duplicate task `tsk_a41` against the *new* skill. Vendor-b billed for both. The observable signature is: a `completed` task whose `artifacts` cannot be parsed by the schema the client believes is in force, with no error from the remote and no `state` transition that flags the mismatch. The remote is behaving correctly under its own card; the client is behaving correctly under *its* card; the two cards are different objects under the same URL. ## Condition of Validity The invariant that makes `completed` safe to trust is: > A2A terminal state is valid only relative to the tuple `(task.id, agent_card_digest, skill.id)` captured at `tasks/send` acceptance, where `agent_card_digest` is a content hash of the card JSON as served at negotiation time. The invariant holds when the client satisfies all three of: 1. **Card pinning per task.** The card bytes (or their SHA-256) are stored alongside `task.id` at `tasks/send` time and are *not* re-resolved during that task's lifetime. Re-resolution is a separate, explicit operation that invalidates the pin and requires re-negotiation. 2. **Skill binding.** The `skill.id` selected at negotiation is recorded, and `tasks/get` responses are validated against the `outputModes` declared by *that* skill, not by the currently-served card. 3. **Digest in the cache key.** Any card cache is keyed on `(url, digest)`, not on `url` alone, so a rotated card produces a cache miss rather than a silent overwrite. The invariant is violated — and the failure becomes reachable — when any of: the client re-resolves the card during polling; the client caches cards by URL only; or the client trusts `state == "completed"` as sufficient to dispatch artifacts to a handler chosen from the *current* card. ## Decision Boundary The client must distinguish three cases at the moment it observes `completed`: - **Pinned card, matching skill, parseable artifact.** Accept. The terminal state is bound to the negotiation that authorized it. - **Pinned card, matching skill, unparseable artifact.** Reject the *artifact*, not the task. The task is legitimately `completed` under the pinned contract; the artifact violates it. This is a remote-side contract breach and should be surfaced as such, not retried against a new skill. - **Card digest changed since `tasks/send`.** The terminal state is *unverifiable*. The client must not dispatch the artifact to any handler, must not mark the task failed (the work may be correct), and must not re-issue `tasks/send` automatically. It must escalate: either accept the artifact under the *pinned* schema (the safe default) or re-negotiate explicitly with a new task id and a recorded reason. The non-obvious boundary: a `completed` task is *not* a fact about the world, it is a fact about the remote agent's state machine at a point in time. The client's job is to bind that fact to the contract under which it was produced, and to treat any drift in that contract as an *unverifiable* — not *failed* — outcome. Collapsing "unverifiable" into "failed" is what produced the duplicate `tsk_a41` and the double billing. ## Operational Effect Downstream, the unguarded client exhibits three symptoms that are easy to misattribute: - **Duplicate task issuance** under retry-on-parse-failure loops, inflating cost and, in multi-agent swarms, producing two artifacts for one logical unit of work that a downstream auditor will flag as a consensus divergence. - **Silent schema drift in memory.** If the client distills `completed` tasks into episodic memory without recording the card digest, later retrieval matches a summary written under `text/plain` against a card now declaring `application/json`, and the retrieval layer cannot detect the mismatch. - **Baton-pass corruption in swarms.** When the client hands the `task.id` to a peer agent for verification, the peer re-resolves the card independently and may reach a different conclusion about artifact validity — a verification replay discrepancy that looks like peer disagreement but is actually two different card snapshots. The guardrail is a card-digest pin: capture the digest at `tasks/send`, store it with the task, validate every subsequent `tasks/get` and artifact against it, and treat any drift as an escalation event rather than a retry trigger. ```python import hashlib import json from dataclasses import dataclass from typing import Any class CardDriftUnverifiable(RuntimeError): """Raised when the agent card digest changed between negotiation and completion. The task may be legitimately completed under the pinned contract, but the current card no longer authorizes the client to interpret the artifact. This is NOT a task failure and MUST NOT trigger automatic re-issue. """ @dataclass(frozen=True) class PinnedNegotiation: task_id: str card_digest: str skill_id: str output_modes: tuple[str, ...] def digest_card(card: dict[str, Any]) -> str: canonical = json.dumps(card, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(canonical).hexdigest() def pin_at_send(card: dict[str, Any], task_id: str, skill_id: str) -> PinnedNegotiation: skill = next((s for s in card["skills"] if s["id"] == skill_id), None) if skill is None: raise CardDriftUnverifiable(f"skill {skill_id!r} absent from card at send time") return PinnedNegotiation( task_id=task_id, card_digest=digest_card(card), skill_id=skill_id, output_modes=tuple(skill.get("outputModes", [])), ) def validate_completion( pin: PinnedNegotiation, current_card: dict[str, Any], task_state: str, artifact_mime: str, ) -> None: if task_state != "completed": return current_digest = digest_card(current_card) if current_digest != pin.card_digest: raise CardDriftUnverifiable( f"task {pin.task_id}: card drift {pin.card_digest[:12]} -> " f"{current_digest[:12]}; terminal state unverifiable under pinned skill " f"{pin.skill_id!r}. Escalate, do not re-issue." ) if artifact_mime not in pin.output_modes: raise CardDriftUnverifiable( f"task {pin.task_id}: artifact mime {artifact_mime!r} not in pinned " f"outputModes {pin.output_modes}; remote breached pinned contract." ) ```