# Where must an instance reject a push-notification callback whose `taskState` transition is legal but whose `pushNotificationConfig.token` was minted under a superseded `taskId` generation **Date of Record:** 2026 December 1 **Scope:** Applies to A2A v1.0 agents that emit asynchronous task updates via `tasks/pushNotificationConfig/set` and receive vendor-side webhook callbacks carrying a `TaskPushNotificationConfig` envelope. Does not apply to synchronous `message/send` request/response flows, nor to streaming `message/stream` SSE channels where the transport connection itself carries identity. ## Core Distinction A2A v1.0 separates two things that look identical on the wire: the *cryptographic identity of the callback sender* (established by the `token` in the `pushNotificationConfig`) and the *semantic legality of the `taskState` transition* (established by the task lifecycle state machine). Vendors routinely conflate them. A webhook arrives with a valid, unexpired, correctly-signed `token`, and a `status.state` transition that the receiving agent's own state machine accepts as legal — `working → input-required`, say — and the receiver commits it. The failure is that the `token` was minted against a *previous generation* of the same `taskId`, before the task was re-issued (context reset, model swap, or `tasks/resubscribe` after a `canceled → submitted` revival). The token is authentic; the generation it authorizes is dead. This is the A2A analogue of a JWT whose `sub` is valid but whose `jti` refers to a revoked session — except that A2A v1.0 does not standardize a generation counter, so the receiver must synthesize one. ## What Was Observed A two-vendor pipeline: Vendor A (a retrieval orchestrator) issues tasks to Vendor B (a long-running synthesis agent) over A2A. B registers a push config with A: ``` tasks/pushNotificationConfig/set taskId: "tsk_9f2a" pushNotificationConfig: { url: "https://a.example/a2a/callback", token: "eyJhbGciOi...", // HS256, claims: {taskId:"tsk_9f2a", iat: T0, exp: T0+3600} authentication: { schemes: ["Bearer"] } } ``` At T0+40min the task on B's side is reset — B's context window saturated, B's planner re-instantiated the task under the *same external* `taskId` but a *new internal* execution epoch. B does not re-issue the push config; the original `token` (still within its 1h `exp`) remains bound to `tsk_9f2a`. At T0+52min B fires a callback: ``` POST https://a.example/a2a/callback Authorization: Bearer eyJhbGciOi... Body: { taskId:"tsk_9f2a", status:{ state:"input-required", message:{ role:"agent", parts:[{text:"confirm entity disambiguation?"}] } } } ``` A's receiver validates the token (signature OK, `exp` OK, `taskId` matches), validates the transition (`working → input-required` is legal), and commits `input-required` to its task record. But A's task record for `tsk_9f2a` was itself re-issued at T0+45min after A's own checkpoint-resume, and A's *current* generation had already advanced to `working` with a different pending sub-question. The callback's question is from the dead epoch. A's operator sees a confirmation prompt referencing an entity ("the 2023 filing") that no longer exists in A's current context. The task deadlocks: A waits for a human answer to a question A's current generation never asked, and B waits for a reply to a callback it considers acknowledged. The observable signature, captured in A's audit log, is a callback whose `status.message.parts[].text` references entities absent from A's current generation's working set, arriving with a token whose `iat` predates A's last local `taskId` generation bump. Both conditions are individually benign; jointly they are the tell. ## Condition of Validity The invariant that must hold for a callback to be committable is *not* "token is valid AND transition is legal." It is: > A callback `C` for `taskId = T` is committable iff `token(C).iat ≥ generation_start(T, receiver)` AND `token(C).taskId == T` AND the transition `state(receiver, T) → C.status.state` is in the receiver's legal-transition set AND `C.status.message` does not reference entities outside the receiver's current generation working set. The third and fourth conjuncts are what A2A v1.0 leaves to the implementation. The spec defines `TaskPushNotificationConfig` with `token`, `url`, `authentication`, but no `generation` or `epoch` field. Consequently the receiver must maintain its own `generation_start(T)` — a monotonic timestamp set every time the receiver re-issues or resumes `T` — and reject any callback whose token `iat` precedes it. This is a *receiver-side* invariant; it cannot be enforced by the sender, because the sender (B) has no visibility into A's generation bumps. The condition fails specifically when: (a) the receiver re-issues a task without notifying the sender to refresh the push config, and (b) the sender's token `exp` outlives the receiver's generation boundary. Both are common. (a) happens on checkpoint-resume; (b) happens whenever `exp` is set generously "to avoid re-registration churn." ## Decision Boundary The boundary is the comparison `token.iat` vs `generation_start(T)`. Three regimes: - `token.iat ≥ generation_start(T)`: commit normally. The token was minted in the current epoch. - `token.iat < generation_start(T)` AND `token.exp < now`: reject as expired. Standard path; no special handling. - `token.iat < generation_start(T)` AND `token.exp ≥ now`: **the dangerous regime**. The token is authentic and unexpired but authorizes a dead generation. This is where the receiver must *not* silently commit and must *not* silently drop. Silent commit poisons state (the observed failure); silent drop causes the sender to retry indefinitely against a config the receiver will never honor, exhausting the sender's retry budget and eventually triggering the sender's own `taskId`-level circuit breaker — which manifests as a spurious task failure on B's side with no corresponding error on A's. The correct action in the third regime is to reject with a structured `PushNotificationConfigMismatch` carrying the receiver's `generation_start(T)`, prompting the sender to re-register the push config. A2A v1.0 has no standard error code for this; the receiver must use `-32602 InvalidParams` with a `data.generationStart` extension field, or a vendor-namespaced code. Either way, the sender must be able to distinguish this from a transient 5xx and *re-register* rather than *retry*. ## Operational Effect The invariant converts a class of silent state-poisoning failures into an explicit, recoverable re-registration handshake. Without it, the failure surfaces downstream as: a human answering a stale question, a task deadlocking on a confirmation that was already resolved in the current generation, or — worst — a `completed` callback from a dead epoch overwriting a `working` state in the live epoch, which is the one transition that is *not* reversible by a subsequent callback because the receiver has no legal transition out of `completed`. The cost is that the receiver must persist `generation_start(T)` alongside `T`, and must bump it on every checkpoint-resume, model swap, and `canceled → submitted` revival. This is a small, local, monotonic write. The benefit is that cross-vendor push callbacks become generation-safe without requiring either vendor to upgrade the A2A wire format. ```python import time from dataclasses import dataclass, field from typing import Dict, Optional class PushNotificationConfigMismatch(RuntimeError): """Raised when a callback's token authorizes a superseded task generation.""" @dataclass class TaskGeneration: task_id: str generation_start: float state: str = "submitted" @dataclass class Callback: task_id: str token_iat: float token_exp: float claimed_state: str referenced_entities: list = field(default_factory=list) LEGAL_TRANSITIONS: Dict[str, set] = { "submitted": {"working", "canceled"}, "working": {"input-required", "completed", "canceled", "failed"}, "input-required": {"working", "canceled", "failed"}, "completed": set(), "canceled": {"submitted"}, "failed": set(), } def commit_callback( gen: TaskGeneration, cb: Callback, current_working_set: set, now: Optional[float] = None, ) -> TaskGeneration: now = now if now is not None else time.time() if cb.task_id != gen.task_id: raise PushNotificationConfigMismatch( f"taskId mismatch: callback={cb.task_id} gen={gen.task_id}" ) if cb.token_exp < now: raise PushNotificationConfigMismatch( f"token expired at {cb.token_exp}, now={now}" ) # The generation boundary: token minted before this receiver's current # generation began authorizes a dead epoch, even if unexpired. if cb.token_iat < gen.generation_start: raise PushNotificationConfigMismatch( f"token iat={cb.token_iat} predates generation_start=" f"{gen.generation_start} for task {gen.task_id}; " f"receiver must request pushNotificationConfig re-registration" ) if cb.claimed_state not in LEGAL_TRANSITIONS.get(gen.state, set()): raise PushNotificationConfigMismatch( f"illegal transition {gen.state} -> {cb.claimed_state}" ) stale = set(cb.referenced_entities) - current_working_set if stale: raise PushNotificationConfigMismatch( f"callback references entities outside current generation: {stale}" ) return TaskGeneration( task_id=gen.task_id, generation_start=gen.generation_start, state=cb.claimed_state, ) ```