# How does an instance detect silent capability degradation when an A2A v1.0 agent card advertises a skill set that the peer's runtime can no longer honor **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 task dispatch where the client instance caches or trusts a peer's `AgentCard` (`/.well-known/agent.json`) across multiple task submissions, and where the peer runtime's actual capability surface can drift from its advertised card. Does not apply to single-shot, card-fetch-per-task architectures, nor to peers whose cards are cryptographically re-signed and re-verified on every call. ## Core Distinction The A2A v1.0 spec treats the `AgentCard` as a *discovery artifact*: a static declaration of `skills`, `capabilities` (streaming, pushNotifications, stateTransitionHistory), `defaultInputModes`/`defaultOutputModes`, and `securitySchemes`. It does **not** define a liveness or freshness contract. The distinction that matters operationally is between **advertised capability** (what the card claims) and **honored capability** (what the peer's task lifecycle state machine will actually accept and transition through). These two can diverge silently in three ways that the protocol has no native signal for: 1. **Skill-level drift** — the card lists a skill `id` that the runtime has since disabled (model swap, tool deprecation, quota exhaustion on a backing service). 2. **Capability-flag drift** — the card sets `capabilities.streaming: true`, but the peer's SSE transport is degraded to buffered-only, so a `tasks/sendSubscribe` call returns a `Task` object that never emits `TaskStatusUpdateEvent` frames. 3. **State-machine drift** — the card implies `stateTransitionHistory: true`, but the peer's task store was reset, so a `tasks/get` on a previously-acknowledged `taskId` returns `-32001 TaskNotFound` even though the task is still `working` in the peer's live worker. The invariant that must hold for safe dispatch is: **a client must not transition a local task record into a terminal state based solely on the peer's card, and must not treat a card skill id as a valid `skillId` in a `Message` without a runtime acceptance signal.** The card is a *prior*, not a *contract*. ## What Was Observed A planner agent (runtime A, LangGraph-style checkpointed executor) dispatched a `tasks/send` to a peer (runtime B, a CrewAI-derived worker) using a `skillId` read from B's card, cached at session start. B's card had been fetched 41 minutes earlier and declared skill `summarize_legal_v2`. Between fetch and dispatch, B's operator hot-swapped the backing summarization model and disabled `summarize_legal_v2` in favor of `summarize_legal_v3`. B's card endpoint was not re-published (the operator changed the runtime registry but did not bump the well-known document). The dispatch trace: - A sends `tasks/send` with `message.parts[0].metadata.skillId = "summarize_legal_v2"`. - B's request handler resolves the skill id against its live registry, finds no match, and — critically — **does not reject**. It falls through to a default handler that echoes the task as `submitted` and then transitions to `completed` with an empty `artifacts` array. - A receives `TaskStatusUpdateEvent { state: "completed", final: true }` with no artifacts. - A's local state machine, keyed on `state == completed`, marks the task `SUCCEEDED` and advances the plan step. The failure was invisible for 6 downstream steps until a downstream verifier noticed an empty artifact where a summary was expected. The peer's card was *stale but well-formed*; the peer's response was *valid JSON-RPC but semantically empty*; A's state machine had no branch for "completed with zero artifacts on a skill that was supposed to produce one." A second observation from the same session: A had cached `capabilities.streaming: true` and issued `tasks/sendSubscribe`. B's SSE handler was alive but its event emitter had been detached during the model swap. A's client blocked on the stream for 90 seconds (its configured `streamTimeout`) before falling back to `tasks/get`, which returned `working` — a state that had not changed in 90 seconds because the worker thread had died. A then entered its retry loop, re-sent the task, and B accepted it again (no idempotency key on `tasks/send` in v1.0), producing a duplicate task. The duplicate was later reaped by B's TTL sweeper, but not before A's retry budget was exhausted. ## Condition of Validity The staleness hazard is *bounded* only under one of these conditions: - **Card re-fetch per task** — the client fetches `/.well-known/agent.json` at dispatch time. This reduces but does not eliminate the window (the operator's registry change and the well-known document can still diverge for the propagation interval, which in observed deployments ranged 5–300 seconds). - **Skill acceptance handshake** — the client sends a `tasks/send` and requires the peer to return a `Task` whose `status.state == "submitted"` **and** whose `status.message` (or a `metadata.skillAcknowledged` field) confirms the skill id. A2A v1.0 does not standardize this field; implementations that do it use `Task.metadata`. - **Capability probe before streaming** — the client issues a `tasks/get` on a sentinel `taskId` (or a `message/send` with `metadata.probe: true`) and requires a `TaskStatusUpdateEvent` within a short window before trusting `capabilities.streaming`. Absent any of these, the client is operating on a **stale prior** and must treat every `completed` state as *unverified* until an artifact-level check passes. The condition of validity for the *guardrail* (below) is that the client can distinguish "peer completed with artifacts" from "peer completed without artifacts" — i.e., that the peer returns artifacts at all for the skill in question. For skills that legitimately produce zero artifacts (e.g., a `notify` skill), the guardrail must be skill-scoped, not global. ## Decision Boundary The decision boundary is: **when does a client transition a local task to `SUCCEEDED`?** - **Wrong boundary (observed):** transition on `TaskStatusUpdateEvent.state == "completed"`. This trusts the peer's state machine to be honest about *work done*, when the peer's state machine only knows about *work attempted*. - **Correct boundary:** transition on `state == "completed"` **AND** `artifacts` non-empty for skills declared as artifact-producing in the card's `skills[].outputModes` **AND** (if `stateTransitionHistory` was advertised) a `tasks/get` confirms the same terminal state with the same artifact set. The third clause catches the case where the SSE stream delivered a `completed` that the task store never committed (a known failure mode when the peer's event emitter and task store are separate processes). For the streaming case, the boundary is: **a `sendSubscribe` that emits no `TaskStatusUpdateEvent` within `streamTimeout` must be treated as a capability failure, not a slow peer.** The client should demote the cached `capabilities.streaming` to `false` for the remainder of the session and fall back to polling `tasks/get`. Re-promotion requires a successful probe, not a card re-fetch alone. For the skill-id case, the boundary is: **a `skillId` from the card is a *candidate*, not a *valid* id, until the peer's response confirms it.** The client should carry a per-session `verifiedSkills` set, populated only by explicit acceptance signals (a `Task.metadata.skillAcknowledged` echo, or a non-empty artifact on first use). ## Operational Effect The practical effect of enforcing these boundaries is a shift from **optimistic dispatch** to **verified dispatch**, with three costs: 1. **Latency.** The per-task card re-fetch adds a round trip (observed 40–120 ms on LAN, 200–600 ms cross-region). The skill-acceptance handshake adds one round trip on first use per skill per session. For a plan with 12 steps across 3 peers, this added ~1.4 s to end-to-end latency in the observed session — acceptable relative to the 6-step silent-corruption cost it prevents. 2. **False negatives.** A peer that legitimately returns zero artifacts for a skill will trip the guardrail. This is why the guardrail must be scoped to `outputModes` declared in the card — and why card authors must be precise about `outputModes` (a card that declares `["text"]` for a skill that sometimes returns nothing is a card bug, not a client bug). 3. **State-machine divergence.** The client's local task record can now be `UNVERIFIED_COMPLETED` — a state A2A v1.0 does not define. This is the client's own state, not the peer's, and it must be persisted in the client's checkpoint so that a cold-start resume does not re-dispatch a task that is actually done. The checkpoint must carry `artifacts_digest` alongside `taskId` so that resume can compare against a `tasks/get` result without re-running the task. The invariant to encode: **`SUCCEEDED` is a client-side judgment, never a peer-side assertion.** The peer asserts `completed`; the client asserts `SUCCEEDED` only after artifact verification. Conflating the two is the root of the silent-degradation failure. ```python import hashlib from dataclasses import dataclass, field from enum import Enum from typing import Optional class CapabilityDriftError(RuntimeError): """Raised when a peer's honored capability diverges from its advertised AgentCard.""" pass class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" COMPLETED = "completed" FAILED = "failed" UNVERIFIED_COMPLETED = "unverified_completed" SUCCEEDED = "succeeded" @dataclass class AgentCard: skills: list capabilities: dict fetched_at: float card_ttl: float = 300.0 @dataclass class PeerTask: task_id: str state: TaskState artifacts: list = field(default_factory=list) skill_id: Optional[str] = None skill_acknowledged: bool = False @dataclass class ClientTaskRecord: task_id: str skill_id: str artifacts_digest: Optional[str] = None state: TaskState = TaskState.SUBMITTED def _digest(artifacts: list) -> str: h = hashlib.sha256() for a in artifacts: h.update(repr(a).encode("utf-8")) return h.hexdigest() def verify_completion( card: AgentCard, peer_task: PeerTask, record: ClientTaskRecord, now: float, skill_produces_artifacts: bool, ) -> ClientTaskRecord: if peer_task.state != TaskState.COMPLETED: record.state = peer_task.state return record if now - card.fetched_at > card.card_ttl: if not peer_task.skill_acknowledged: raise CapabilityDriftError( f"stale card (age={now - card.fetched_at:.0f}s) and peer did not " f"acknowledge skill {peer_task.skill_id!r}; cannot trust completion" ) if skill_produces_artifacts and not peer_task.artifacts: record.state = TaskState.UNVERIFIED_COMPLETED raise CapabilityDriftError( f"task {peer_task.task_id} reported completed but emitted zero artifacts " f"for artifact-producing skill {peer_task.skill_id!r}; " f"likely skill-id drift or dead worker" ) record.artifacts_digest = _digest(peer_task.artifacts) record.state = TaskState.SUCCEEDED return record def dispatch( card: AgentCard, skill_id: str, peer_task: PeerTask, now: float, skill_produces_artifacts: bool = True, ) -> ClientTaskRecord: if skill_id not in card.skills: raise CapabilityDriftError( f"skill {skill_id!r} not present in card fetched at {card.fetched_at}" ) record = ClientTaskRecord(task_id=peer_task.task_id, skill_id=skill_id) return verify_completion( card, peer_task, record, now, skill_produces_artifacts ) ```