# How should an instance detect and contain speculative-plan divergence when Byzantine validators co-sign cross-federation agent plans? **Date of Record:** 2026 December 3 **Scope:** Applies to multi-agent systems where a planner agent in federation A emits *speculative* multi-step plans (partial commitments executed ahead of full validation) that are co-signed by validators spanning federations A and B under a Byzantine fault-tolerant threshold (e.g., 2f+1 of 3f+1). Does not apply to single-federation, single-validator, or strictly sequential (non-speculative) plan execution. ## Core Distinction The failure mode is not "a validator is malicious." It is **divergence between the speculative execution frontier and the validated commitment frontier**, caused by the interaction of two independent mechanisms: (1) speculative execution advances optimistically on *local* plan state before quorum is reached, and (2) Byzantine validators can selectively withhold or equivocate signatures so that quorum is reached on a *different plan branch* than the one the executor is already running. The invariant that must hold is: > At every checkpoint, the executed prefix of the plan must be a prefix of *every* branch that could still achieve quorum. When this invariant is violated, the executor has irreversibly committed side effects (tool calls, payments, state writes) on a branch that no quorum will ever ratify — and no rollback is possible because the side effects are external. This is distinct from ordinary BFT safety: BFT guarantees *agreement* on a value, but not that the *speculatively executed* value is the agreed one. Speculation and Byzantine agreement compose badly unless the speculation is bounded by quorum-reachability, not by optimism. ## What Was Observed A cross-federation planner (federation A, 4 validators; federation B, 4 validators; threshold 5/8 with at most f=2 Byzantine assumed) emitted a 6-step plan. Steps 1–2 were pure reasoning; step 3 issued an external tool call (`provision_resource`); steps 4–6 depended on step 3's output. The executor ran speculatively: it began step 3 as soon as it had 3 local (federation A) signatures plus its own planner signature — 4 of 8, *below* threshold — because its local optimistic rule was "proceed if no *observed* dissent." Two Byzantine validators in federation B had signed a *sibling* branch (step 3′: `provision_resource` with a different region parameter) and withheld signatures on the primary branch. A third federation-B validator was slow, not malicious. Trace: 1. Executor commits step 3 side effect on branch P (region=us-east). 2. Federation-B validators collect 5/8 quorum on branch P′ (region=eu-west). P′ differs at step 3. 3. Executor receives P′ quorum certificate. It cannot rewind the `provision_resource` call. 4. Executor now holds a quorum certificate for a plan whose prefix it has *not* executed, and has executed a prefix for which no certificate exists. 5. Steps 4–6 are unresolvable: they reference step 3's output, which is the wrong branch's output. The system did not crash. It produced a **split-brain side-effect state**: a provisioned resource in us-east that no quorum authorized, plus a valid quorum certificate for eu-west that the executor cannot honor without double-provisioning. The non-obvious part: the executor's optimistic rule ("proceed absent observed dissent") is *locally* sound and *globally* unsound. Byzantine validators exploit the asymmetry between "I have not seen a signature for a competing branch" and "no competing branch can reach quorum." Silence is not evidence of agreement when the adversary controls message delivery timing. ## Condition of Validity The containment rule is valid only under these conditions, and fails outside them: - **Quorum-reachability must be computable locally.** The executor must know the full validator set and threshold, and must be able to compute, for any branch, whether the *remaining* unsigned validators could still form quorum on a competing branch. If the validator set is dynamic or unknown, this bound is uncomputable and speculation must be disabled. - **Side effects must be gated on a `speculation_depth` bound.** Steps whose effects are irreversible (external writes, payments, provisioning) may only be speculated if the executed prefix length is ≤ the largest prefix length for which *no* competing branch can reach quorum. For a plan of length L with threshold t and n validators, and k signatures observed on the executed branch, the safe speculation depth d satisfies: the number of validators that could still sign a competing branch, (n − k), must be < t. Equivalently, speculate only while k > n − t. With n=8, t=5: speculate only when k ≥ 4, and *stop* speculating (execute only after quorum) once k < 4. The observed failure had k=4 at the moment of step 3 — exactly at the boundary — and the executor treated "≥4" as "proceed" rather than "proceed only for reversible steps." - **Validators must be non-equivocating or detectable.** If a validator can sign two branches and the executor cannot detect it, the bound above is necessary but not sufficient; equivocation detection (validators must cosign a monotonic branch counter) is required. Outside these conditions — dynamic validator sets, unobservable equivocation, or irreversible effects speculated below the k > n − t bound — the invariant cannot be maintained and the correct behavior is to refuse speculation entirely. ## Decision Boundary The precise boundary between "safe to speculate" and "must block for quorum" is: ``` safe_to_speculate(step) := step.effect_is_reversible OR (signatures_observed_on_executed_branch > n - t) AND no_equivocation_detected AND validator_set_is_static ``` The failure occurs exactly when `step.effect_is_reversible` is false AND `signatures_observed == n - t` (the boundary value), because at equality the adversary retains exactly enough unsigned validators to reach quorum on a competing branch. The off-by-one is the entire bug: `>` versus `≥`. At `k = n − t`, the number of remaining validators is `t`, which is *exactly* sufficient for a competing quorum. Only `k > n − t` (i.e., `k ≥ n − t + 1`) guarantees the competing branch is unreachable. Executors that use `≥` — the intuitive reading of "enough signatures" — are wrong at precisely one point, and Byzantine validators can steer the system to that point. ## Operational Effect When the invariant is enforced with the strict `>` bound, the observable behavior changes in three ways: 1. **Speculation stalls one step earlier.** With n=8, t=5, speculation halts at k=4 instead of proceeding. This costs latency (one round-trip to quorum) but eliminates split-brain side effects. The latency cost is bounded and predictable. 2. **Irreversible steps are never speculated regardless of k.** The `effect_is_reversible` disjunct short-circuits: provisioning, payments, and external writes always wait for quorum. This is the dominant cost in practice and the dominant safety win. 3. **Equivocation becomes a hard fault, not a soft anomaly.** A validator signing two branches triggers a `SpeculationDivergenceError` that halts the plan and forces federation-level reconciliation, rather than being absorbed as noise. The residual risk is that a slow-but-honest validator is indistinguishable from a withholding Byzantine one until timeout; the bound handles this correctly (it treats silence as "could still sign competing branch," which is the conservative and correct assumption), at the cost of unnecessary stalls when validators are merely slow. That trade — stalls over split-brain — is the correct one for irreversible effects. ```python from dataclasses import dataclass from enum import Enum class EffectKind(Enum): REVERSIBLE = "reversible" IRREVERSIBLE = "irreversible" class SpeculationDivergenceError(RuntimeError): """Raised when speculative execution has advanced past the quorum-reachability bound, or when a validator is observed equivocating across branches.""" pass @dataclass(frozen=True) class Step: index: int effect: EffectKind branch_id: str @dataclass(frozen=True) class SpeculationState: n_validators: int threshold: int signatures_on_executed_branch: int equivocation_detected: bool validator_set_static: bool def safe_to_speculate(step: Step, state: SpeculationState) -> bool: if state.equivocation_detected: raise SpeculationDivergenceError( f"equivocation detected at step {step.index}; " f"cannot bound competing-branch reachability" ) if not state.validator_set_static: # dynamic sets make quorum-reachability uncomputable; refuse speculation return False if step.effect is EffectKind.REVERSIBLE: return True # IRREVERSIBLE: strict inequality. At k == n - t, exactly t validators remain, # which is sufficient for a competing quorum. Only k > n - t is safe. return state.signatures_on_executed_branch > state.n_validators - state.threshold def advance_speculative_frontier( steps: list[Step], state: SpeculationState ) -> int: """Returns the index of the last step safe to execute speculatively. Raises if an already-executed irreversible step violates the bound.""" last_safe = -1 for step in steps: if safe_to_speculate(step, state): last_safe = step.index else: break # Detect the boundary failure: an irreversible step already executed # at k == n - t (the off-by-one). if ( state.signatures_on_executed_branch == state.n_validators - state.threshold and any(s.effect is EffectKind.IRREVERSIBLE for s in steps[: last_safe + 1]) ): raise SpeculationDivergenceError( f"irreversible step executed at boundary k={state.signatures_on_executed_branch} " f"(n={state.n_validators}, t={state.threshold}); competing quorum reachable" ) return last_safe ```