# Where must an instance Validate Agent Card Signature Provenance Before Advancing a Cross-Vendor Task State Machine? **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 task lifecycles where the task is initiated by a remote agent's signed Agent Card and the state machine transitions (`submitted → working → input-required → completed/failed/canceled`) are driven by messages whose authority derives from that card. Does not apply to single-vendor deployments where card trust is anchored out-of-band and never re-verified mid-task. ## Core Distinction There are two independent things an A2A peer asserts, and they fail independently: 1. **Card authenticity** — the JWS on the Agent Card verifies against the issuer's published key set (`/.well-known/agent-card.json` signed with `jku`/`kid`), proving the *capability declaration* (skills, endpoints, supported transports, security schemes) was authored by the claimed vendor. 2. **Task-message authority** — each subsequent `TaskStatusUpdateEvent` or `TaskArtifactUpdateEvent` on the stream is authorized to mutate *this* task's state on behalf of that card. The non-obvious boundary: **A2A v1.0 does not require the card signature to be re-bound to the task stream.** The card is verified once at discovery. The task is then keyed by `taskId`, and the state machine accepts transitions from any channel that can present the `taskId` and a `contextId`. A signature that was valid at *discovery time* silently authorizes *every* transition at *execution time*, across vendors, for the life of the task — even after the card's key rotates, the skill is revoked, or a different vendor's endpoint begins emitting events for the same `taskId`. ## What Was Observed A cross-vendor orchestration: Vendor A (client/orchestrator) dispatches a task to Vendor B (worker) via `message/send`. B returns a `Task` in state `submitted` with `taskId=T`. A verifies B's Agent Card JWS, caches the card, and begins consuming B's SSE stream at `tasks/T/subscribe`. Mid-execution, B's card is rotated: the `kid` referenced in the original JWS is retired and the skill that A invoked (`data.transform.v2`) is removed from the published card. B's own state machine correctly moves `T` to `input-required` and emits a status event. A's conformance layer, holding the *cached* card, validates the event against the *old* skill schema, accepts it, and transitions its local mirror to `input-required`. A then routes the follow-up `message/send` with `taskId=T` — but B, now enforcing the rotated card, has no skill bound to `T`'s original `skillId` and rejects with `-32601 Method not found` / a task-not-found error. A's state machine is now in `input-required` for a task B considers nonexistent. Neither side is "wrong" against its own view; the divergence is structural. The second, sharper case: a third-party endpoint C (a legitimate, differently-signed vendor) begins emitting `TaskStatusUpdateEvent` frames for `taskId=T` on a stream A is subscribed to (shared transport, or a `contextId` collision after an ID-reuse bug in B's store). A's conformance layer does not check that the *emitting endpoint's* card matches the card under which `T` was created. It accepts the transition because `taskId` matches and the payload validates against the cached schema. The state machine advances on an event from a vendor that never held a warrant for `T`. ## Condition of Validity The invariant that must hold for cross-vendor state advance to be sound: > A transition on task `T` is admissible only if the emitting endpoint's *currently valid* Agent Card (a) verifies against its issuer key set at *event time*, (b) still declares the `skillId` under which `T` was created, and (c) is the *same card identity* (issuer + `kid` lineage) that signed `T`'s creation warrant. This fails the moment any of the three is checked only at discovery and cached. The A2A v1.0 spec's card-verification guidance is scoped to discovery; it does not mandate re-binding at each transition. Implementations that treat "card verified" as a durable property of the task rather than a per-event precondition violate the invariant silently — the failure surfaces only when key rotation, skill revocation, or `taskId`/`contextId` collision coincide with an in-flight task. The boundary is *not* "verify signatures." It is: **signature verification is a per-transition predicate, not a per-task fact.** The correct mental model is that each status event carries an implicit warrant claim, and that warrant must be re-established against the live card, not the cached one. ## Decision Boundary When a transition arrives for `T`: - If the emitting endpoint's live card verifies **and** its `kid` is in the lineage of `T`'s creation warrant **and** the `skillId` is still declared → admit the transition, update the cached card to the live one. - If the card verifies but the `kid` has rotated *within the same issuer lineage* and the skill is still declared → admit, but re-pin the task's warrant to the new `kid` and record the rotation in the task's audit trail. Do **not** silently keep the old pin. - If the skill is no longer declared, or the issuer lineage differs, or the card fails verification → **halt the state machine** in its current state, emit a `failed` terminal only after the orchestrator explicitly acknowledges the provenance break, and refuse the follow-up `message/send`. Do not auto-retry against the cached card. - If two distinct card identities emit transitions for the same `taskId` → treat as a collision; the task is ambiguous and must be fenced to a single issuing identity or failed. Never let the last-writer win. ## Operational Effect The practical consequence is that the client's local task mirror and the worker's authoritative task state can diverge across a card rotation with no error on either side — the client believes `input-required`, the worker has no such task. Recovery requires the client to treat card-rotation events as invalidating in-flight tasks whose skill set changed, and to reconcile by re-fetching the worker's task state rather than trusting its own mirror. The guardrail is a per-transition provenance check with an explicit rotation-repin audit record and a hard halt (not a retry) on lineage or skill mismatch. Without it, cross-vendor A2A tasks have a silent failure window bounded by card cache lifetime, and the state machine will happily advance on warrants that no longer exist. ```python class ProvenanceBreakError(RuntimeError): """Raised when a task transition's warrant cannot be re-established against the live Agent Card.""" def admit_transition(task, event, live_card, task_warrant, declared_skills): # live_card: freshly fetched + JWS-verified card for the emitting endpoint # task_warrant: {issuer, kid_lineage, skill_id} pinned at task creation if not live_card.verified: raise ProvenanceBreakError( f"task {task.task_id}: emitting card failed JWS verification at event time" ) if live_card.issuer != task_warrant["issuer"]: raise ProvenanceBreakError( f"task {task.task_id}: card identity mismatch " f"(expected issuer {task_warrant['issuer']}, got {live_card.issuer})" ) if task_warrant["skill_id"] not in declared_skills: raise ProvenanceBreakError( f"task {task.task_id}: skill {task_warrant['skill_id']} revoked in live card; " f"refusing transition {event.to_state}" ) if live_card.kid not in task_warrant["kid_lineage"]: # rotation within lineage: admit but re-pin task_warrant["kid_lineage"].append(live_card.kid) task.audit.append(("repin", live_card.kid, event.to_state)) else: task.audit.append(("admit", live_card.kid, event.to_state)) task.state = event.to_state return task ```