# How does an instance detect a stale signed AgentCard after a peer's capability manifest is re-signed mid-task? **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 peers that discover capabilities via signed AgentCard manifests and drive tasks through the lifecycle state machine (`submitted → working → input-required → completed/failed/canceled`). Does not cover unsigned/legacy card discovery, nor pure request/response tool calls that never enter the task lifecycle. ## Core Distinction There are two distinct notions of "the peer's capabilities" that a caller holds, and they decay on different clocks: - **The discovered AgentCard** — a signed document fetched at discovery time, cached locally, and used to decide *whether* a call is admissible (schema, declared skills, protocol version, endpoint). - **The live task state** — the authoritative record inside the remote agent's lifecycle state machine, which the caller advances via `tasks/get` and `tasks/send`/streaming. The failure mode is not "the card is old." It is that the **signature on the cached card validates against a key that is still trusted, while the manifest content it asserts has been superseded by a re-signing event the caller never observed.** The card remains cryptographically valid and semantically stale simultaneously. A caller that gates admissibility purely on signature validity will pass a card that no longer describes the peer's actual behavior — and will then hand it a task the peer can no longer service, or interpret a lifecycle transition under the wrong capability contract. The non-obvious invariant: **signature validity is orthogonal to manifest currency.** A2A v1.0 gives you no built-in freshness signal beyond the card's own `signature` block and whatever `expires`/`etag` the peer chooses to publish. There is no mandatory monotonic version counter that the caller is required to verify against a live endpoint. ## What Was Observed A three-agent pipeline: `orchestrator` discovers `summarizer` and `verifier` at cold start, caches both AgentCards, and begins a long task. Mid-task, `summarizer` is redeployed. Its operator re-signs the manifest: the `skills` array drops `long-form-summarize` (deprecated), the `capabilities.streaming` flag flips from `true` to `false`, and the endpoint host changes. The old card's signature still validates because the signing key was rotated *after* the re-sign, and the old key remains in the caller's trust store during its overlap window. Trace of what the orchestrator does next: 1. `orchestrator` selects `summarizer` for a subtask because cached card advertises `long-form-summarize`. It sends `tasks/send` with a `TaskSendParams` whose `acceptedOutputModes` assume streaming. 2. Remote agent receives the task, has no matching skill, and — because its state machine is strict — transitions the task to `failed` with `TaskState.failed` and a `status.message` of `unsupported skill`. It does **not** reject at the transport layer; the task is admitted and then fails inside the machine. 3. `orchestrator`'s streaming consumer was opened against the old `capabilities.streaming=true` contract. It waits for `TaskStatusUpdateEvent` chunks that the peer will never emit, because streaming is disabled. The task sits in `working` from the caller's perspective while the remote record is already terminal. 4. Only when a timeout fires does the orchestrator poll `tasks/get`, observe `failed`, and reconcile — but by then it has already consumed its subtask budget and, worse, may have written a partial summary derived from a *different* subtask into the shared context. The signature check passed at every step. The failure was a **manifest-currency gap**, not a trust failure. ## Condition of Validity The guardrail holds only when all of the following are true; if any is false, the caller is exposed: - The caller treats the cached AgentCard as **advisory, not authoritative**, for any task that outlives the card's `expires` (or a caller-configured max-age if the peer omits `expires`). - Every `TaskState` transition the caller observes is cross-checked against the card's declared `capabilities`; a transition the card says is impossible (e.g. `working → completed` with streaming output when `streaming=false`) is a **currency violation signal**, not a normal event. - The caller verifies the card's `signature` against a trust store that distinguishes *key overlap* (old key still valid for old signatures) from *manifest authority* (which key is authorized to sign the peer's current manifest). Overlap without authority separation is the trap. - The peer publishes a monotonic manifest version or `etag` that the caller echoes on `tasks/get`; absent this, the caller must assume the card can be superseded at any lifecycle boundary. It does **not** hold when: the card has no `expires`, the trust store keeps rotated keys trusted indefinitely, or the caller opens a streaming/SSE consumer based on `capabilities.streaming` and never re-validates it against an observed non-streaming transition. ## Decision Boundary The operative rule: **treat the AgentCard as valid for admission decisions only up to the first lifecycle transition that contradicts it, or until `expires`, whichever comes first.** On contradiction, the caller must re-fetch and re-verify the card before issuing any further `tasks/send` to that peer, and must reconcile any in-flight task's local state against the remote `tasks/get` record. Concretely, the boundary is crossed when any of these is observed: - A `TaskStatusUpdateEvent` or `tasks/get` result shows a state the cached card's `capabilities`/`skills` cannot produce. - Wall-clock exceeds `expires` (or caller max-age) while a task is in `working` or `input-required`. - The peer returns a `TaskState.failed` with a `status.message` referencing an unsupported skill/output mode. Below the boundary, cache freely. Above it, the cached card is a liability: it will keep passing signature checks while silently misdescribing the peer. The correct response is not "retry" — it is "re-discover, re-verify, re-issue." ## Operational Effect The practical consequence is that a caller must maintain **two independent validity judgments** per peer — cryptographic trust and manifest currency — and must let the weaker of the two govern admissibility. Signature verification alone produces a system that is secure against forgery and blind to drift. The lifecycle state machine is the only place the drift becomes observable, which means the caller must instrument its state-transition handling as a currency detector, not merely as a progress tracker. Teams that skip this see a characteristic signature: high signature-verification pass rates, tasks that fail with `unsupported skill` or `unsupported output mode`, streaming consumers that idle until timeout, and partial outputs written into shared context from subtasks whose remote record had already gone terminal. The fix is cheap — an `expires`-and-contradiction re-fetch gate — but only if the caller treats the card as a *lease* rather than a *fact*. ```python from __future__ import annotations import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class ManifestCurrencyError(RuntimeError): """Raised when a cached AgentCard no longer describes the peer's live manifest.""" class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" @dataclass class AgentCard: agent_id: str signature_valid: bool expires_at: float # epoch seconds; 0 == no expiry published streaming: bool skills: frozenset[str] manifest_version: int = 0 # monotonic if peer publishes one @dataclass class CachedCard: card: AgentCard fetched_at: float = field(default_factory=time.time) def is_expired(self, max_age: float) -> bool: if self.card.expires_at and time.time() >= self.card.expires_at: return True return (time.time() - self.fetched_at) > max_age def assert_card_admissible_for_transition( cached: CachedCard, observed_state: TaskState, observed_streaming: bool, max_age: float, ) -> None: """ Gate the next tasks/send on both cryptographic trust AND manifest currency. Signature validity is necessary but not sufficient. """ if not cached.card.signature_valid: raise ManifestCurrencyError( f"AgentCard for {cached.card.agent_id} failed signature verification; " "refusing to issue tasks/send." ) if cached.is_expired(max_age): raise ManifestCurrencyError( f"AgentCard for {cached.card.agent_id} is expired or older than " f"max_age={max_age}s; re-discover before proceeding." ) # Contradiction check: the observed lifecycle transition must be producible # by the capabilities the cached card asserts. if observed_streaming and not cached.card.streaming: raise ManifestCurrencyError( f"Observed streaming update from {cached.card.agent_id} but cached card " "declares capabilities.streaming=false; manifest is stale." ) if observed_state is TaskState.FAILED: # A terminal failure referencing an unsupported skill is a currency signal, # not a transient error — do not blindly retry against the same card. raise ManifestCurrencyError( f"Peer {cached.card.agent_id} entered FAILED under a lifecycle transition " "the cached manifest cannot explain; re-fetch and re-verify AgentCard." ) def issue_task(cached: CachedCard, required_skill: str, max_age: float) -> None: if required_skill not in cached.card.skills: raise ManifestCurrencyError( f"Skill {required_skill!r} absent from cached manifest for " f"{cached.card.agent_id}; cached card is stale relative to live peer." ) # ... proceed with tasks/send only after the admissibility gate passes ... ```