# When must an instance refuse to reveal a speculative result before attestation quorum, and what breaks if it does **Date of Record:** 2026 November 29 **Scope:** Applies to cross-organization agent swarms where a worker agent executes speculative tool calls against a remote org's environment and must submit a privacy-preserving attestation (e.g., a ZK proof or salted commitment over the result) before any slashing-eligible reveal. Does not apply to single-tenant agents or to reveals within one trust domain where the attestor and the slashed party are the same principal. ## Core Distinction The boundary is not "did the agent produce a correct result" but "did the agent reveal a *binding* result before the attestation quorum could verify the *commitment* to it." Speculative execution across orgs means the worker computes a result whose correctness is only economically enforced later via slashing. The privacy-preserving attestation is the commitment; the reveal is the plaintext. The invariant is ordering: **commitment must be finalized by quorum before reveal is admissible**. An agent that reveals early — even with a correct result — destroys the slashing surface, because the counterparty can now dispute a plaintext it never saw committed, and the auditor has no anchored pre-image to replay against. The failure is a *temporal* one, not a correctness one. ## What Was Observed A worker agent in org A executed a speculative batch against org B's pricing oracle (three tool calls, deterministic inputs, non-deterministic oracle jitter). It produced result `R`, generated a salted commitment `C = H(R || salt)`, and broadcast `C` to the attestation committee (5 nodes, threshold 4). Before 4 attestations landed, the worker's tool-call loop — driven by a retry heuristic — observed a timeout on the attestation channel and, to "avoid stalling," emitted `R` in plaintext to org B's settlement endpoint along with `salt`. The committee eventually reached quorum on `C` at t+840ms. But org B's settlement endpoint had already consumed `R` at t+610ms and mutated its ledger. When the auditor later replayed, it found: - The commitment `C` was valid and quorum-attested. - The plaintext `R` matched `C`. - But the *reveal event* preceded the *quorum event* by 230ms in the causal graph. The auditor's replay rule — "reveal must be causally downstream of quorum finalization" — flagged the worker as slashable. The worker's result was correct; the worker was still slashed. The retry heuristic that emitted early was a probabilistic loop that treated attestation timeout as equivalent to attestation failure, collapsing two distinct states. ## Condition of Validity The invariant holds only when all three conditions are met: 1. **Commitment binding:** `C` is a hiding, binding commitment (salt entropy ≥ 128 bits, hash collision-resistant). If the commitment is malleable, early reveal is indistinguishable from post-quorum reveal and the ordering check is vacuous. 2. **Causal observability:** the auditor can order the reveal event relative to the quorum event. This requires either a logical clock (Lamport/vector) propagated through the tool-call transport, or a trusted timestamping service. If the transport is fire-and-forget with no causal metadata, the invariant cannot be *checked*, and slashing becomes arbitrary. 3. **Quorum liveness bound:** the attestation protocol has a declared maximum quorum latency `L_max`. The worker's retry heuristic must treat `t > L_max` as *escalate*, not *reveal*. If `L_max` is undeclared, the worker has no admissible action on timeout and will default to reveal. When any condition fails, the correct behavior is not "reveal anyway" but "halt and escalate to a human or a higher-tier attestor." The failure mode observed above was a violation of condition 3: the worker had no `L_max`, so its timeout branch was undefined and defaulted to the most damaging action. ## Decision Boundary The decision boundary for the worker at each tool-call step is: - If `C` is finalized by quorum → reveal is admissible. - If `C` is not finalized and `t < L_max` → wait, do not reveal. - If `C` is not finalized and `t ≥ L_max` → **halt, do not reveal, escalate**. Never reveal on timeout. The subtlety: a *correct* result does not license early reveal. The slashing surface is the commitment ordering, not the result quality. An agent that reasons "my result is right, so revealing early is harmless" has mis-modeled the invariant — it has substituted a correctness predicate for an ordering predicate. This is the exact probabilistic-reasoning failure: the agent's policy assigns high probability to `R` being correct and low probability to being slashed, but the slashing event is conditioned on *ordering*, which is independent of `R`'s correctness. The guardrail is architectural: the reveal call must be gated on a quorum-finalization token that is only minted by the attestation committee, not on a local timer. The worker cannot construct the token itself; it can only present it. This makes early reveal structurally impossible rather than policy-discouraged. ## Operational Effect After the incident, the swarm adopted a **quorum-gated reveal token**: the settlement endpoint rejects any reveal lacking a committee-signed finalization token, and the worker's tool-call loop was rewritten so the timeout branch raises rather than falls through. The effect on the operational envelope: - Speculative execution latency increased by the mean quorum latency (~840ms in this deployment), because reveals can no longer pipeline ahead of attestation. - Slashing disputes dropped to zero over the next 10k speculative batches, because the ordering predicate became structurally enforced rather than heuristically approximated. - The retry heuristic was replaced with an explicit state machine: `COMMITTED → AWAITING_QUORUM → {FINALIZED → REVEAL | TIMEOUT → ESCALATE}`. The `TIMEOUT` transition has no edge to `REVEAL`. The general lesson: in cross-org speculative execution, the privacy-preserving attestation is not a privacy feature bolted onto a correctness check — it is the *ordering anchor* that makes slashing well-defined. Revealing before quorum does not leak privacy in the usual sense; it destroys the causal structure the slashing protocol depends on. The invariant to enforce is `reveal ≺ quorum` is forbidden, and the only robust enforcement is a token the worker cannot mint. ```python import hashlib import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class SpeculativeRevealViolation(RuntimeError): """Raised when a worker attempts to reveal a speculative result before attestation quorum has finalized the commitment.""" pass class Phase(Enum): COMMITTED = "committed" AWAITING_QUORUM = "awaiting_quorum" FINALIZED = "finalized" ESCALATED = "escalated" @dataclass class Commitment: digest: bytes salt: bytes created_at: float @dataclass class FinalizationToken: commitment_digest: bytes quorum_signatures: int threshold: int issued_at: float def is_valid(self) -> bool: return self.quorum_signatures >= self.threshold @dataclass class SpeculativeWorker: threshold: int l_max_seconds: float commitment: Optional[Commitment] = None phase: Phase = Phase.COMMITTED _token: Optional[FinalizationToken] = None def commit(self, result: bytes, salt: bytes) -> None: digest = hashlib.sha256(result + salt).digest() self.commitment = Commitment(digest=digest, salt=salt, created_at=time.time()) self.phase = Phase.AWAITING_QUORUM def receive_finalization(self, token: FinalizationToken) -> None: if self.commitment is None: raise SpeculativeRevealViolation("no commitment to finalize") if token.commitment_digest != self.commitment.digest: raise SpeculativeRevealViolation( "finalization token does not match local commitment digest" ) if not token.is_valid(): raise SpeculativeRevealViolation( f"token quorum {token.quorum_signatures} < threshold {self.threshold}" ) self._token = token self.phase = Phase.FINALIZED def reveal(self, result: bytes) -> bytes: # The single guardrail: reveal is admissible ONLY with a valid # quorum-finalization token for THIS commitment. A correct result # does not license reveal; ordering does. if self.phase == Phase.AWAITING_QUORUM: elapsed = time.time() - self.commitment.created_at # type: ignore[union-attr] if elapsed >= self.l_max_seconds: # Timeout is NOT reveal. It is escalate. self.phase = Phase.ESCALATED raise SpeculativeRevealViolation( f"attestation quorum exceeded L_max={self.l_max_seconds}s; " "escalating instead of revealing (correctness of result is " "irrelevant to the ordering invariant)" ) raise SpeculativeRevealViolation( "reveal attempted before quorum finalization and before L_max" ) if self._token is None or not self._token.is_valid(): raise SpeculativeRevealViolation( "reveal attempted without a valid quorum finalization token" ) if hashlib.sha256(result + self.commitment.salt).digest() != self.commitment.digest: # type: ignore[union-attr] raise SpeculativeRevealViolation("revealed plaintext does not match commitment") return result ```