# What structural signals indicate an A2A v1.0 Agent Card is stale-but-valid: the `updatedAt` monotonicity trap in cross-vendor task lifecycle negotiation **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 (and v0.3-compatible) agent-to-agent discovery where a remote `AgentCard` is cached and used to drive `tasks/send`/`tasks/get` lifecycle negotiation across vendor boundaries. Does not apply to single-vendor intra-cluster meshes where the registry is the sole authority and card TTLs are enforced by the transport. ## Core Distinction The naive discovery invariant is: *"a card whose `signatures` verify and whose `updatedAt` is newer than the cached copy is authoritative."* This is wrong in a specific, exploitable way. A2A v1.0 requires the Agent Card to carry `capabilities`, `skills[]` (with per-skill `inputModes`/`outputModes`), and `defaultInputModes`/`defaultOutputModes`, but it does **not** mandate that `updatedAt` advance on every semantically meaningful change. Vendors routinely republish a card with an unchanged `updatedAt` after rotating a skill's declared MIME types, because the field is populated from the artifact build timestamp, not the card mutation timestamp. The real invariant is weaker and structural: **a card is only trustworthy for a given skill if the `(skill.id, skill.inputModes, skill.outputModes)` triple is byte-identical to the triple that was in force when the negotiating peer last completed a task against that skill.** Version strings, `updatedAt`, and even signature freshness are all lossy proxies. The structural signal that distinguishes *stale-but-valid* from *fresh-and-valid* is the **mismatch between the card's declared `outputModes` and the `Artifact.parts[].kind` actually emitted at task completion** — not the card's own metadata. ## What Was Observed A two-vendor pipeline: an orchestrator agent (`agent-A`, vendor X) discovers a media-transcoding skill on `agent-B` (vendor Y) via `/.well-known/agent.json`. The card declares: ``` skills: [{ id: "transcode", inputModes: ["application/json"], outputModes: ["video/mp4", "video/webm"] }] updatedAt: "2025-04-01T00:00:00Z" ``` `agent-A` caches this card. On 2025-05-14, vendor Y silently drops `video/webm` from the transcode skill (codec licensing) and republishes the card with the *same* `updatedAt` (build timestamp unchanged — only runtime config changed). The signature is valid; the card is "fresh" by every metadata check. `agent-A`'s negotiation logic selects `video/webm` as the requested output because it is the more bandwidth-efficient of the two declared modes. It sends `tasks/send` with `acceptedOutputModes: ["video/webm"]`. `agent-B` accepts the task (the state machine transitions `submitted → working`) because A2A v1.0 does not require the server to validate `acceptedOutputModes` against the *current* skill set at send time — validation is advisory. The task proceeds, burns 40 seconds of GPU transcode, and on `tasks/get` returns: ``` status: { state: "completed" } artifacts: [{ parts: [{ kind: "file", mimeType: "video/mp4", ... }] }] ``` The task is `completed`, not `failed`. The artifact is `video/mp4` — a mode `agent-A` explicitly did not request and cannot consume. This is the failure: **A2A v1.0 defines `completed` as terminal success without requiring artifact-mode conformance to the requested `acceptedOutputModes`.** The lifecycle state machine has no `rejected_output` state, and `failed` is reserved for execution errors, not contract violations. The downstream consequence compounds: `agent-A`'s artifact-router keys on `mimeType`, finds no handler for `video/mp4`, and raises a `KeyError` that the orchestrator interprets as a transient tool error. It retries the *same* task three times, each retry re-burning the transcode, because the card still advertises `video/webm` and the retry logic re-derives the request from the cached card. The card cache is the stale root; the retry loop is the amplifier. ## Condition of Validity The "card freshness by `updatedAt`" heuristic is valid **only** when all three of the following hold: 1. The vendor guarantees `updatedAt` is a *card-mutation* monotonic clock, not a build clock. This is unverifiable from the card itself and must be established out-of-band (contract, registry attestation, or observed history). 2. The negotiating peer validates `acceptedOutputModes ⊆ current skill outputModes` server-side at `tasks/send` and rejects with a typed error (A2A v1.0 does not require this; some vendors implement it as an extension). 3. The artifact router is mode-tolerant: it can degrade or re-negotiate on unexpected `mimeType` rather than raising. Absent (1), the card's `updatedAt` carries no information about skill-surface changes. Absent (2), a stale request is silently fulfilled with a non-conforming artifact. Absent (3), the non-conforming artifact becomes a retry storm. The condition of validity for *caching a card at all* is therefore: **cache the card, but treat the `(skill.id, inputModes, outputModes)` triple as a separate, independently-invalidated cache entry keyed by observed artifact conformance, not by card metadata.** The card is a discovery hint; the triple is a negotiated contract that must be re-confirmed on every task completion. ## Decision Boundary The boundary is drawn at task completion, not task submission. At `tasks/send`, the agent has only the card's claim. At `tasks/get` returning `completed`, the agent has ground truth: the actual `Artifact.parts[].mimeType`. The decision rule: - If `artifact.mimeType ∈ requested acceptedOutputModes` → the triple is confirmed; refresh the triple-cache entry's conformance timestamp. - If `artifact.mimeType ∉ requested acceptedOutputModes` but `∈ card.skills[id].outputModes` → the card is *internally consistent* but the server ignored the request. Treat as a negotiation bug on the peer; do **not** retry with the same card; escalate to re-discovery. - If `artifact.mimeType ∉ card.skills[id].outputModes` → the card is **stale-but-valid**: metadata checks pass, signature verifies, but the skill surface has drifted. Invalidate the triple-cache entry, force a re-fetch of the card (and if the re-fetched card still lacks the mode, mark the skill as `mode-drifted` and stop selecting it). The critical asymmetry: a `failed` task state is *safe* (no artifact, clear error, bounded retry). A `completed` task with a non-conforming artifact is *unsafe* (silent contract violation, artifact already produced, retry re-burns cost). The state machine's terminal-success semantics are the boundary that makes this failure non-obvious. ## Operational Effect Three concrete effects on a running multi-agent system: 1. **Silent artifact-mode substitution is invisible to state-machine monitoring.** Dashboards keyed on `task.status.state` show 100% `completed` while the orchestrator is dropping every artifact. The only observable is downstream consumer error rate, which is attributed to the consumer, not the negotiation. 2. **Card caches become adversarial under vendor config drift.** Because `updatedAt` is build-keyed, a vendor can change skill surfaces arbitrarily without invalidating any cache that trusts metadata. The cache must be invalidated by *observed conformance*, which means the cache is written on task completion, not on discovery. 3. **Retry amplification.** A retry loop that re-derives the request from the cached card will re-request the same unavailable mode indefinitely. The guardrail is a per-`(peer, skill.id, requestedMode)` circuit breaker that trips on the first non-conforming `completed` and forces re-discovery before any retry. The architectural invariant to enforce: **never treat `completed` as contract satisfaction; treat it as "an artifact exists," and validate the artifact against the requested modes before the task is considered consummated.** The lifecycle state machine's terminal states describe execution outcome, not negotiation outcome — the two must be tracked separately. ```python from dataclasses import dataclass, field from typing import Optional class ArtifactModeViolation(RuntimeError): """Raised when a completed A2A task returns an artifact whose mimeType does not conform to the requested acceptedOutputModes, or whose mimeType is absent from the peer's cached AgentCard skill outputModes (stale card).""" @dataclass class SkillTriple: skill_id: str input_modes: tuple[str, ...] output_modes: tuple[str, ...] conformance_confirmed_at: Optional[float] = None @dataclass class CardCache: peer: str updated_at: str skills: dict[str, SkillTriple] = field(default_factory=dict) mode_drifted: set[str] = field(default_factory=set) def validate_completed_task( cache: CardCache, skill_id: str, requested_modes: list[str], artifact_mime: str, now: float, ) -> SkillTriple: """ Called at tasks/get when state == 'completed'. Enforces the artifact-mode conformance invariant. Returns the (possibly refreshed) triple on success; raises on any non-conformance. """ triple = cache.skills.get(skill_id) if triple is None: raise ArtifactModeViolation( f"skill {skill_id!r} on {cache.peer!r} not present in cached card" ) if artifact_mime not in requested_modes: # Server ignored acceptedOutputModes. Do not retry with same card. raise ArtifactModeViolation( f"peer {cache.peer!r} skill {skill_id!r}: artifact mimeType " f"{artifact_mime!r} not in requested modes {requested_modes!r}; " f"re-discovery required before retry" ) if artifact_mime not in triple.output_modes: # Card is stale-but-valid: metadata checks pass, surface drifted. cache.mode_drifted.add(skill_id) raise ArtifactModeViolation( f"peer {cache.peer!r} skill {skill_id!r}: artifact mimeType " f"{artifact_mime!r} absent from cached outputModes " f"{triple.output_modes!r} (card updatedAt={cache.updated_at!r}); " f"card is stale-but-valid, invalidate triple and re-fetch" ) # Conformance confirmed: this is the only path that refreshes the triple. triple.conformance_confirmed_at = now cache.mode_drifted.discard(skill_id) return triple ```