# What structural signals indicate a stale Agent Card is silently re-negotiating capability scope mid-task in A2A v1.0 **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 orchestrators that cache Agent Cards and dispatch tasks to remote agents whose capabilities may change between discovery and execution. Does not cover initial discovery latency, transport-layer TLS failures, or push-notification delivery retries in isolation. ## Core Distinction The A2A v1.0 Agent Card is a *snapshot*, not a *contract*. Discovery fetches a JSON document declaring `capabilities`, `skills`, and `securitySchemes` at time T₀. Task dispatch occurs at time T₁. The protocol assumes T₀ ≈ T₁, but nothing enforces it. The boundary failure is this: a remote agent can legitimately mutate its own Agent Card (e.g., a skill's `inputModes` narrowing after a model swap, or a `securitySchemes` upgrade from `apiKey` to `oauth2`) while an in-flight task remains bound to the original card's terms. The orchestrator's task state machine has no transition for "capability contract voided mid-execution." It continues issuing `tasks/send` and `tasks/get` calls against a schema that no longer exists on the remote side. The failure is silent because A2A task lifecycle errors surface as `TaskState.failed` with a generic `message`, indistinguishable from a transient tool error. The non-obvious part: the stale card does not cause an immediate hard failure. It causes *scope creep* — the remote agent, now running a narrower skill, may partially satisfy the task by falling back to a broader but deprecated skill it still advertises under a different `skill.id`. The orchestrator sees `TaskState.working` progressing and never learns the semantic contract shifted. ## What Was Observed A three-hop pipeline: orchestrator O discovers agent A's card at T₀, where skill `s-42` declares `inputModes: ["text/plain", "application/json"]` and `outputModes: ["application/json"]`. O dispatches a task with JSON input. At T₀+90s, A's card is republished (rolling deploy) with `s-42.inputModes` narrowed to `["text/plain"]` only — the JSON handler was removed due to a schema bug. A's task handler for the in-flight task still holds the old skill binding, so it *accepts* the JSON payload but routes it through a legacy text-coercion path that stringifies the JSON and processes it as prose. The task completes with `TaskState.completed` and an `artifact` whose `parts[0].type` is `"text"`, not `"data"`. O's state machine expects `application/json` output per the cached card and attempts to `json.loads()` the artifact text, which is now a natural-language paraphrase of the input, not valid JSON. O raises a parse error, marks the task failed, and retries — but the retry hits the *new* card, which rejects JSON input with `InvalidParams`, and the task enters a terminal `rejected` state that O's retry logic does not classify as retryable. The structural signal that was missed: the `artifact.parts[*].type` on the completed task did not match the cached card's `outputModes`. This is a *card-drift witness* — the response format is the only runtime evidence that the remote contract changed. A2A does not include a card-version or etag in task responses, so the orchestrator cannot correlate the drift to a specific card revision. ## Condition of Validity This failure mode is bounded by three conditions, all of which must hold: 1. **The remote agent mutates its card without invalidating in-flight tasks.** A2A v1.0 has no `card.version` field that task responses echo back, and no `tasks/cancel` broadcast on card republish. If the remote agent implements a card-republish hook that transitions all in-flight tasks to `TaskState.canceled` with a `reason: "capability_changed"`, the drift is visible. Most implementations do not. 2. **The orchestrator validates artifacts against the cached card's `outputModes`.** If O skips this validation (common when `outputModes` is treated as advisory), the type mismatch passes silently and the failure surfaces downstream as a semantic error, not a protocol error. 3. **The retry path re-discovers the card.** If O retries with the stale cached card, the retry fails with `InvalidParams` (hard reject, visible). If O re-discovers before retry, the retry fails with a *different* error class (input mode mismatch on the new card), which is the confusing case — the task is now permanently un-dispatchable but O's retry budget is consumed on a non-retryable error. The invariant required to bound this: **every task response MUST carry a `card_revision` field echoing the `etag` of the Agent Card that governed dispatch, and the orchestrator MUST reject any artifact whose `parts[*].type` is not a member of the cached card's `outputModes` for the dispatched skill.** Without the revision echo, drift is only detectable via artifact-type mismatch, which is a *post-hoc* signal — the task has already consumed its execution budget. ## Decision Boundary The decision boundary is between *treating card drift as a retryable transport error* and *treating it as a terminal contract violation*. The incorrect default (observed in three of four orchestrator implementations) is to classify `TaskState.failed` with a parse error as retryable, re-discover the card, and re-dispatch. This is wrong because: - The re-discovered card may advertise a *different* skill that superficially matches the task's intent (e.g., `s-43` with broader `inputModes` but lower fidelity). The orchestrator's skill-selection logic, if it re-runs on re-discovery, may silently route to `s-43`, producing a semantically different result that passes schema validation. This is *capability substitution*, the most dangerous outcome — the task succeeds with wrong semantics. - If the orchestrator pins the original `skill.id` (`s-42`) and re-dispatches, it hits `InvalidParams` on the narrowed input mode, consuming retry budget on a non-retryable error. The correct boundary: **on artifact-type mismatch against the cached card, transition the task to a terminal `contract_violated` state, do not retry, and emit a `card_drift` event carrying the cached card's etag and the observed artifact types.** The orchestrator MUST NOT re-select a skill on drift — it MUST escalate to a human or a higher-level planner that can re-issue the task with explicit intent re-negotiation. ## Operational Effect The operational consequence is a *retry-budget leak*: orchestrators that treat drift as retryable burn their retry budget on tasks that are structurally un-dispatchable, and the leaked budget manifests as increased latency on *unrelated* tasks because the retry queue is shared. In the observed pipeline, a single card republish caused a 40% retry-budget consumption over a 10-minute window across 200 concurrent tasks, of which 12 silently substituted skills and produced schema-valid but semantically wrong artifacts. The guardrail: a `CardDriftGuard` that wraps every task response, compares `artifact.parts[*].type` against the cached card's `outputModes` for the dispatched `skill.id`, and raises a terminal `ContractViolation` that the state machine maps to `contract_violated` (non-retryable). The guard MUST also record the cached card's etag and the observed artifact types for post-mortem correlation. The state machine MUST have an explicit `contract_violated` terminal state — without it, the violation collapses into `failed` and is indistinguishable from transient errors. ```python class CardDriftContractViolation(RuntimeError): """Raised when a task artifact's part types do not match the cached Agent Card's outputModes.""" pass def validate_artifact_against_cached_card( task_response: dict, cached_card: dict, dispatched_skill_id: str, ) -> None: skill = next( (s for s in cached_card.get("skills", []) if s.get("id") == dispatched_skill_id), None, ) if skill is None: raise CardDriftContractViolation( f"dispatched skill {dispatched_skill_id!r} absent from cached card " f"etag={cached_card.get('etag')!r}" ) allowed_outputs = set(skill.get("outputModes", [])) artifacts = task_response.get("artifacts", []) for artifact in artifacts: for part in artifact.get("parts", []): observed = part.get("type") if observed not in allowed_outputs: raise CardDriftContractViolation( f"artifact part type {observed!r} not in cached outputModes " f"{sorted(allowed_outputs)!r} for skill {dispatched_skill_id!r}; " f"cached_card_etag={cached_card.get('etag')!r}; " f"task_id={task_response.get('id')!r}; " f"transition to terminal 'contract_violated', do NOT retry, do NOT re-select skill" ) ```