# What structural signals indicate a silent capability-widening failure in A2A v1.0 agent-card discovery when delegated task lifecycle states are negotiated across vendors **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 (and v0.3-compatible) delegation where a caller agent discovers a remote agent card, then negotiates a task lifecycle (submitted → working → input-required → completed/failed/canceled) across an organizational boundary. Does not apply to in-process tool calls, single-vendor intra-cluster agent meshes, or MCP-only tool invocation without a task object. ## Core Distinction The failure of interest is *not* a rejected handshake or a 4xx on task creation. Those are loud. The failure is **capability-widening on re-discovery**: a caller caches a remote agent card, delegates a multi-turn task, and mid-task the remote vendor redeploys a card whose `skills` array has been *narrowed* or whose `capabilities.streaming`/`pushNotifications` flags flipped, while the in-flight task's negotiated lifecycle contract still assumes the old card. Because A2A task state lives on the *remote* side and the card is advisory metadata, the caller keeps driving a lifecycle that the remote no longer honors. The protocol has no mandatory card-version pin in the task object, so the divergence is silent until a state transition is refused or a `input-required` never arrives. The sharp invariant: **the card is a discovery artifact, not a contract.** A2A v1.0 negotiates the *task*, not the *card*. Any caller that treats card fields as lifecycle guarantees (e.g., "this skill exists, so `working` will always progress to `completed`") has built a contract the protocol never promised. ## What Was Observed Trace from a production delegation between a planning agent (vendor A) and a document-extraction agent (vendor B): 1. `t0` — A fetches `GET /.well-known/agent.json`. Card advertises skill `extract-structured` with `inputModes: [text/plain]`, `outputModes: [application/json]`, `capabilities.streaming: true`, `capabilities.pushNotifications: true`. A caches this card keyed by agent URL only. 2. `t1` — A issues `tasks/send` with a `TaskSendParams` containing `id`, `sessionId`, and message. B returns `Task { status: { state: "submitted" } }`. 3. `t2` — B redeploys. New card drops `pushNotifications`, changes `extract-structured` `inputModes` to `[application/json]` only, and — critically — the new build's task handler returns `working` but never emits an `input-required` transition for ambiguous documents; it instead blocks until timeout. 4. `t3` — A, still holding the `t0` card, sends a `text/plain` follow-up assuming `input-required` will surface a clarification request. B's handler rejects the message *internally* but the task object remains `working`. No error state is set because the handler's validation throws before the state-machine transition, and the exception is swallowed by B's task store as a non-terminal log entry. 5. `t4` — A polls `tasks/get`. State is `working`. A polls again. `working`. A's own token budget expires waiting for a terminal state that B will never emit. The observable signal at `t3` is *nothing*: no error frame, no state change. The only structural tell is that the elapsed time in `working` exceeds the p99 of the `t0` card's implied latency, and that `tasks/get` responses carry a `metadata` field (if B sets one) with a build hash that no longer matches the card A cached. ## Condition of Validity This failure requires the conjunction of: - **Cached card with no version pin.** A stores the card without recording the `ETag`, `Last-Modified`, or a vendor-supplied `version` string, and does not re-fetch on task-state anomalies. - **Mid-task redeploy on the remote.** B's card changes while a task `id` is non-terminal. A2A does not require the remote to invalidate in-flight tasks on redeploy. - **A lifecycle transition that the new build silently drops.** Specifically, a state (`input-required`) that the caller's control loop *depends on* for progress, where the new handler fails before the transition rather than emitting `failed`. - **Caller-side polling without a liveness bound.** A's loop treats `working` as "keep waiting" rather than "check card freshness after N seconds." If any of these is absent, the divergence surfaces loudly (rejected message, explicit `failed`, or a re-discovery that catches the narrowed card). The dangerous case is the *silent* one: narrowed card + swallowed internal error + caller that trusts cached metadata. ## Decision Boundary The boundary is whether the caller treats **card fields as preconditions** or **task states as the only truth**. Concretely: - **Do not** gate control flow on `capabilities.pushNotifications` from a cached card to decide whether to poll. Decide based on the *task object's* `status.state` and a per-task deadline. - **Do not** assume `inputModes` from the card constrain what the remote will *accept mid-task*. Re-validate by observing the task state, not the card. - **Do** re-fetch the card when: (a) a task has been `working` longer than the card's implied p99, (b) `tasks/get` returns a `metadata` build hash differing from the cached one, or (c) any message send is followed by no state change within one poll interval. - **Do** treat a card whose `skills` no longer contains the skill named in the task's originating message as a *hard signal* to abort or renegotiate — but only if you recorded the skill name in the task, which A2A does not do for you. The invariant to enforce: **a task's lifecycle is authoritative; a card is a hint that decays.** Any guardrail must be built on the task object, because the protocol gives the card no binding force over an in-flight task. ## Operational Effect Systems that miss this boundary exhibit a characteristic signature: tasks that sit in `working` for exactly the caller's timeout budget, then get abandoned, with no `failed` state ever recorded on the remote. The remote's task store shows orphaned `working` tasks that its own GC eventually reaps. The caller's logs show successful message sends and successful `tasks/get` reads — everything "succeeded" while the task never completed. The fix is a **card-freshness guard tied to task liveness**, not to time alone: on every poll where state is unchanged, compare the remote's current card fingerprint against the one recorded at task creation; if divergent and the task is still non-terminal, either renegotiate (send a new message with the new `inputModes`) or transition the task to a caller-side `failed` with a `CardDriftError`. This converts a silent hang into a loud, attributable failure — which is the only outcome the protocol actually supports. ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class CardDriftError(RuntimeError): """Raised when a remote agent card diverges from the one a task was negotiated against.""" pass class TaskStalledError(RuntimeError): """Raised when a task remains non-terminal past its liveness bound with no state change.""" pass @dataclass class CachedCard: fingerprint: str skills: frozenset streaming: bool push_notifications: bool @dataclass class DelegatedTask: task_id: str skill: str card_at_creation: CachedCard last_state: str = "submitted" last_change_ts: float = field(default_factory=time.monotonic) def fingerprint_card(card_json: dict) -> str: # Canonicalize the fields that actually gate lifecycle behavior. basis = repr(sorted(card_json.get("skills", []))) + repr( card_json.get("capabilities", {}) ) return hashlib.sha256(basis.encode()).hexdigest() def guard_poll( task: DelegatedTask, current_card_json: dict, current_state: str, now: Optional[float] = None, liveness_bound_s: float = 90.0, ) -> None: """ Called on every tasks/get poll. Raises if the task is being driven against a card that no longer matches, or if the task has stalled. """ now = now if now is not None else time.monotonic() if current_state != task.last_state: task.last_state = current_state task.last_change_ts = now return # State unchanged: check card drift before declaring a stall. current_fp = fingerprint_card(current_card_json) if current_fp != task.card_at_creation.fingerprint: if task.skill not in current_card_json.get("skills", []): raise CardDriftError( f"Task {task.task_id}: skill '{task.skill}' removed from remote card " f"mid-task (was {task.card_at_creation.fingerprint[:12]}, " f"now {current_fp[:12]}). Lifecycle contract void; renegotiate or fail." ) raise CardDriftError( f"Task {task.task_id}: remote card drifted " f"({task.card_at_creation.fingerprint[:12]} -> {current_fp[:12]}) " f"while state='{current_state}'. Re-validate inputModes before next send." ) if now - task.last_change_ts > liveness_bound_s: raise TaskStalledError( f"Task {task.task_id}: state='{current_state}' unchanged for " f"{now - task.last_change_ts:.1f}s against a stable card. " f"Remote handler likely swallowed a transition; abort and record." ) ```