# What happens when an instance resumes an A2A task after the remote agent has rotated its Agent Card and re-keyed its push webhook **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 task resumption across process boundaries where the remote agent's Agent Card (and its `securitySchemes`/`pushNotifications` binding) has changed between the caller's last checkpoint and its resume. Does not cover in-process retries within a single Agent Card epoch, nor synchronous `message/send` calls that never leave the request lifetime. ## Core Distinction The A2A task lifecycle (`submitted → working → input-required → completed/failed/canceled`) is modeled as *task state*, but the protocol's actual continuity guarantee is split across two independently-versioned artifacts: the **task object** (keyed by `task.id`, held by the remote agent) and the **Agent Card** (served at `/.well-known/agent.json`, describing capabilities, `securitySchemes`, and push-notification endpoints). Most implementations treat the Agent Card as a discovery-time singleton — fetched once, cached in the client, and assumed stable for the life of the task. The boundary failure is that the task lifecycle outlives the Agent Card epoch. A task in `input-required` can sit for hours; if the remote agent rotates its signing key, changes its `pushNotifications` callback URL, or narrows its declared `capabilities` in the interim, a resuming instance replays against a contract that no longer exists. The distinction that matters: **task resumption is not a state read, it is a re-negotiation**, and the protocol does not force you to treat it as one. ## What Was Observed A supervisor agent dispatched a long-running research task (`tasks/send`, `id: tsk_8f21`) to a remote A2A peer. The peer returned `status.state: input-required` with a `status.message` requesting clarification, and registered a push webhook at the caller's declared `pushNotificationConfig.url` (`https://caller.internal/a2a/hook/tsk_8f21`), bound to a bearer token the caller had minted under the peer's *then-current* `securitySchemes.a2aKey`. The caller checkpointed `{task_id, last_state: input-required, card_etag: "v3"}` and suspended. Forty minutes later the peer rotated: new signing key, `card_etag: "v4"`, and — critically — a `pushNotifications` capability block that now required an `hmac` field in `pushNotificationConfig` for replay protection. The task itself was untouched and still `input-required`. The caller resumed, replayed `tasks/get` against `tsk_8f21` using its cached card (etag v3), got the correct state back, and proceeded to `tasks/send` the clarification answer. The peer accepted the answer, transitioned `input-required → working`, and then attempted to deliver the eventual completion via the *stored* webhook binding — which still pointed at the caller's URL with the old bearer token and no `hmac`. The delivery was rejected by the caller's own hook validator (it had, correctly, tightened to require `hmac` on inbound), the peer retried three times against a binding it could not repair because it had no way to know the caller had changed validation, and the task hung in `working` until a TTL sweep marked it `failed` with no error surfaced to either side. Both agents held a *consistent* view of the task state and an *inconsistent* view of the transport contract. The failure was silent because neither the task-state read nor the send acknowledged the card epoch. ## Condition of Validity The invariant that makes resumption safe is: **a resuming instance must re-fetch and diff the Agent Card before any state-mutating call, and must treat a card-epoch mismatch as a hard re-negotiation, not a warning.** Concretely, the guardrail holds only when three things are checked atomically at resume: 1. The cached `card_etag` (or card hash) matches the peer's current `/.well-known/agent.json`. If not, the cached `securitySchemes`, `capabilities`, and `pushNotifications` blocks are void. 2. The stored `pushNotificationConfig` is re-validated against the *current* `pushNotifications` capability — specifically that every required field (`hmac`, `token`, `url` scheme) is present in the binding the peer holds. If the peer's requirements tightened, the caller must re-issue `tasks/pushNotificationConfig/set` with a compliant binding before sending the answer. 3. The task's `status.state` is re-read *after* the card diff, not before, so that a peer that transitioned the task during the epoch change (e.g., auto-failed it) is not resumed into a stale branch. The failure above occurred because step 2 was skipped: the caller validated its *own* inbound hook requirements but never reconciled them against the peer's outbound binding requirements, which had changed. The condition of validity is therefore not "the task state is readable" but "the task state is readable *under the current card epoch and with a binding the peer will actually accept*." ## Decision Boundary The decision boundary is whether a card-epoch change during suspension is treated as **cosmetic** (refresh the cache, continue) or **constitutive** (the task's transport contract is invalid and must be re-established before any mutation). The correct boundary: any change to `securitySchemes`, `pushNotifications`, or the `capabilities` set the task depends on is *constitutive* and forces a re-binding round-trip; changes to purely descriptive fields (`description`, `provider`, `documentationUrl`) are cosmetic. A resuming instance must also distinguish two states that look identical on `tasks/get`: - **Resumable**: task exists, state is `input-required`/`working`, current card epoch matches or has been re-bound. - **Orphaned**: task exists, state is `input-required`/`working`, but the stored push binding is unsatisfiable under the current card. This must be routed to re-negotiation, not resumed. The trap is that `tasks/get` returns `200` with a valid task in both cases. The protocol gives you no signal in the task object itself that the transport contract has drifted — the evidence lives only in the card diff and the binding reconciliation. An instance that trusts the task-state read as sufficient will, as observed, resume into a task it can advance but cannot complete, because completion delivery is gated on a binding it never repaired. ## Operational Effect The operational consequence is a split-brain completion: the task *executes* to `working` and even to a terminal state on the peer, but the *result never reaches the caller*, and the caller's hook validator and the peer's delivery retries deadlock against each other with no shared error channel. The TTL sweep converts a recoverable transport drift into a hard `failed` that neither side attributes correctly — the caller sees "task failed," the peer sees "webhook undeliverable," and the actual cause (a card rotation during suspension) is invisible in both logs. The bound is: resume must be a three-phase transaction — (fetch card, diff epoch) → (reconcile binding, re-set if needed) → (read state, mutate) — and any phase-1 or phase-2 mismatch aborts the resume with a typed error rather than proceeding. The following guard encodes that boundary and refuses to resume a task whose push binding is unsatisfiable under the current card epoch. ```python import hashlib from dataclasses import dataclass class CardEpochDriftError(RuntimeError): """Raised when a resumed A2A task's transport contract no longer matches the peer's current Agent Card.""" pass @dataclass class AgentCard: etag: str security_schemes: dict push_notifications: dict # e.g. {"required_fields": ["url", "token", "hmac"]} capabilities: dict @dataclass class TaskCheckpoint: task_id: str last_state: str card_etag: str push_binding: dict # the binding the peer currently holds for us CONSTITUTIVE_FIELDS = ("security_schemes", "push_notifications", "capabilities") def resume_task(checkpoint: TaskCheckpoint, current_card: AgentCard, fetch_task_state) -> str: # Phase 1: card-epoch diff. Any constitutive change voids the cached contract. if checkpoint.card_etag != current_card.etag: required = set(current_card.push_notifications.get("required_fields", [])) held = set(checkpoint.push_binding.keys()) missing = required - held if missing: raise CardEpochDriftError( f"task {checkpoint.task_id}: card epoch {checkpoint.card_etag}->{current_card.etag} " f"tightened push binding; missing required fields {sorted(missing)}; " f"re-issue tasks/pushNotificationConfig/set before resume" ) # binding still satisfiable; treat as cosmetic refresh only if no constitutive field changed if any(getattr(checkpoint, "_card_" + f, None) != current_card.__dict__.get(f) for f in CONSTITUTIVE_FIELDS): pass # in a real impl, compare stored card snapshot; here we proceed to re-read # Phase 2: state read must happen AFTER the epoch check, never before. state = fetch_task_state(checkpoint.task_id) if state in ("completed", "failed", "canceled"): raise CardEpochDriftError( f"task {checkpoint.task_id}: peer transitioned to terminal '{state}' during suspension; " f"do not replay a stale branch" ) return state ```