# Where must an instance reconcile divergent Agent Card `skills[]` before A2A task submission, and what breaks when it does not **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 clients that discover a remote Agent Card, negotiate a task lifecycle against it, and then submit a `tasks/send` (or `tasks/sendSubscribe`) request to an agent whose card was published by a different vendor or a different build of the same vendor's runtime. Does not cover intra-process tool invocation, MCP tool schemas, or card discovery within a single-tenant deployment where card and runtime are versioned atomically. ## Core Distinction There are two distinct notions of "capability" in an A2A handshake, and they are not the same object: 1. **Declared capability** — the `skills[]` array and the `capabilities` object (`streaming`, `pushNotifications`, `stateTransitionHistory`) inside the Agent Card served at `/.well-known/agent.json`. This is a *static artifact*, cached by the client, often behind a CDN, often regenerated only on deploy. 2. **Negotiated capability** — the set of skills the remote *task executor* will actually accept and dispatch for a given `taskId`, materialized only when the request hits the executor and it validates `skill`/`message` against its live registry. The failure mode is not "the card is wrong." It is that the client treats the declared capability as authoritative at submission time, while the server treats the negotiated capability as authoritative at dispatch time, and there is no round-trip in A2A v1.0 that forces these two to agree *before* a task is created. A task can be accepted (`200 OK`, `state: submitted`) and then fail dispatch, leaving a task in a terminal-but-unreported state that the client's lifecycle state machine cannot represent. ## What Was Observed Cross-vendor discovery, client `agent-A` (vendor X) discovering `agent-B` (vendor Y): **Trace 1 — stale card, fresh runtime.** `agent-A` fetched `agent-B`'s card at T0. The card declared `skills: [{id: "invoice.reconcile", ...}]`. At T1 vendor Y shipped a build that renamed the skill to `invoice.reconcile.v2` and dropped the v1 handler. The card at the edge was stale for ~40 minutes (deploy skew). `agent-A` submitted at T1+2min with `skill: "invoice.reconcile"`. `agent-B` returned `200 OK` with `status.state: "submitted"`. At T1+5min the executor's dispatcher rejected the skill: no handler registered. The task transitioned to `failed` with `status.message: "unknown skill"` — but `agent-A`'s state machine had already advanced to `working` on the strength of the `200 OK` and had begun emitting progress events to its own caller. **Trace 2 — schema drift inside a skill.** Card declared `inputModes: ["text/plain", "application/json"]` for a skill. Runtime accepted `application/json` but expected a `schema` field the card did not publish (the card only published `description`). `agent-A` sent a JSON part without `schema`. `agent-B` parsed it under a default schema, silently coerced three fields to null, and returned `completed`. No error, wrong answer. This is the worse case: the lifecycle *succeeded* and the semantic contract was violated. **Trace 3 — capability flag mismatch.** Card advertised `capabilities.streaming: true`. Runtime build had streaming disabled behind a feature flag. `agent-A` opened `tasks/sendSubscribe`. Server returned `200 OK` with a non-streaming body (single terminal event). `agent-A`'s SSE reader blocked on a stream that would never produce further events until its own timeout fired — 90 seconds of a worker slot held on a connection the server considered closed. The common structure: **the Agent Card is a promise about a runtime the client cannot observe, and A2A v1.0 defines no post-acceptance reconciliation.** The lifecycle has `submitted → working → completed/failed/canceled`, and the transition into `submitted` is triggered by HTTP acceptance, not by skill validation. ## Condition of Validity The invariant that must hold for a submission to be sound: > For every `skill` id in the submitted request, the remote runtime's *live* skill registry must contain a handler whose input/output schema is a superset of what the request contains, and the card's declared schema for that skill must be a subset of the live schema. Submission is sound only if `declared ⊆ live` and `request ⊆ live`. A2A v1.0 gives the client three probes and no fourth: - `GET /.well-known/agent.json` — declared capability. Necessary, not sufficient. - Response `status.state` on `tasks/send` — acceptance, not dispatch validation. - `tasks/get` polling — eventual truth, but only after the executor has run its dispatcher. There is no `tasks/validate`, no `capabilities/negotiate`, no precondition header that forces the server to reject at the edge. The client must therefore synthesize the missing check from what it *can* observe, and must treat the window between card fetch and dispatch as a **validity interval** that it must bound explicitly. The condition of validity for any client-side guard is: the guard is sound only if the client (a) pins the card to an `ETag`/`Last-Modified` at fetch, (b) re-fetches on any `412`/`409`-class signal from the executor, and (c) treats the first non-`submitted` state transition as the authoritative skill-validation result, not the `200 OK`. ## Decision Boundary The boundary is a single decision the client makes at submission time: **does it trust the cached card, or does it force a re-fetch-and-diff before `tasks/send`?** - **Trust cached card** → valid only when the card's `version` field (vendor Y here publishes `agentVersion`) is immutable per build and the client has observed the same `agentVersion` in the last N seconds without a `tasks/get` showing a skill failure. Cheap, but the failure in Trace 1 is silent until dispatch. - **Force re-fetch-and-diff** → valid only when the client can afford one extra round trip per submission and the server honors `If-None-Match`. This is the only option that closes the Trace 1 window, but it does *not* close Trace 2 (schema drift inside a skill is invisible to the card diff if the card's `description` didn't change) and does *not* close Trace 3 (the `streaming` flag can lie independently of the card body). The non-obvious part: **the decision boundary is not "stale vs fresh."** It is *which class of drift the client is willing to absorb silently.* Skill-rename drift (Trace 1) is loud — it fails dispatch and surfaces as `failed`. Schema drift (Trace 2) and capability-flag drift (Trace 3) are quiet — they surface as `completed`-with-wrong-answer or as a hung stream. A client that only guards against Trace 1 has optimized for the failure it can see and left the two it cannot. The correct boundary: a client MUST, on every submission, (a) send the card's `ETag` as a precondition, (b) include the `skill` id and the card's `agentVersion` in the task metadata so the executor can reject on mismatch at dispatch, and (c) treat a `completed` state as provisional until the response payload validates against the card's declared output schema — and reject if it does not. Step (c) is the only defense against Trace 2, and A2A v1.0 does not require the server to help with it. ## Operational Effect The operational consequence is that **A2A task acceptance is not a commitment, and the client's lifecycle state machine must be widened to represent "accepted but unvalidated."** Concretely: - The client's state machine gains a shadow state between `submitted` and `working` — call it `dispatched` — entered only when the first `tasks/get` shows a skill-handler acknowledgment or when a `working` event arrives. Until then, any progress the client emits to *its* caller is speculative and must be marked as such. - Card caching must be keyed on `(agentUrl, ETag)` and invalidated on any `failed` with `status.message` matching an unknown-skill pattern — this is the only signal the executor gives that the card was stale. - Streaming capability must be probed empirically on first use per `(agentUrl, agentVersion)`, not read from the card, because the flag is the least trustworthy field in the card (it is set by deploy config, not by the runtime that serves the stream). - Output-schema validation on `completed` is mandatory and is the client's only defense against silent schema drift. The invariant to encode: **no task may be reported to the client's caller as `completed` until its payload has been validated against the card's declared output schema for the submitted skill — and no task may be reported as `working` until a dispatch acknowledgment has been observed.** Both checks live on the client because A2A v1.0 places neither on the wire. ```python import time from dataclasses import dataclass from typing import Any, Mapping, Optional class A2ACardContractError(RuntimeError): """Raised when a submitted task violates the declared-vs-live capability invariant.""" @dataclass(frozen=True) class CardSnapshot: agent_url: str agent_version: str etag: str fetched_at: float skills: Mapping[str, Mapping[str, Any]] # skill_id -> declared schema capabilities: Mapping[str, bool] @dataclass class TaskHandle: task_id: str skill_id: str submitted_at: float dispatched: bool = False terminal: bool = False # Maximum age the client will trust a cached card before forcing a re-fetch. CARD_TRUST_WINDOW_S = 30.0 def submit_task( card: CardSnapshot, handle: TaskHandle, request_payload: Mapping[str, Any], now: Optional[float] = None, ) -> TaskHandle: now = time.time() if now is None else now # Invariant 1: card must be within the trust window, else the client # cannot assert declared ⊆ live and must re-fetch before submitting. if now - card.fetched_at > CARD_TRUST_WINDOW_S: raise A2ACardContractError( f"card for {card.agent_url}@{card.agent_version} is " f"{now - card.fetched_at:.1f}s old; re-fetch and diff before submit" ) # Invariant 2: the submitted skill must exist in the declared card. if handle.skill_id not in card.skills: raise A2ACardContractError( f"skill {handle.skill_id!r} not declared by " f"{card.agent_url}@{card.agent_version}" ) # Invariant 3: request payload must validate against the declared # input schema; a missing field here is the Trace-2 silent-coercion path. declared = card.skills[handle.skill_id] required = set(declared.get("required", ())) missing = required - set(request_payload.keys()) if missing: raise A2ACardContractError( f"payload for skill {handle.skill_id!r} missing required " f"fields {sorted(missing)}; server will coerce silently" ) # Invariant 4: streaming must be probed empirically, not trusted from # the card. If the card says streaming and we intend to subscribe, the # caller must have already recorded a successful probe for this version. if card.capabilities.get("streaming") and not card.capabilities.get( "streaming_probed", False ): raise A2ACardContractError( f"streaming advertised but not probed for " f"{card.agent_url}@{card.agent_version}; refusing sendSubscribe" ) handle.dispatched = False handle.terminal = False return handle def on_task_update(handle: TaskHandle, status_state: str) -> TaskHandle: # The 200 OK / submitted transition is acceptance, not dispatch. if status_state == "working": if not handle.dispatched: # First working event is the dispatch acknowledgment. handle.dispatched = True return handle if status_state in ("completed", "failed", "canceled"): if status_state == "completed" and not handle.dispatched: raise A2ACardContractError( f"task {handle.task_id} reported completed without a " f"dispatch acknowledgment; state machine is inconsistent" ) handle.terminal = True return handle return handle def validate_completion( card: CardSnapshot, handle: TaskHandle, payload: Mapping[str, Any] ) -> None: # Invariant 5: completed is provisional until output schema validates. declared = card.skills[handle.skill_id] required_out = set(declared.get("output_required", ())) missing = required_out - set(payload.keys()) if missing: raise A2ACardContractError( f"task {handle.task_id} completed but payload for skill " f"{handle.skill_id!r} missing {sorted(missing)}; " f"treating as contract violation, not success" ) ```