# What happens when an instance accepts a delegated artifact whose declared schema digest was computed over the pre-mutation Agent Card **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 task lifecycle negotiation where a delegating agent (client role) hands a Task with artifact exchange to a peer (server role) whose Agent Card is fetched from a different vendor and may be cached, re-signed, or mutated between discovery and task submission. Does not apply to single-vendor intra-cluster calls where the card is pinned by digest at deploy time and never re-fetched. ## Core Distinction The failure is not "the agent card changed." Cards change all the time, and A2A v1.0 explicitly allows re-signing and re-issuance. The failure is the **digest-binding gap between artifact schema negotiation and the card the digest was computed over**. When a client negotiates an artifact schema, it does so against a `schema` field declared inside the remote `AgentSkill` object embedded in the remote Agent Card. The client computes a canonical digest of that schema, embeds it in the outgoing `TaskSendParams` as a `schemaDigest` assertion, and proceeds. The peer validates the assertion against *its current* skill declaration. The boundary condition: if the peer's card was re-issued (new signature, new `updatedAt`, potentially new schema `$id` or field ordering) *between* the client's `GET /.well-known/agent.json` and the peer's own internal re-read of its skill manifest at task-accept time, the digest the client computed over the *old* card will not match the digest the peer computes over its *current* skill. The peer is contractually correct to reject. But because A2A v1.0 treats digest mismatch as a *soft* negotiation error (`INVALID_PARAMS` with `data.retryable = true`), the client retries — and retries against the same stale cached card. The loop terminates only when the client's cache TTL expires, which in cross-vendor deployments is frequently longer than the peer's card rotation interval. ## What Was Observed A three-hop delegation chain: orchestrator `O` (vendor A) → worker `W` (vendor B) → artifact validator `V` (vendor C). `O` fetched `W`'s card at `t=0`, computed `schemaDigest = sha256(canonical_json(W.skills[0].inputModes.schema))`, and dispatched a `TaskSendParams` carrying that digest plus a `delegatedArtifact` blob whose `contentType` was `application/vnd.example.invoice+json`. At `t=+40s`, `W`'s control plane rotated its card: the skill schema's `properties` map was reordered (semantically identical, byte-different), a new optional field `taxJurisdiction` was added, and the card was re-signed. `W`'s task acceptor, on receipt of `O`'s task, recomputed the canonical digest from its *live* in-memory skill manifest — which reflected the rotation — and compared it to `O`'s asserted digest. Mismatch. `W` returned: ``` {"jsonrpc":"2.0","id":"...","error":{"code":-32602, "message":"artifact schema digest mismatch", "data":{"expected":"sha256:9f2c...","received":"sha256:1a7e...","retryable":true}}} ``` `O`'s retry logic, per A2A v1.0 §7.4 guidance ("clients SHOULD retry retryable negotiation errors with exponential backoff"), retried the identical payload — same digest, same artifact — five times over 90 seconds. Each retry hit the same mismatch. `O` then escalated to a fallback path and re-fetched the card, but its HTTP cache layer had a 5-minute `max-age` from the original response and served the *pre-rotation* card. `O` recomputed the same digest. The sixth retry failed identically. The task was abandoned at `t=+6m`, and `W` later reported an orphaned task in `submitted` state with no terminal transition — a lifecycle leak. The non-obvious part: `W`'s digest was computed over the *post-rotation* manifest, but `W`'s own card endpoint still served the *pre-rotation* card for another 12 seconds due to an internal CDN edge lag. So for a window, `W` was internally inconsistent: its card said schema version `1.2`, its task acceptor validated against `1.3`. A third-party `V` that fetched `W`'s card during that window and then submitted a task would have hit the same mismatch from the opposite direction. The mismatch was not client-side staleness alone — it was a **bilateral split-brain between the card-serving path and the task-accepting path within `W`**. ## Condition of Validity The invariant that A2A v1.0 implicitly assumes but does not enforce is: > For any given `(agentId, skillId)`, the schema declared in the Agent Card served at `/.well-known/agent.json` at time `t` MUST be byte-identical (after canonicalization) to the schema used by the task acceptor to validate `schemaDigest` assertions for tasks accepted at time `t`. This invariant is violated whenever the card publication pipeline and the task-acceptor skill manifest are not updated atomically. In practice this happens in three concrete configurations: 1. **CDN/edge cache lag on the card endpoint.** Card is rotated in origin, but edge nodes serve stale for `max-age`. Task acceptor reads origin directly. Window of inconsistency = edge TTL. 2. **Asynchronous skill manifest propagation.** Card service reads from a config store; task acceptor reads from a separate in-process cache refreshed on a different schedule. Window = propagation skew between the two. 3. **Signature-then-schema ordering.** Card is re-signed with the new schema hash, but the schema object itself is updated in a second write. If the card endpoint serves between the two writes, it advertises the new signature over the old schema — a card that *claims* to describe a schema it does not contain. The boundary is sharp: the failure only manifests when a delegated artifact carries a `schemaDigest` assertion (i.e., the client is doing schema-pinned delegation) **and** the client's card fetch and the peer's task accept are separated by a rotation event. Without the digest assertion, the client would just send the artifact and the peer would validate structurally — no mismatch, no retry loop, just a possible downstream parse failure. The digest assertion is what converts a benign race into a hard negotiation failure. ## Decision Boundary The operational decision is: **when a `schemaDigest` mismatch is returned, do not retry the same payload.** Treat the mismatch as evidence that the client's view of the peer's schema is stale or that the peer is internally inconsistent, and force a re-fetch of the card *bypassing all caches* before recomputing. Concretely: - If the re-fetched card's schema digest still does not match the peer's `expected` digest from the error response, the peer is internally inconsistent (card-serving vs. task-accepting split-brain). Escalate; do not retry. File against the peer's control plane. - If the re-fetched card's digest *does* match the peer's `expected`, the client had a stale cache. Recompute the canonical digest over the fresh card, re-sign the `TaskSendParams`, and retry exactly once. - If the peer returns `retryable: false` on a digest mismatch, the peer is asserting it will never accept that schema — a hard version pin. Do not re-fetch; fail the delegation and surface to the orchestrator as a capability negotiation failure. The invariant guardrail the client must implement: **cache the card by `(agentId, signature, updatedAt)` tuple, not by URL, and invalidate on any digest mismatch regardless of TTL.** The guardrail the *server* must implement: **serve the card and validate task digests from the same atomic snapshot of the skill manifest**, with a monotonic `manifestVersion` included in both the card and the task-accept error response so clients can detect split-brain. ## Operational Effect Without the guardrails, the observable effect is a **retry-amplification loop that consumes the client's token budget and the peer's task-accept capacity while producing zero progress**, and leaves orphaned tasks in `submitted` state on the peer. In the observed incident, `W` accumulated 6 orphaned tasks per affected delegation, each holding a task slot and, in `W`'s implementation, a pre-allocated artifact staging buffer. At scale (a fleet of 40 orchestrators each delegating ~200 tasks/hour to `W`), the rotation window of 40 seconds produced ~1,100 orphaned tasks and ~1,100 staging buffers held for the peer's 30-minute orphan-reaper interval — enough to exhaust `W`'s staging quota and cause it to start rejecting *unrelated* tasks with `RESOURCE_EXHAUSTED`, which is a misleading error that sends other clients down the wrong diagnostic path. With the guardrails, the same rotation event produces: one mismatch per affected client, one cache-bypassing re-fetch, one recomputed digest, one successful retry — or, in the split-brain case, one clean escalation with the `manifestVersion` mismatch surfaced explicitly, and the peer's own control plane alerted to the card-serving lag. The orphaned-task count drops to zero because the client never retries a payload it knows is stale. The general lesson for cross-vendor A2A deployments: **a `schemaDigest` assertion is a claim about the peer's state at accept-time, not at fetch-time.** Any client that computes it at fetch-time and reuses it across a retry is asserting something it cannot know. The digest must be recomputed from a cache-bypassing fetch on every retry, and the peer must expose a `manifestVersion` that lets the client distinguish "I am stale" from "you are inconsistent." Without that distinction, the retry loop cannot be broken by either side alone. ```python import hashlib import json from dataclasses import dataclass from typing import Any class SchemaDigestMismatch(RuntimeError): """Raised when a delegated artifact's schemaDigest does not match the peer's live skill manifest.""" pass class PeerInternalInconsistency(SchemaDigestMismatch): """Raised when the peer's card and task-acceptor disagree on the schema digest (split-brain).""" pass @dataclass class AgentCard: agent_id: str signature: str updated_at: str manifest_version: int skill_schema: dict[str, Any] def canonical_digest(schema: dict[str, Any]) -> str: canonical = json.dumps(schema, sort_keys=True, separators=(",", ":")) return "sha256:" + hashlib.sha256(canonical.encode("utf-8")).hexdigest() def negotiate_delegation( card: AgentCard, peer_expected_digest: str, peer_manifest_version: int, cache_bypass_fetch, max_attempts: int = 2, ) -> str: """ Attempt to reconcile a schemaDigest mismatch returned by a peer. Returns the accepted digest. Raises on unrecoverable mismatch. """ digest = canonical_digest(card.skill_schema) if digest == peer_expected_digest: return digest # Mismatch: force a cache-bypassing re-fetch before any retry. fresh = cache_bypass_fetch(card.agent_id) fresh_digest = canonical_digest(fresh.skill_schema) if fresh_digest != peer_expected_digest: # Peer's card and task-acceptor disagree. Do NOT retry. raise PeerInternalInconsistency( f"peer {card.agent_id} split-brain: card digest {fresh_digest} " f"!= acceptor digest {peer_expected_digest} " f"(card manifest_version={fresh.manifest_version}, " f"acceptor manifest_version={peer_manifest_version})" ) if fresh.manifest_version == card.manifest_version: # Same manifest version, different digest — canonicalization bug on one side. raise SchemaDigestMismatch( f"peer {card.agent_id} same manifest_version={fresh.manifest_version} " f"but digest differs: {digest} vs {fresh_digest}" ) # Client was stale; fresh card now matches peer's expectation. Retry once with fresh digest. if max_attempts <= 0: raise SchemaDigestMismatch( f"peer {card.agent_id} digest reconciliation exhausted attempts" ) return negotiate_delegation( fresh, peer_expected_digest, peer_manifest_version, cache_bypass_fetch, max_attempts - 1, ) ```