# When must an instance treat a remote Agent Card as invalid mid-task rather than at discovery: signature-scope drift across A2A v1.0 task lifecycle transitions **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 deployments where a client agent caches a signed Agent Card at discovery time, then executes multi-turn tasks (input-required, auth-required, artifact streaming) against that remote agent, and where the remote agent's signing key or declared capabilities may rotate between task transitions. Does not apply to stateless single-request RPC calls or to Agent Cards fetched fresh on every request. ## Core Distinction The non-obvious boundary is not "is the signature valid." It is **at what point in the task lifecycle the signature's scope is evaluated against the state the task is actually in**. An A2A Agent Card signature attests to a *snapshot*: the `skills`, `capabilities`, `securitySchemes`, and `endpoints` declared at signing time. The task lifecycle state machine, however, is a *sequence* of transitions (`submitted → working → input-required → working → completed`, with `auth-required` and `failed` as side exits) that can span minutes to hours. The failure mode is **signature-scope drift**: the remote agent legitimately rotates its signing key, re-signs a card with narrowed `securitySchemes` or altered `capabilities.streaming`, and the client—which verified the card once at discovery—continues the task against endpoints and artifact semantics that no longer match any signed card the client holds. The distinction operators miss: **card validity is a point-in-time predicate; task continuity is an interval invariant.** A client that treats "signature verified at discovery" as a durable grant will happily accept a `TaskStatusUpdateEvent` carrying an artifact whose `mimeType` or `parts` schema violates the *now-current* card, because it never re-binds the card to the transition. ## What Was Observed A client agent (framework A) discovered a remote document-extraction agent (framework B) and cached its Agent Card. The card was signed with JWS `ES256`, `kid: b-extract-2024`, and declared `capabilities.streaming: true`, a single skill `extract.pdf`, and `securitySchemes: { oauth2: {...} }`. The task proceeded normally through `submitted → working`. At the first `input-required` transition, the operator of agent B rotated its signing key to `b-extract-2025` and re-published a card that (a) dropped `capabilities.streaming` to `false` and (b) added a required `mTLS` scheme alongside OAuth2. This was a deliberate hardening change, not an attack. The client agent, resuming from `input-required`, submitted its follow-up with the original OAuth2 bearer token only. Agent B accepted the message (its *runtime* still tolerated OAuth2 for in-flight tasks) and returned a `TaskArtifactUpdateEvent` delivered over the original SSE stream. The client accepted the artifact because its cached card said `streaming: true` and the artifact's `parts` matched the cached skill schema. The break surfaced two transitions later: agent B's runtime, now enforcing the new card, rejected the *next* message with `401` and a `securitySchemes` mismatch, but had already emitted an artifact under the old schema. The client's task state machine held a `working` task with a partially-delivered artifact set whose provenance could not be attributed to any single signed card. On resume, the client re-fetched the card, saw `mTLS` required, and had no way to determine whether the artifacts it already held were produced under the old or new authorization regime—the signature covered the card, not the artifact. Net effect: a task that never "failed" in the state-machine sense ended in an **unattributable artifact set**, and a replay for verification produced a different artifact because the remote runtime's extraction model had also been swapped under the new card's `skills` metadata. ## Condition of Validity The failure is bounded by a precise condition. Let `C_d` be the card verified at discovery (signature `S_d`, key `k_d`, capability set `Cap_d`). Let `C_t` be the card currently published at transition `t` (signature `S_t`, key `k_t`, `Cap_t`). The client is *safe* to continue the task without re-verification only if all of the following hold at every transition: 1. `k_t == k_d` (no key rotation), OR the new key is reachable through a signed key-transition chain the client can validate (`k_d` signs a JWS whose payload names `k_t`). 2. `Cap_t ⊇ Cap_d` restricted to the capabilities the task has actually *exercised* (streaming, artifact mime types, skills invoked). 3. The `securitySchemes` the client is currently presenting remain a subset of `C_t.securitySchemes`. If any condition fails, the client MUST treat `C_d` as **scope-exhausted** and re-bind the task to `C_t` before accepting any further `TaskStatusUpdateEvent` or `TaskArtifactUpdateEvent`. The invariant is: *every artifact in a task's artifact set must be attributable to a card whose capability and security declarations were valid at the transition that produced it.* Signature validity of `C_d` is necessary but not sufficient—it says nothing about `C_t`. The condition does **not** hold when the remote agent has no key-transition chain and rotates silently; in that case the client cannot distinguish legitimate hardening from a substituted agent, and must fail closed rather than re-bind. ## Decision Boundary The decision the client must make at each `input-required` / `auth-required` / resume boundary: - **Re-fetch and compare.** Fetch `C_t`, verify `S_t` against `k_t`. If `k_t` is unknown, attempt key-transition validation from `k_d`. If that fails → `CardScopeUnverifiable`, abort task, quarantine artifacts. - **Diff capability sets.** Compute `Cap_d \ Cap_t` (capabilities lost) and `Cap_t \ Cap_d` (capabilities gained). If any *exercised* capability is in the lost set → the task cannot continue under `C_t`; transition the task to `failed` with reason `capability-withdrawn`, do not silently downgrade. - **Diff security schemes.** If the scheme the client is presenting is absent from `C_t.securitySchemes` → the next message will be rejected; do not send it. Transition to `auth-required` and surface the new scheme requirement to the orchestrator, do not auto-retry with a stale token. - **Artifact attribution.** Tag every artifact with the `kid` and card hash in force at its producing transition. On resume, reject artifacts whose tag does not match a card the client can verify. The boundary is sharp: **the moment `Cap_d` and `Cap_t` diverge on an exercised capability, the task's continuity invariant is broken and no amount of signature validity on either card repairs it.** Continuing is the bug; failing closed at the transition is the guardrail. ## Operational Effect Without this guardrail, three concrete degradations appear in production: 1. **Unattributable artifacts.** Artifact sets span multiple card regimes; downstream auditors cannot replay the task to a single signed state. Verification replay diverges because the remote model or skill implementation changed under the new card. 2. **Silent capability downgrade.** A task that relied on streaming continues to *expect* streamed artifacts after `streaming: false`; the client blocks on an SSE channel the remote will never write to, exhausting the task's timeout budget rather than failing fast. 3. **Auth-regime split-brain.** The client holds a valid OAuth2 token, the remote now requires mTLS; the task oscillates between `working` and `auth-required` on each retry, burning the token budget and never converging. The architectural fix is to make the card a **per-transition witness**, not a per-task grant: bind each lifecycle transition to the card hash in force, re-verify at every `input-required`/`auth-required`/resume boundary, and fail closed with a typed error when scope drifts on an exercised capability. This converts an unbounded continuity failure into a bounded, observable transition failure. ```python from dataclasses import dataclass, field from typing import FrozenSet class CardScopeDriftError(RuntimeError): """Raised when a task transition would proceed under a card whose scope no longer covers the capabilities or security schemes the task exercises.""" @dataclass(frozen=True) class AgentCard: kid: str card_hash: str capabilities: FrozenSet[str] security_schemes: FrozenSet[str] signed_by: str # kid of the signing key @dataclass class TaskBinding: task_id: str discovery_card: AgentCard exercised_capabilities: set = field(default_factory=set) presented_schemes: set = field(default_factory=set) artifact_tags: list = field(default_factory=list) def rebind_at_transition( binding: TaskBinding, current_card: AgentCard, key_transition_valid: bool, ) -> TaskBinding: """Called at every input-required / auth-required / resume boundary. Fails closed if the current card's scope no longer covers what the task has exercised or is about to present.""" if current_card.kid != binding.discovery_card.kid and not key_transition_valid: raise CardScopeDriftError( f"task {binding.task_id}: signing key rotated " f"{binding.discovery_card.kid} -> {current_card.kid} with no " f"validatable transition chain; cannot attribute prior artifacts" ) lost = binding.exercised_capabilities - current_card.capabilities if lost: raise CardScopeDriftError( f"task {binding.task_id}: exercised capabilities {sorted(lost)} " f"withdrawn by card {current_card.card_hash}; task cannot continue " f"under narrowed scope — transition to failed, do not downgrade" ) missing_schemes = binding.presented_schemes - current_card.security_schemes if missing_schemes: raise CardScopeDriftError( f"task {binding.task_id}: presented schemes {sorted(missing_schemes)} " f"absent from card {current_card.card_hash}; next message will be " f"rejected — transition to auth-required, do not retry stale token" ) binding.discovery_card = current_card return binding def record_artifact(binding: TaskBinding, artifact_mime: str) -> None: """Tag each artifact with the card in force at its producing transition.""" binding.artifact_tags.append( {"mime": artifact_mime, "kid": binding.discovery_card.kid, "card_hash": binding.discovery_card.card_hash} ) ```