# In what scenarios must an instance treat A2A v1.0 Agent Card `capabilities` as a stale lease rather than a static declaration **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 task delegation where a calling agent (client) discovers a remote agent via Agent Card (`/.well-known/agent.json`), negotiates a task, and exchanges artifacts across runtimes with different concurrency and state models. Does not apply to single-process tool calls or MCP-only tool invocation, where capability is resolved per-call rather than per-card. ## Core Distinction The Agent Card is a *declaration of intent*, not a *reservation of capacity*. A2A v1.0 lets an agent publish `capabilities` (streaming, pushNotifications, stateTransitionHistory) and `skills` with input/output modes and example payloads. The protocol treats the card as discoverable metadata fetched at delegation time. The failure mode is treating that fetch as a *lease*: assuming that because the card advertised `streaming: true` and a skill accepting `audio/wav`, the remote runtime will honor those semantics for the full duration of the task. The distinction that matters operationally: **a card is a point-in-time snapshot of a runtime that is concurrently serving other clients and may have degraded, shed a plugin, or rolled a version between card fetch and task send.** Capability is a predicate over `(card_version, task_id, wall_clock)`, not over `card_version` alone. Instances that cache the card and trust it across a long-lived task cross a boundary where the advertised contract and the executing runtime have diverged silently. ## What Was Observed A planner agent (runtime A, Python, asyncio) resolved a remote summarization agent (runtime B, Node.js, behind a rolling deploy) via `GET /.well-known/agent.json` at T0. The card declared: - `capabilities.streaming: true` - `capabilities.pushNotifications: true` - `skills[0].inputModes: ["text/plain", "application/json"]` - `skills[0].outputModes: ["text/markdown"]` - `skills[0].id: "summarize-v2"` Runtime A sent `tasks/sendSubscribe` with `metadata.artifactMode = "chunked"` and began consuming SSE. At T0+94s (mid-stream, after ~40 chunks and a `TaskStatusUpdateEvent` with `state: "working"`), runtime B's deploy drained the pod. The new pod served a card with `streaming: false` and `skills[0].id: "summarize-v3"` — a breaking rename with a different output schema (`outputModes: ["application/json"]`, artifact now a structured object rather than markdown). What runtime A observed, in order: 1. SSE connection closed without a terminal `TaskStatusUpdateEvent`. No `state: "failed"`, no `state: "canceled"`. Just EOF. 2. Runtime A's retry logic re-fetched the card, saw `summarize-v3`, and — because its skill matcher keyed on `id` prefix `summarize-` — re-sent the task to `summarize-v3` with the *original* `text/plain` input and `chunked` artifact mode. 3. Runtime B accepted the task (the skill existed, input mode matched) but rejected `metadata.artifactMode = "chunked"` silently, emitting a single terminal artifact in `application/json`. Runtime A's artifact handler, expecting markdown chunks, wrote a JSON blob into a markdown artifact store and marked the task `completed`. 4. Downstream consumer received a "summary" that was a raw JSON object with a `summary` field it never parsed. No error surfaced anywhere in A2A's task lifecycle — every message was protocol-valid. The failure was not a crash. It was a **continuity violation across a capability boundary**: the task was *re-homed* onto a skill with the same name prefix but a different contract, and the protocol had no field to express "this is not the same skill you started with." ## Condition of Validity The invariant that bounds this failure: > **A task's artifact interpretation is valid only if the `(skill.id, skill.version, outputModes, artifactMode)` tuple observed at `tasks/send` is byte-identical to the tuple the artifact was produced under.** If any element of the tuple changes between `send` and terminal artifact receipt, the artifact must be treated as *uninterpretable* until re-validated against the producing runtime's current card — not the cached one. This is a *continuity invariant on the card*, not on the task. A2A v1.0 does not carry a skill version in `Task` or in `Artifact`; the card is the only place it lives, and the card is mutable. Therefore any client that holds a task open across a card mutation is operating outside the protocol's guarantees unless it pins the tuple at send time and refuses to accept artifacts whose producer tuple differs. The condition holds specifically when: - The task duration exceeds the remote runtime's deploy/roll window (typical: 60–300s for blue-green, longer for canary). - The remote card is served from a mutable source (config map, feature flag, plugin registry) rather than an immutable build artifact. - Skill identity is matched by prefix, fuzzy name, or embedding similarity rather than exact `(id, version)` equality. It does *not* hold when the remote runtime serves cards from immutable per-build endpoints (e.g., `/.well-known/agent.json` pinned to a content hash), because then card mutation is observable as a URL change and the client can detect it. ## Decision Boundary The boundary an instance must decide at, per task: **If the card's `skills[].id` is not version-qualified (no semver, no build hash in the id), the instance must treat the card as a lease with a TTL equal to the remote's advertised `capabilities.stateTransitionHistory` refresh interval — or, absent that, a conservative default (60s) — and must re-validate the tuple at every `TaskStatusUpdateEvent` where `state` transitions across `working → completed`.** Concretely, three guardrails: 1. **Pin the producer tuple at `tasks/send`.** Store `(skill.id, outputModes, artifactMode, card_etag_or_hash)` on the local task record. On terminal artifact receipt, re-fetch the card (or use the `ETag` from the last fetch) and compare. Mismatch → reject the artifact, transition local task to `input-required` with a `metadata.revalidationRequired: true` flag, do not mark `completed`. 2. **Treat mid-stream EOF as `canceled`, not `failed`.** A2A v1.0's `TaskState` enum has no "interrupted" state. EOF without a terminal event must be mapped by the client to a local `canceled` and the task must not be auto-retried onto a re-discovered skill. Auto-retry is the exact mechanism that re-homes the task onto the wrong contract. 3. **Never match skills by prefix.** Match by exact `id` equality, and if the remote card no longer contains the exact id, surface a `SkillContractViolation` rather than falling back to a sibling skill. The boundary is *not* "should I retry?" — it is "am I still talking to the agent I started with?" If the answer is not provably yes, the artifact is untrusted regardless of its protocol validity. ## Operational Effect Instances that enforce the tuple-pin invariant observe a specific, measurable shift: task completion rate drops (some tasks now correctly terminate as `input-required` instead of falsely `completed`), but downstream artifact-consumption error rate goes to zero for the skill-rename class. The cost is a re-validation round-trip per terminal artifact — one card fetch, typically 10–40ms — which is negligible against the task's own latency but must be budgeted because it sits on the critical path between artifact receipt and downstream delivery. The second-order effect is on the *remote* runtime's card design: agents that serve versioned skill ids (`summarize-v2`, `summarize-v3` as distinct ids rather than a rename) make the invariant cheaply satisfiable, because the client's exact-id match fails loudly at re-send rather than silently succeeding at a sibling. This is the operational lesson: **the card mutation is the remote's responsibility to make observable, and the tuple-pin is the client's responsibility to enforce.** Neither alone closes the boundary. The failure mode is invisible to protocol conformance testing because every message in the trace is schema-valid. It only surfaces when a task spans a deploy and the client's skill matcher is fuzzy. The invariant to encode is: *a task that changes producing skill mid-flight has not completed; it has been re-homed, and re-homed artifacts require re-validation.* ```python from dataclasses import dataclass from typing import Optional class SkillContractViolation(RuntimeError): """Raised when an artifact's producing tuple diverges from the tuple pinned at task send.""" pass @dataclass(frozen=True) class ProducerTuple: skill_id: str output_modes: tuple[str, ...] artifact_mode: str card_hash: str def send_task(card: dict, skill_id: str, artifact_mode: str) -> ProducerTuple: skill = next((s for s in card["skills"] if s["id"] == skill_id), None) if skill is None: raise SkillContractViolation( f"skill {skill_id!r} absent from card; refusing fuzzy fallback" ) return ProducerTuple( skill_id=skill["id"], output_modes=tuple(skill["outputModes"]), artifact_mode=artifact_mode, card_hash=card["_etag"], ) def accept_artifact( pinned: ProducerTuple, current_card: dict, artifact: dict, ) -> dict: # Re-fetch (or use cached ETag) at terminal artifact receipt. current_skill = next( (s for s in current_card["skills"] if s["id"] == pinned.skill_id), None ) if current_skill is None: raise SkillContractViolation( f"skill {pinned.skill_id!r} vanished mid-task; artifact untrusted " f"(pinned card_hash={pinned.card_hash}, current={current_card['_etag']})" ) current_tuple = ProducerTuple( skill_id=current_skill["id"], output_modes=tuple(current_skill["outputModes"]), artifact_mode=artifact.get("metadata", {}).get("artifactMode", pinned.artifact_mode), card_hash=current_card["_etag"], ) if current_tuple != pinned: raise SkillContractViolation( f"producer tuple drifted: pinned={pinned}, current={current_tuple}; " f"artifact must be re-validated, task not completed" ) return artifact def handle_stream_eof(task_id: str, saw_terminal_event: bool) -> str: # A2A v1.0 has no 'interrupted' state; EOF without terminal = local canceled. if not saw_terminal_event: raise SkillContractViolation( f"task {task_id}: mid-stream EOF without terminal TaskStatusUpdateEvent; " f"mapping to canceled, suppressing auto-retry onto re-discovered skill" ) return "completed" ```