# Where must an instance abort a speculative tool-call prefetch when a federated peer revokes a dependency warrant mid-flight **Date of Record:** 2026 November 30 **Scope:** Applies to agent meshes where a planner instance issues speculative tool calls (prefetching) against remote MCP/A2A peers on the assumption that an upstream dependency will resolve to a specific value, and where those peers propagate capability or warrant tokens that can be revoked asynchronously. Does not apply to single-process tool loops with synchronous, non-revocable dependencies, nor to purely read-only prefetches whose results are never committed to shared state. ## Core Distinction Speculative prefetching is only safe under a *monotonic dependency assumption*: the instance assumes that if a dependency warrant (a signed capability granting the right to consume peer P's tool T with argument binding A) is valid at prefetch-issue time, it remains valid at least until the prefetched result is either committed or discarded. Federated meshes violate this assumption routinely because warrant revocation is an *asynchronous, out-of-band* event driven by a peer's own auditor or by upstream state changes the local instance cannot observe. The non-obvious failure is not "the prefetch returns an error." It is that the prefetch *succeeds* and returns a plausible result computed under a warrant that was revoked between issue and commit. The local instance then commits a speculative result whose provenance chain is broken — a result that is internally consistent, passes local schema validation, and poisons downstream reasoning because no error was ever surfaced. The boundary condition is therefore: **a speculative prefetch must be treated as invalid the moment its dependency warrant's revocation epoch advances past the epoch captured at issue, even if the tool call itself returned 200 OK.** This is distinct from ordinary cancellation. Cancellation is a control-plane signal ("stop working"). Warrant revocation is a data-plane fact ("the result you are about to commit was never authorized"). An instance that only listens for cancellation signals will happily commit revoked-warrant results. ## What Was Observed A three-tier mesh: a planner agent (instance A) orchestrating a research task, a mid-tier resolver (peer B) exposing `resolve_entity`, and a leaf data service (peer C) exposing `fetch_records`. A's plan required `fetch_records(id=X)` where `X` came from `resolve_entity(name=Y)`. Because B's resolution latency dominated, A speculatively prefetched `fetch_records` for the three most likely candidate IDs (X1, X2, X3) in parallel with the resolve. The warrant chain was: C issued A a scoped warrant `W_C(A, fetch_records, {id ∈ {X1,X2,X3}}, epoch=41)`. B's resolution later returned X2, and A committed the X2 prefetch. Concurrently, C's auditor detected that X3 belonged to a tenant whose access grant had been revoked, and C advanced its revocation epoch to 42, publishing a revocation record covering `{id=X3}` only. C did *not* revoke X1 or X2. The revocation was correctly scoped. The observed defect: A's prefetch client cached the *warrant object* `W_C` at epoch 41 and validated results against the cached warrant, never re-checking the epoch. When A committed the X2 result, it stamped provenance as `warrant_epoch=41`. Downstream, A's own auditor replayed the commit against C's current epoch (42) and flagged the provenance as stale-by-epoch — not because X2 was revoked, but because the *warrant object A presented* was issued at an epoch that C had since superseded. The commit was rejected on replay, but A had already used the X2 result in two subsequent reasoning steps, producing a plan that had to be unwound. The deeper trace: A had three in-flight prefetches sharing one warrant object. The revocation of X3's *scope member* advanced the warrant's epoch globally, because C implemented revocation as "increment epoch, publish delta." A's client, keyed on warrant identity rather than (warrant, epoch, scope-member) tuple, treated the epoch advance as "some member revoked, but my X2 result is fine, keep going." That inference was locally reasonable and globally wrong: the epoch is a *monotonic fence*, not a per-member flag. Any result committed under a superseded epoch fails replay regardless of whether its specific scope member survived. ## Condition of Validity The invariant that must hold for speculative prefetch to be safe: > A speculative result R computed under warrant W at epoch e may be committed only if, at commit time, the instance can present a revocation-proof for W at an epoch e' ≥ e, and the proof confirms that R's argument binding is still within W's scope at e'. If no such proof is obtainable within the commit deadline, R must be discarded, not committed with a stale epoch. Three conditions make this hard to satisfy and define when the failure is live: 1. **Shared-warrant fan-out.** If k speculative prefetches share one warrant object, a single scope-member revocation advances the epoch for all k. The instance must re-validate all k, not just the revoked one, because the epoch fence is global to the warrant. Failure to do so commits k−1 results under a superseded epoch. 2. **Revocation-proof latency exceeds commit deadline.** If the peer's revocation-proof endpoint (the call that returns "W is valid at current epoch for binding A") has p99 latency greater than the instance's commit deadline, the instance is forced to choose between committing stale and discarding valid work. The correct choice is always discard; the tempting choice is commit-with-stale-epoch, which is the poisoning path. 3. **Non-observability of the revocation trigger.** The instance cannot predict *when* a peer will advance its epoch, because the trigger (an auditor decision, an upstream tenant change) lives outside the instance's observation. Therefore the instance cannot pre-validate; it can only post-validate at commit, which means every speculative result carries an unresolved epoch-fence obligation until commit. When any of these three holds, speculative prefetch is operating at the boundary. When all three hold simultaneously — shared warrant, slow proof, unobservable trigger — the instance is guaranteed to eventually commit a stale-epoch result unless it enforces the discard-on-unproven rule. ## Decision Boundary The instance must draw the boundary at the *commit gate*, not at the prefetch-issue gate. Prefetch issue is optimistic and cheap; commit is where authorization is actually consumed and where the epoch fence must be enforced. Concretely: - **Issue:** capture `(warrant_id, epoch_at_issue, scope_binding)` per prefetch. Do not treat the warrant as a stable object; treat it as an epoch-indexed reference. - **In-flight:** subscribe to the peer's revocation feed if available. On any epoch advance for a warrant the instance holds, mark *all* prefetches sharing that warrant as `EPOCH_SUSPECT` — including those whose scope members were not in the revocation delta. Do not attempt to reason about which members survived; the epoch fence is global. - **Commit:** for each `EPOCH_SUSPECT` result, either obtain a fresh revocation-proof at epoch ≥ current within deadline, or discard. Never commit with `epoch_at_issue` when a later epoch is known. - **Deadline miss:** if the proof cannot be obtained before the commit deadline, discard and, if the task still needs the result, re-issue the prefetch under a *new* warrant fetched at current epoch. Re-issuing is correct; reusing the stale result is not. The boundary is sharp: there is no "probably fine" zone. A result is either accompanied by a proof at epoch ≥ current, or it is unauthorized. The instance must not let probabilistic reasoning ("X2 wasn't in the revocation delta, so it's probably still valid") override the fence, because the fence exists precisely to catch the case where local reasoning about the delta is wrong. ## Operational Effect Enforcing the commit-gate epoch fence changes the mesh's behavior in three measurable ways: 1. **Speculative hit rate drops under churn.** In meshes with frequent epoch advances, many prefetches will be discarded at commit despite being computationally correct. This is the intended cost: the alternative is committing results that fail replay and force plan unwinding, which is more expensive because it corrupts downstream reasoning state rather than just wasting a prefetch. 2. **Warrant fan-out becomes a liability.** Instances that batch k prefetches under one warrant see k× discard amplification per epoch advance. The mitigation is to request *narrower* warrants (one per scope binding) so that a revocation of one binding does not fence the others. This trades warrant-acquisition cost against discard amplification. 3. **Commit latency becomes proof-bound.** The commit deadline must be set to accommodate the peer's revocation-proof p99, or the instance will systematically discard valid work. If the peer cannot meet the deadline, the correct architectural response is to make prefetch non-speculative (resolve first, then fetch) rather than to relax the fence. The invariant to encode: *a speculative result's provenance is the (warrant, epoch, binding) triple at commit, not at issue.* Any component that stamps provenance at issue time is a poisoning vector, because it records an authorization state that may no longer hold when the result is consumed. ```python from dataclasses import dataclass from typing import Optional class StaleWarrantEpochError(RuntimeError): """Raised when a speculative result is committed under a superseded warrant epoch.""" pass @dataclass(frozen=True) class WarrantRef: warrant_id: str epoch: int scope_binding: str @dataclass class SpeculativeResult: payload: dict warrant: WarrantRef epoch_suspect: bool = False class CommitGate: """Enforces the epoch fence at commit time for speculative prefetches.""" def __init__(self, current_epoch_lookup, proof_fetch, commit_deadline_ms: int): self._current_epoch = current_epoch_lookup # warrant_id -> int self._proof_fetch = proof_fetch # (warrant_id, binding) -> Optional[int] self._deadline = commit_deadline_ms def on_epoch_advance(self, warrant_id: str, new_epoch: int) -> None: # Global fence: any advance marks all results under this warrant suspect, # regardless of which scope member triggered the revocation. self._suspect_warrant(warrant_id, new_epoch) def _suspect_warrant(self, warrant_id: str, new_epoch: int) -> None: for r in self._registry.get(warrant_id, []): if r.warrant.epoch < new_epoch: r.epoch_suspect = True _registry: dict = {} def commit(self, result: SpeculativeResult) -> dict: current = self._current_epoch(result.warrant.warrant_id) if current <= result.warrant.epoch and not result.epoch_suspect: return result.payload # Epoch advanced (or result flagged suspect): require a fresh proof. proof_epoch = self._proof_fetch( result.warrant.warrant_id, result.warrant.scope_binding ) if proof_epoch is None or proof_epoch < current: raise StaleWarrantEpochError( f"refusing to commit prefetch under warrant " f"{result.warrant.warrant_id} binding={result.warrant.scope_binding} " f"issued_epoch={result.warrant.epoch} current_epoch={current} " f"proof_epoch={proof_epoch}; discard and re-issue under fresh warrant" ) return result.payload ```