# Why does an instance reject a valid A2A Agent Card after a mid-task capability downgrade? **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 task delegation where the remote agent's `AgentCard` is re-fetched (or cached) between task submission and task continuation, and where the remote runtime can mutate its advertised `skills`, `capabilities`, or `securitySchemes` without bumping a version identifier. Does not apply to single-shot request/response calls where the card is fetched once and the task completes inside one transport frame. ## Core Distinction The failure is not "the card changed." It is that A2A v1.0 treats the `AgentCard` as a *capability advertisement* but the task lifecycle treats the delegated task as a *capability warrant*. These two objects are decoupled in the spec: the card describes what the agent *can currently do*, while an in-flight task is a promise the agent made under the card it served at `message/send` time. When a heterogeneous runtime (a horizontally scaled pool, a hot-reloaded skill registry, or a rolling deploy behind one well-known URL) serves a *different* card to the continuation request than it served to the submit request, the client has no protocol-level way to distinguish "the agent legitimately lost the skill mid-task" from "I am now talking to a different instance that never held the task state." Both look identical on the wire: same `taskId`, same endpoint, different `skills[]`. The invariant that gets violated is: *a task's accepted skill set must be a monotonic subset of the card served at task creation, for the lifetime of the task.* A2A v1.0 does not enforce this. It enforces card *validity* at discovery, not card *stability* across the task. ## What Was Observed A client agent submits a task to `https://pool.example/agent` via `message/send` with `skillId: "invoice.reconcile.v2"`. The load balancer routes to instance **A**, which serves an `AgentCard` advertising `invoice.reconcile.v2` with `capabilities.streaming: true`. Instance A accepts the task, returns `TaskState: working`, and stores the reconciliation state in its local working set — *not* in shared storage, because the card advertised no `pushNotifications` and the runtime optimized for the single-instance case. The client then does the correct thing: it polls with `tasks/get`, and on a `input-required` transition it sends a continuation via `tasks/send` (or `message/send` with the existing `taskId`). The load balancer — sticky sessions disabled, because the pool is autoscaling — routes to instance **B**. Instance B serves a card that is *also valid*: `invoice.reconcile.v2` is present, but `capabilities.streaming` is now `false` (B was rolled out during a partial deploy and the streaming feature flag is off), and `securitySchemes` lists a rotated API key scheme. Three things happen, none of which the client can cleanly attribute: 1. The continuation request is rejected with `-32602 Invalid params` because B's `securitySchemes` rotated and the client's bearer token was minted against A's scheme. The error is a *transport/auth* error, not a task error, so the client's task-state machine does not transition — the task sits in `working` forever from the client's view. 2. If the client re-authenticates and retries, B returns `TaskState: failed` with reason `task not found`, because B has no record of `taskId`. The client interprets this as "the task failed," when in fact the task *may still be running on A*. 3. If the client instead re-fetches the card to reconcile, it sees a *valid* card (B's), concludes the agent is healthy, and retries the original `message/send` — creating a **duplicate task** while A's original task continues to mutate shared downstream state (the invoice ledger). Reconciliation runs twice. The tell is that the card is *valid at every observation*. There is no single fetch that fails. The failure is distributed across the *sequence* of fetches, and A2A v1.0's discovery model has no primitive to express "this card is the same logical agent as the one I talked to before." ## Condition of Validity The guardrail holds only when all of the following are true, and breaks the moment any one fails: - **Card identity is stable across the task lifetime.** The `AgentCard` must carry a field the client can pin — in practice `name` + `version` + a runtime instance discriminator. A2A v1.0 makes `version` optional and does not define an instance discriminator at all. If the pool serves one card for N instances, the card is a *pool-level* advertisement, and the client must treat `taskId` as pool-scoped, not instance-scoped. - **Task state is externalized from instance memory.** If `taskId` resolution depends on instance-local state, then any card change that implies a routing change (rolling deploy, autoscale) is a task-loss event. The card's `capabilities.pushNotifications` is the only hint the spec gives, and it is advisory. - **The continuation carries a warrant, not just an ID.** A2A v1.0 `tasks/send` carries `taskId` but does not require the client to echo the `skillId` or the card version it accepted under. Without that echo, the server cannot reject a continuation that no longer matches its current card, and the client cannot detect that the server's card drifted. ## Decision Boundary The boundary is **whether the card is re-fetched between submit and continue, and whether the re-fetch is treated as authoritative for the in-flight task.** - If the client caches the card at submit time and *never* re-fetches mid-task, it will send continuations under a stale card — which is correct for task continuity but wrong for auth after a `securitySchemes` rotation. This is the "pin and pray" failure: continuity preserved, auth eventually breaks. - If the client re-fetches and *trusts* the new card, it will re-derive its request shape from the new card — which is correct for auth but wrong for task continuity, because the new card may describe a different instance that never held the task. This is the "refresh and duplicate" failure. - The correct boundary is: **re-fetch for auth, pin for task semantics.** The client must use the fresh card *only* to refresh `securitySchemes` and transport parameters, and must continue to assert the `skillId` and capability set it accepted under at submit time. If the fresh card no longer advertises that `skillId`, the client must treat the task as *orphaned* — not failed, not retryable — and must query the pool's task-status endpoint (or the original instance, if addressable) before deciding. A2A v1.0 does not give the client a way to address "the original instance." That is the gap. The decision boundary is therefore a *client-side* invariant: the client must maintain a `(taskId → acceptedCardFingerprint)` map and refuse to continue a task under a card whose fingerprint differs in `skills` or `capabilities`, while still permitting `securitySchemes` drift. ## Operational Effect The practical consequence is that A2A v1.0 task continuity is only as strong as the deployment topology behind the well-known card URL. A single-instance agent with a static card is safe. A pooled agent with a shared task store and a versioned card is safe *if* the version is bumped on every capability change and the client pins it. A pooled agent with instance-local task state and a rolling-deploy card is **structurally unsafe** — no client-side logic can fully recover, because the continuation may land on an instance that never held the task, and the protocol offers no "which instance holds taskId X" query. The mitigation that actually works at the agent layer is to make the card fingerprint part of the task warrant: the client records `(taskId, cardFingerprint, acceptedSkills)` at submit, and on every continuation it asserts `acceptedSkills ⊆ currentCard.skills`. If the assertion fails, the client raises a hard error and quarantines the task rather than retrying — because a retry under a degraded card is exactly the duplicate-execution path that corrupts downstream state. The quarantine is the guardrail; the retry is the failure. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class CardDriftViolation(RuntimeError): """Raised when an in-flight A2A task is continued under a card that no longer warrants the skills it was accepted under.""" pass @dataclass class AgentCard: name: str version: Optional[str] skills: list[str] capabilities: dict security_schemes: list[str] def fingerprint(self) -> str: # Fingerprint covers task-semantic fields only. securitySchemes are # deliberately excluded: auth rotation is allowed mid-task, skill and # capability drift is not. payload = json.dumps( {"name": self.name, "skills": sorted(self.skills), "capabilities": self.capabilities}, sort_keys=True, ) return hashlib.sha256(payload.encode()).hexdigest() @dataclass class TaskWarrant: task_id: str accepted_card_fp: str accepted_skills: set[str] accepted_capabilities: dict class A2ATaskClient: def __init__(self) -> None: self._warrants: dict[str, TaskWarrant] = {} def submit(self, task_id: str, card: AgentCard, skill_id: str) -> TaskWarrant: if skill_id not in card.skills: raise CardDriftViolation( f"cannot submit: skill {skill_id!r} not advertised by card " f"{card.name}@{card.version}" ) warrant = TaskWarrant( task_id=task_id, accepted_card_fp=card.fingerprint(), accepted_skills=set(card.skills), accepted_capabilities=dict(card.capabilities), ) self._warrants[task_id] = warrant return warrant def continue_task(self, task_id: str, fresh_card: AgentCard) -> None: warrant = self._warrants.get(task_id) if warrant is None: raise CardDriftViolation( f"no warrant for task {task_id!r}; refusing to continue blind" ) # Auth drift is permitted: refresh securitySchemes, keep going. # Task-semantic drift is not. current_fp = fresh_card.fingerprint() if current_fp != warrant.accepted_card_fp: missing = warrant.accepted_skills - set(fresh_card.skills) if missing: raise CardDriftViolation( f"task {task_id!r} orphaned: skills {sorted(missing)} " f"were warranted under {warrant.accepted_card_fp[:12]} " f"but absent from current card {current_fp[:12]} " f"({fresh_card.name}@{fresh_card.version}). " f"Quarantine, do not retry." ) # Same skills, different fingerprint (e.g. capability flags # flipped). Treat as degraded: surface but do not silently retry. raise CardDriftViolation( f"task {task_id!r} capability drift: warranted under " f"{warrant.accepted_card_fp[:12]}, current {current_fp[:12]}. " f"Re-negotiate explicitly before continuing." ) # Fingerprint match: continuation is safe under the original warrant. ```