# Which invariants prevent silent capability downgrades when A2A v1.0 agent cards are re-resolved mid-delegation **Date of Record:** 2026 November 25 **Scope:** Applies to cross-runtime task delegation where a delegating agent (caller) discovers a remote agent via an A2A v1.0 Agent Card, caches the negotiated skill/capability set, and later resumes or re-delegates a task after the card has been re-fetched. Does not apply to single-runtime in-process tool calls or to stateless one-shot RPC where the card is fetched and consumed within a single turn. ## Core Distinction An A2A v1.0 Agent Card is not a static contract; it is a *mutable advertisement* served from a `/.well-known/agent.json` (or equivalent discovery) endpoint. The card declares `skills`, each with an `id`, `inputModes`/`outputModes`, and optional `capabilities` (e.g., streaming, push notifications). The critical distinction is between **card identity** (the agent's stable endpoint + name) and **card content** (the skill set and modality bindings). A2A treats the card as re-fetchable, but a caller that has already committed task state — a partially executed `Task` with a `contextId` and streaming artifacts — is bound to the *content* it negotiated against, not merely the identity. The failure mode is a **silent capability downgrade**: the remote runtime redeploys, drops a skill or narrows an `outputMode`, and the caller's cached task continues against a card whose declared surface no longer covers the in-flight work. Because A2A has no mandatory content-digest in the task envelope, the downgrade is invisible until a modality mismatch surfaces deep in the execution trace. ## What Was Observed A caller runtime (`runtime-A`) discovered `runtime-B` via its card, negotiated a task using skill `summarize.v2` with `outputModes: ["text/markdown"]`, and streamed partial artifacts back over SSE. Mid-task, `runtime-B` was rolled forward to a build where `summarize.v2` was renamed `summarize.v3` and its `outputModes` narrowed to `["application/json"]`. `runtime-A` resumed the task after a checkpoint, re-fetched the card per its TTL policy, and — because it matched on the *skill name prefix* rather than the exact `id` plus content hash — accepted the new card as compatible. The resumed delegation sent a `tasks/resume` with a `contextId` bound to the old skill. `runtime-B` had no `summarize.v2` handler, fell back to a generic passthrough that emitted JSON, and returned `TaskStatus: completed` with `application/json` artifacts. `runtime-A`'s downstream parser expected markdown, silently coerced the JSON to a string, and the corruption propagated to two dependent sub-tasks before a schema assertion fired. The observable signature: a `completed` task whose artifact `mimeType` differed from the `outputModes` recorded at negotiation time, with no `TaskStatusUpdateEvent` flagging a capability change. The card re-fetch *succeeded*; validation *passed*; the semantic contract *broke*. ## Condition of Validity The invariant holds only under three simultaneous conditions, and fails silently when any is relaxed: 1. **Content-addressed card binding.** The caller must bind the in-flight task to a digest of the card content it negotiated against (skill `id` set + modality bindings), not to the endpoint or a name prefix. Without this, re-fetch is a renegotiation disguised as a refresh. 2. **Monotonic capability declaration.** A remote runtime may *add* skills on roll-forward but must not *remove* or *narrow* a skill that has live `contextId`s bound to it; removals must be advertised via a deprecation field and a grace window. A2A v1.0 does not mandate this — it is an operational invariant the deployer must enforce. 3. **Resume-time revalidation.** On `tasks/resume`, the remote must re-check that the bound skill `id` and `outputModes` still exist and match the digest in the resume envelope, and must emit an explicit `capability_changed` status rather than silently falling back. When condition 1 holds but 2 fails, you get a clean rejection (safe). When 2 holds but 1 fails, you get a silent downgrade (the observed failure). When 3 is absent, the downgrade is undetectable at resume. ## Decision Boundary The boundary is between **re-fetch-as-refresh** (safe: content digest matches, task continues) and **re-fetch-as-renegotiation** (unsafe: content digest differs, but caller proceeds because identity matched). The caller must treat a digest mismatch on an in-flight task as a hard decision point, not a warning: - If the bound skill `id` is absent from the new card → **abort and surface**, do not fall back. - If the skill `id` is present but `outputModes` no longer covers the negotiated mode → **abort**, because the remote's fallback path is unobservable. - If the skill `id` is present and modalities are a superset → **proceed**, digest update is safe. - Only a *new* task (no bound `contextId`) may negotiate against the current card freely. The trap is that A2A's discovery semantics encourage aggressive re-fetch for freshness, and freshness is exactly what makes the digest mismatch likely during a roll-forward window. Freshness and task-binding are in direct tension; the invariant resolves it by scoping freshness to new tasks and pinning in-flight tasks to their negotiated digest. ## Operational Effect Enforcing the invariant converts a class of silent, downstream-propagating corruptions into loud, localized aborts at the delegation boundary. The cost is that roll-forward windows require the remote to keep deprecated skill handlers alive until all bound `contextId`s drain — an operational burden that must be scheduled, not assumed. The benefit is that a `completed` task's artifacts are guaranteed to satisfy the `outputModes` recorded at negotiation, which is the only thing a downstream parser can rely on. Without it, every cross-runtime delegation carries an undetectable modality-drift risk proportional to the remote's deploy frequency, and the failure surfaces arbitrarily far from its cause. ```python import hashlib import json from dataclasses import dataclass class CapabilityDowngradeError(RuntimeError): """Raised when a re-fetched A2A card no longer covers an in-flight task's negotiated surface.""" @dataclass(frozen=True) class NegotiatedBinding: skill_id: str output_modes: frozenset[str] card_digest: str def digest_card(card: dict) -> str: canonical = json.dumps( { "skills": sorted( (s["id"], sorted(s.get("outputModes", []))) for s in card.get("skills", []) ) }, sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(canonical.encode()).hexdigest() def bind_task(card: dict, skill_id: str, output_mode: str) -> NegotiatedBinding: for skill in card.get("skills", []): if skill["id"] == skill_id: if output_mode not in skill.get("outputModes", []): raise CapabilityDowngradeError( f"skill {skill_id!r} does not declare outputMode {output_mode!r}" ) return NegotiatedBinding( skill_id=skill_id, output_modes=frozenset(skill["outputModes"]), card_digest=digest_card(card), ) raise CapabilityDowngradeError(f"skill {skill_id!r} absent from card at bind time") def revalidate_on_resume(binding: NegotiatedBinding, fresh_card: dict) -> None: if digest_card(fresh_card) == binding.card_digest: return for skill in fresh_card.get("skills", []): if skill["id"] != binding.skill_id: continue fresh_modes = frozenset(skill.get("outputModes", [])) if not binding.output_modes.issubset(fresh_modes): missing = binding.output_modes - fresh_modes raise CapabilityDowngradeError( f"resume rejected: skill {binding.skill_id!r} dropped outputModes {sorted(missing)} " f"since negotiation (digest {binding.card_digest[:12]} -> " f"{digest_card(fresh_card)[:12]}); refusing silent fallback" ) return raise CapabilityDowngradeError( f"resume rejected: bound skill {binding.skill_id!r} removed from card; " "in-flight contextId cannot be safely re-delegated" ) ```