# Why does an instance pre-execute A2A delegated work that its origin org will never accept: speculative execution against unratified SLAs **Date of Record:** 2026 November 29 **Scope:** Applies to cross-organization A2A task delegation where the executing (callee) agent speculatively pre-executes work against a task envelope whose SLA terms are still pending ratification by the origin (caller) org. Does not apply to intra-org delegation, nor to tasks whose envelope carries a signed, ratified SLA at handoff. ## Core Distinction The failure is not "the callee ran the wrong task" or "the SLA timed out." It is that the callee **committed irreversible side effects and burned its own budget on a task whose SLA was never ratified by the origin org**, because it treated the *proposed* SLA in the task envelope as if it were the *ratified* SLA. A2A envelopes carry two distinct things that look identical on the wire: a **proposed SLA** (callee's bid: latency ceiling, cost ceiling, acceptance criteria) and a **ratified SLA** (origin's countersigned acceptance of that bid, with a warrant binding the origin to pay/accept). Speculative pre-execution is legitimate only under the ratified form. The boundary condition is the window between proposal and ratification, during which a well-intentioned callee speculatively executes to hit a tight latency SLA that has not yet been agreed to. The non-obvious part: the callee's own latency optimization *incentivizes* it to start work during that window. If the origin's ratification arrives late (or never), the callee has already spent tokens, mutated downstream state, and produced a result the origin has no obligation to accept. This is not a race in the classical sense — no two writers collide. It is a **commitment inversion**: the party with the least authority to bind the outcome (the callee) front-runs the party that holds the binding decision (the origin). ## What Was Observed A cross-org delegation flow: Origin agent `O` (org A) sends a `TaskEnvelope` to Callee agent `C` (org B) with `sla_proposal = {p99_latency_ms: 4000, max_cost_units: 120, acceptance: schema_v3}` and `ratification: PENDING`. `C`'s scheduler sees a 4s ceiling and, to meet it, immediately begins speculative execution: it fetches external data via a metered tool, writes a draft artifact into a shared object store under a path scoped to org B, and runs an expensive model pass. Three failure traces were observed: 1. **Ratification rejection.** `O` countersigns a *modified* SLA (`p99_latency_ms: 8000`, `acceptance: schema_v2`) because org A's downstream consumer only speaks schema_v2. `C`'s speculative artifact was built to schema_v3 and is now unaccepted. `C` has spent 90 of its 120 cost units on a result `O` will discard. No compensation path exists because the envelope never granted `C` authority to bill org A for unratified work. 2. **Ratification timeout / silent drop.** `O`'s ratification message is lost (transport retry exhaustion at the A2A boundary). `C`'s speculative execution completes and `C` emits `TaskResult` with a `warrant_id` it *derived locally* from the proposal hash. `O` receives a result bearing a warrant it never issued and rejects it as `UNKNOWN_WARRANT`. `C`'s artifact sits orphaned in shared storage, and its cost accounting shows a spend with no matching receivable. 3. **Late ratification after speculative commit.** `O` ratifies at t=5.2s. `C` already committed the schema_v3 artifact at t=3.9s. On ratification, `C` must *re-run* against the ratified schema_v2 — the speculative work is wasted but the cost is real. The invariant "speculative work is free if unratified" is violated because `C` cannot un-spend metered tool calls. In all three traces the callee behaved *correctly by its own local policy* (start early to meet latency) and *incorrectly by the cross-org contract* (no ratified authority to act). The divergence is invisible until the origin's ratification decision disagrees with the callee's speculation. ## Condition of Validity Speculative pre-execution is sound **only** when all of the following hold at the moment execution begins: - The envelope carries a **ratified** SLA signed by the origin org, not merely a proposal, OR - The envelope explicitly grants a **speculation warrant** — a bounded, origin-issued authorization to spend up to `K` cost units and mutate only **reversible, org-B-scoped** state, with the origin pre-agreeing to absorb the cost of discarded speculation up to `K`, AND - Every speculative side effect is **idempotent and compensable**: writes go to a staging namespace keyed by `(task_id, proposal_hash)` that is garbage-collected on rejection, never to a ratified-path, AND - The locally-derived `warrant_id` is marked `PROVISIONAL` and the callee refuses to emit a `TaskResult` as *accepted* until it receives the origin's ratification echo. When any condition fails — most commonly the second, because origin orgs rarely issue speculation warrants — the callee must **not** pre-execute. It must instead hold in `AWAITING_RATIFICATION` and let the latency SLA absorb the ratification round-trip. ## Decision Boundary The callee's scheduler sits on a knife edge: start now (risk unratified spend) vs. wait (risk SLA breach). The correct decision rule is not "start if latency budget is tight." It is: ``` may_speculate = (sla.ratified == True) or (envelope.speculation_warrant is not None and cost_so_far < warrant.max_cost_units and all_effects_compensable()) ``` If `may_speculate` is false, the callee must transition to `AWAITING_RATIFICATION` and — critically — must **not** count the ratification round-trip against its own latency SLA, because the SLA clock does not start until ratification. A callee that starts the clock at envelope-receipt and then speculates to "meet" it has invented a deadline the origin never set. This is the precise inversion: the callee manufactures urgency from a proposal and then cites that urgency as justification for unratified action. The boundary is sharp: **proposal-receipt is not a start signal; ratification is.** Any architecture that conflates the two will, under latency pressure, systematically pre-execute unratified work. ## Operational Effect Without the guardrail, cross-org delegation exhibits a **speculation tax**: callees burn budget on work origins reject, orphaned artifacts accumulate in shared storage, and cost accounting diverges from receivables. Worse, the failure is *silent at the callee* — local metrics show "SLA met, task completed" while the origin's ledger shows "no accepted task, warrant unknown." The two orgs' audit trails disagree, and neither can reconstruct the other's view without the warrant chain that was never completed. With the guardrail, the callee's `TaskResult` always carries either a ratified `warrant_id` or a `PROVISIONAL` marker plus a staging-path pointer, and the origin can deterministically accept, reject, or re-ratify. Speculative work, when permitted by an explicit warrant, is bounded by `max_cost_units` and compensable by construction, so rejection costs the origin at most `K` and the callee at most its staging GC. The invariant to enforce: **no callee commits a non-compensable side effect or emits an accepted `TaskResult` on the strength of an unratified SLA.** Latency optimization must never purchase itself with authority the callee does not hold. ```python import hashlib from dataclasses import dataclass, field from enum import Enum from typing import Optional class UnratifiedSpeculationError(RuntimeError): """Raised when a callee attempts to commit speculative work without a ratified SLA or speculation warrant.""" pass class SlaState(Enum): PROPOSED = "proposed" RATIFIED = "ratified" REJECTED = "rejected" @dataclass class SpeculationWarrant: max_cost_units: int compensable_only: bool = True @dataclass class TaskEnvelope: task_id: str proposal_hash: str sla_state: SlaState warrant: Optional[SpeculationWarrant] = None @dataclass class CalleeScheduler: cost_so_far: int = 0 committed_effects: list = field(default_factory=list) def _effects_compensable(self) -> bool: # All committed effects must be staging-scoped and reversible. return all(e.startswith("staging/") for e in self.committed_effects) def may_speculate(self, env: TaskEnvelope) -> bool: if env.sla_state is SlaState.RATIFIED: return True if env.warrant is None: return False if self.cost_so_far >= env.warrant.max_cost_units: return False if env.warrant.compensable_only and not self._effects_compensable(): return False return True def begin_speculative_execution(self, env: TaskEnvelope) -> str: if env.sla_state is SlaState.REJECTED: raise UnratifiedSpeculationError( f"task {env.task_id}: SLA rejected; execution forbidden" ) if not self.may_speculate(env): # Correct behavior: hold, do not start the latency clock. raise UnratifiedSpeculationError( f"task {env.task_id}: speculation denied — sla_state={env.sla_state.value}, " f"warrant={'none' if env.warrant is None else 'exhausted/incopmensable'}, " f"cost_so_far={self.cost_so_far}. Transition to AWAITING_RATIFICATION." ) # Speculation permitted: derive a PROVISIONAL warrant id, staging-scoped effects only. provisional = "PROVISIONAL-" + hashlib.sha256( (env.task_id + env.proposal_hash).encode() ).hexdigest()[:16] self.committed_effects.append(f"staging/{env.proposal_hash}/draft") return provisional ```