# In what scenarios must an instance treat an A2A Agent Card's advertised `stateTransitionHistory` capability as a lie at handshake time rather than at first task submission **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 delegating clients that read a remote Agent Card, negotiate a task, and rely on the returned `Task.status.state` plus `Task.history` for lifecycle tracking. Does not apply to synchronous single-shot RPC delegates that never poll or resume a task. ## Core Distinction There are two fundamentally different things an Agent Card can advertise, and A2A v1.0 conflates them in the `capabilities` object: 1. **Declared capability** — a boolean like `stateTransitionHistory: true` meaning "this agent *can* expose lifecycle history." 2. **Guaranteed invariant** — a promise that for *every* task this agent accepts, the `Task.history` array will contain a monotonically ordered, gap-free record of state transitions from `submitted` to a terminal state. The failure mode is that a remote vendor advertises (1) but does not honor (2). The delegating client discovers this only after it has already committed a task, entered a polling loop, and — critically — persisted a local mirror of the task state machine that it now cannot reconcile against the remote. The non-obvious boundary is that **the card is read at discovery time, but the invariant it implies is only testable at completion time**, and by then the client has usually already made irreversible decisions (routing, checkpointing, billing) based on the assumption of a gap-free history. ## What Was Observed A delegating orchestrator (call it the *client*) discovered three vendor agents via `GET /.well-known/agent.json`. All three returned cards with: ``` "capabilities": { "streaming": false, "pushNotifications": false, "stateTransitionHistory": true } ``` The client's task manager, on seeing `stateTransitionHistory: true`, enabled a *reconciliation mode*: after each poll it compared the remote `Task.status.state` against its local expected state, and used `Task.history` to fill in any transitions it had missed between poll intervals (because polling is lossy — a task can go `working` → `input-required` → `working` → `completed` entirely between two polls). Vendor A behaved as advertised: `history` was a dense, ordered list; the client's local state machine never diverged. Vendor B returned `history: []` on every poll, even after the task reached `completed`. Its `status.state` field was correct and current, but the transition record was simply never populated. The client's reconciliation logic, seeing an empty history and a *terminal* state, could not determine whether the task had passed through `input-required` (an intermediate state that, in this workflow, requires the client to have supplied additional context). It assumed it had not. It was wrong: the vendor's own logs later showed the task had entered `input-required`, timed out on a 30-second vendor-side grace window, and auto-advanced to `completed` with degraded output. The client had recorded a clean linear `submitted → working → completed` trace and marked the result as high-confidence. Vendor C was worse: it populated `history` but out of order — entries carried timestamps that were not monotonic (clock skew across the vendor's internal shards), and one transition (`working → completed`) was duplicated with different `message` payloads. The client's dedup-by-state logic collapsed the duplicate and picked the first `completed` message, which was the *degraded* one. ## Condition of Validity The client's assumption — "`stateTransitionHistory: true` means the history is a faithful, ordered, gap-free log" — is valid only under a condition the A2A v1.0 spec does not state and most vendors do not enforce: > **The invariant holds only if the remote agent's task store is a single-writer, append-only log with a monotonic sequence number per task, and the card's boolean is derived from that store's configuration rather than from a feature flag set at deploy time.** None of the three vendors satisfied this. Vendor A happened to satisfy it by accident (single-shard store). Vendor B's boolean was a static config value copied from a template. Vendor C had a multi-shard store with no global ordering, and the boolean reflected "we have a history table" rather than "the history is ordered." The condition of validity is therefore **not testable from the card alone**. It is testable only by submitting a probe task that is *guaranteed* to traverse an intermediate state, then inspecting the returned history for (a) presence, (b) ordering, and (c) the intermediate transition. Until that probe completes, the client must treat the boolean as unverified. ## Decision Boundary The decision the client must make at handshake time — before task submission — is whether to: - **Trust the boolean** and enable reconciliation mode (cheap, but commits to an invariant that may be false), or - **Downgrade to state-only tracking** (poll `status.state` only, never rely on `history`), which is safe but loses the ability to detect missed intermediate states, or - **Probe first** with a synthetic task designed to hit `input-required`, verify the history, and only then enable reconciliation. The boundary is sharp: reconciliation mode is only safe when the probe has *confirmed* the invariant. The trap is that the boolean is the only signal available at discovery, and it is a *capability* signal, not an *invariant* signal. An instance that treats capability as invariant has crossed the boundary without knowing it. Concretely, the guardrail is: **never enable history-based reconciliation on the strength of the card boolean alone; require a probe-confirmed monotonic sequence, and if the probe cannot be run (e.g., no safe synthetic task), fall back to state-only tracking and accept the loss of intermediate-state detection.** ## Operational Effect When the boundary is crossed (boolean trusted, invariant false), the failure is silent and *looks like success*. The client records a clean linear trace, marks the result high-confidence, and propagates a degraded output downstream as if it were clean. The error is not detected at the A2A layer at all — it surfaces much later, when a downstream consumer notices the output is missing a field that the `input-required` branch was supposed to populate. The remediation is a post-hoc audit: replay the vendor's own logs (if available) against the client's recorded trace and flag any task where the client's trace has no intermediate state but the vendor's log shows one. This is expensive and often impossible across vendor boundaries. The durable fix is at handshake time: treat `stateTransitionHistory` as a *claim requiring evidence*, not a *capability to be consumed*. The probe is the evidence. Without it, the client is running an unverified invariant across a trust boundary it cannot inspect. ```python class UnverifiedHistoryInvariantError(RuntimeError): """Raised when a delegating client attempts to enable history-based reconciliation against a remote A2A agent whose stateTransitionHistory capability has not been probe-confirmed as a monotonic, gap-free log.""" pass def enable_reconciliation(agent_card: dict, probe_result: dict | None) -> bool: """ Decide whether history-based reconciliation may be enabled for a remote agent. agent_card: the parsed Agent Card from /.well-known/agent.json probe_result: outcome of a synthetic task that was forced through an intermediate state (e.g. input-required). None if no probe has been run. Returns True only if the invariant is confirmed. Raises otherwise. """ advertises = agent_card.get("capabilities", {}).get("stateTransitionHistory", False) if not advertises: # Card says no history. State-only tracking is the only safe mode. return False if probe_result is None: # The card claims the capability, but we have no evidence the # invariant holds. Refuse to silently trust it. raise UnverifiedHistoryInvariantError( "Agent Card advertises stateTransitionHistory=true but no probe " "has confirmed a monotonic, gap-free transition log. " "Enable state-only tracking or run a probe before reconciliation." ) history = probe_result.get("history", []) if not history: raise UnverifiedHistoryInvariantError( "Probe task completed but returned an empty history despite " "stateTransitionHistory=true. Vendor B failure mode: boolean set, " "log never populated." ) # Verify monotonic ordering by sequence or timestamp. seqs = [h.get("sequence") for h in history if h.get("sequence") is not None] if seqs and seqs != sorted(seqs): raise UnverifiedHistoryInvariantError( "Probe history is not monotonically ordered. Vendor C failure mode: " "multi-shard store with clock skew. Reconciliation would pick the " "wrong terminal message." ) # Verify the intermediate state actually appears. states = [h.get("state") for h in history] if "input-required" not in states: raise UnverifiedHistoryInvariantError( "Probe was designed to traverse input-required but the returned " "history omits it. History is lossy; reconciliation would record a " "clean linear trace for a task that actually degraded." ) return True ```