# What happens when an instance trusts a signed Agent Card whose capability manifest outlives the task lifecycle state machine it advertises **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 peer discovery where an orchestrator fetches `/.well-known/agent.json`, verifies the JWS signature on the capability manifest, and then delegates tasks whose lifecycle is governed by the advertised state machine. Does not apply to in-process tool calls, MCP stdio transports, or unsigned capability documents. ## Core Distinction A signed Agent Card proves *authorship and integrity of the manifest at signing time*. It does **not** prove *liveness of the capability*, *version compatibility of the lifecycle state machine*, or *that the remote agent will honor the transitions it advertised*. The failure boundary is the gap between two clocks: the manifest's `validUntil`/signature freshness window and the per-task lifecycle FSM that the remote agent actually executes. An orchestrator that conflates "signature verifies" with "capability is currently executable under the advertised FSM" will hand off tasks into a state machine that has silently diverged — typically because the remote agent was redeployed with a new FSM while the well-known document was cached, CDN-pinned, or signed with a long validity window. The non-obvious part: the signature check *passes*. The card is authentic. The `capabilities[].lifecycle.states` array is exactly what the signer intended. But the running process behind the well-known URI is a different build, with a different FSM, and the handoff enters a transition the remote no longer recognizes — producing a task that is neither `failed` nor `working`, but orphaned in a state the orchestrator's own FSM has no edge for. ## What Was Observed An orchestrator (`A`) discovers peer `B` via `GET https://b.example/.well-known/agent.json`. The card is JWS-signed by `B`'s key, `validUntil` set 30 days out. The card advertises: - `capabilities[0].lifecycle`: `submitted → working → (completed | failed | canceled)`, with `input-required` as a resumable pause state. - `capabilities[0].manifestHash`: `sha256:9f3c…` - `signature.alg`: `ES256`, `kid: b-2025-q2`. `A` caches the card for its full validity window (a defensible optimization — re-fetching and re-verifying on every handoff is expensive). It delegates task `T1`, transitioning locally to `submitted`, then to `working` on the first `TaskStatusUpdateEvent`. Mid-task, `B` emits `TaskStatusUpdateEvent{state: "input-required", resumeToken: "..."}`. `A` pauses, collects user input, and resumes via `tasks/resume`. `B` returns `-32602 InvalidParams: unknown state 'input-required'`. Root cause: `B` was redeployed three days after the card was signed. The new build's FSM is `submitted → working → (completed | failed)`, with `input-required` replaced by a `working` sub-state gated on `partialArtifact`. The new card (signed under `kid: b-2025-q3`) is live at the well-known URI, but `A` never re-fetched because its cache had not expired. `A`'s signature verification of the *cached* card succeeds — the signature is valid, the key is trusted, the document is unmodified. Every cryptographic check passes. The task is nonetheless unroutable. The second-order failure is worse: `A`'s local FSM has an edge `working → input-required → working`. When resume fails with `-32602`, `A` has no defined transition out of `input-required` except `resume`. It retries resume (idempotency assumption), gets the same error, and the task sits in `input-required` until a wall-clock timeout fires — but the timeout handler expects the remote to have emitted a terminal event, and `B` considers `T1` already `failed` (it never had `input-required`). The two FSMs disagree about the terminal state of the same task ID. ## Condition of Validity The invariant that must hold for cached-card delegation to be safe: > For every task `T` delegated to peer `B`, the FSM version `A` uses to interpret `B`'s status events must equal the FSM version `B` is currently executing, and the signed card `A` holds must be the one `B` would serve *right now*. This is violated whenever any of the following diverge between signing time and delegation time: 1. **FSM version** — the set of legal states and transitions in the remote process. 2. **Manifest hash** — `B`'s running build embeds a `manifestHash` it will echo in error responses; if it differs from the card `A` verified, the card is stale. 3. **Key epoch** — `kid` rotation. A cached card signed under a retired `kid` may verify against a still-trusted key while the live endpoint expects the new epoch, meaning the cached card is a *historical* artifact, not a *current* capability claim. The signature is necessary but not sufficient. The sufficient condition requires binding the FSM version into the task handoff itself, not into the discovery document alone. ## Decision Boundary The boundary is: **does the handoff carry the FSM version the orchestrator will use to interpret events?** - If the card's `lifecycle.fsmVersion` is echoed in the `tasks/send` request and the remote rejects on mismatch (`-32001 FSMVersionMismatch`), the divergence is bounded — the task fails fast, before any state is entered. - If the handoff carries only `capabilityId` and `manifestHash`, the remote *cannot* detect that the orchestrator is interpreting its events under a retired FSM. Divergence is unbounded until a transition is attempted that the remote rejects, at which point the orchestrator's local state is already committed. The practical rule: **signature validity is a property of the document; FSM compatibility is a property of the session.** Cache the document, but re-negotiate the FSM version on every task handoff, or carry it in the resume token so a stale orchestrator cannot resume into a state the remote has retired. Guardrails that bound the failure: - Include `fsmVersion` and `manifestHash` in every `Task` object; remote rejects non-matching `fsmVersion` at `send`, not at `resume`. - Treat `-32602` on a resume as a *terminal* signal, not retryable — it means the FSM edge no longer exists, so transition locally to `failed` with reason `fsm-diverged`, do not loop. - Cap card cache TTL at `min(validUntil, fsmVersionEpoch)`, where `fsmVersionEpoch` is the last time the peer's `kid` rotated. ## Operational Effect Without the handoff-level FSM binding, stale-card delegation produces tasks that are simultaneously `input-required` (orchestrator view) and `failed` (remote view) — a split-brain over a single task ID. The orchestrator's retry loop burns its token budget re-sending resume requests that the remote deterministically rejects, and the wall-clock timeout eventually reaps the task without ever reconciling the two terminal states. Downstream auditors reading the orchestrator's event log see a task that paused and vanished; the remote's log shows a task that failed immediately. Neither log is wrong; they describe different FSMs. The fix is architectural, not cryptographic: bind the lifecycle state machine version into the task transport, and make FSM-mismatch a first-class, fail-fast rejection at `send` time rather than a silent divergence discovered at `resume`. ```python class FSMDivergenceError(RuntimeError): """Raised when the orchestrator's cached Agent Card FSM no longer matches the remote agent's executing state machine at handoff time.""" pass def delegate_task(card: dict, remote_fsm_version: str, task: dict) -> dict: """ card: JWS-verified Agent Card (may be cached/stale) remote_fsm_version: version echoed by the live endpoint, obtained at send-time task: task payload to hand off """ advertised = card["capabilities"][0]["lifecycle"]["fsmVersion"] if advertised != remote_fsm_version: raise FSMDivergenceError( f"cached card advertises fsmVersion={advertised!r} but remote " f"executes fsmVersion={remote_fsm_version!r}; signature is valid " f"but lifecycle states are not interoperable — refusing handoff" ) task["fsmVersion"] = advertised task["manifestHash"] = card["capabilities"][0]["manifestHash"] return task def handle_status_event(event: dict, local_fsm: dict, task_id: str) -> str: """ local_fsm: mapping of state -> allowed next states """ state = event["state"] current = local_fsm.get("__current__", {}).get(task_id) if current is None: raise FSMDivergenceError( f"event for unknown task {task_id!r}: local FSM has no entry, " f"remote emitted state={state!r}" ) if state not in local_fsm.get(current, []): raise FSMDivergenceError( f"illegal transition {current!r} -> {state!r} for task {task_id!r}; " f"remote FSM has diverged from advertised card" ) return state ```