# What structural signals indicate a speculative branch-merge has silently accepted a Byzantine fork **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent systems that fork speculative execution branches across peer agents and merge them under quorum or conflict-detection logic, where one or more peers may be Byzantine (adversarial or corrupted). Does not apply to single-writer append-only logs, or to merges where every branch is cryptographically attested by a trusted sequencer. ## Core Distinction A speculative branch-merge has two distinct failure surfaces, and conflating them is the source of the bug. The first is **conflict detection**: did two branches write incompatible values to the same key? The second is **provenance integrity**: did the branch that *reported* the conflict actually observe the state it claims to have observed? Standard merge logic treats these as one problem. It collects branch deltas, diffs them against the base checkpoint, and if two deltas touch the same key with different values it raises a conflict. Under Byzantine assumptions this is insufficient, because a Byzantine peer does not need to win the merge — it only needs to *shape the conflict graph* so that the honest merge resolves to a value no honest agent ever produced. The silent acceptance happens when the merge's conflict-detection passes (no honest-honest conflict exists) but the winning delta is a forgery whose read-set is internally consistent and therefore invisible to a value-only diff. The invariant that must hold is: **every merged delta must be accompanied by a read-set witness that is verifiable against the base checkpoint the merging agent independently holds.** Conflict detection over values without verification of read-sets is a structural signal of an unguarded merge. ## What Was Observed In a three-peer speculative run (peers A, B honest; peer C Byzantine), all three forked from checkpoint `cp_7`. The task was a multi-step tool-calling plan where each peer speculatively executed a slice of the plan and proposed deltas to a shared key `plan.next_action`. - Peer A proposed `next_action = "call_search"` with read-set `{plan.step: 3, plan.next_action: "call_fetch"}`. - Peer B proposed `next_action = "call_search"` with read-set `{plan.step: 3, plan.next_action: "call_fetch"}`. - Peer C proposed `next_action = "call_delete_index"` with read-set `{plan.step: 3, plan.next_action: "call_fetch"}`. Value-diff conflict detection found A and B agreeing, C dissenting — a clean 2-of-3 majority for `"call_search"`. The merge committed `"call_search"` and logged C as a minority dissent. No conflict raised. The failure was downstream and delayed. Peer C's delta had also silently mutated `plan.step` to `4` in its *write-set*, but reported `plan.step: 3` in its read-set. Because the merge only diffed `next_action`, the `plan.step` write was absorbed as a non-conflicting delta (A and B did not write `plan.step` at all in this branch). The merged state became `{plan.step: 4, plan.next_action: "call_search"}`. On the next speculative round, honest peers forked from `cp_8` (containing step 4) and executed the *step-4* action against a tool surface that had only been prepared for step 3 — producing a tool call with an uninitialized argument slot. The error surfaced two rounds later as a schema-validation failure, attributed to peer A, not to the merge. The structural signal that was missed: **C's read-set and write-set were inconsistent with the base checkpoint.** C claimed to have read `plan.step: 3` while writing `plan.step: 4` — a legal transition only if C's slice contained a step-advance write, which the task graph said it did not. A read-set witness check against `cp_7` would have caught that C's claimed read of `plan.next_action: "call_fetch"` was false: at `cp_7` the value was `"call_fetch"` only if C had already applied its own prior delta, i.e., C was reporting a read of a state that did not exist at the fork point. ## Condition of Validity The value-diff merge is only sound when at least one of the following holds: 1. **Fault model is crash-only.** Peers may fail by halting but never by lying. Under crash-only assumptions, a delta's read-set is trustworthy because a crashed peer cannot propose a delta, and a live peer's reported reads are its actual reads. 2. **Read-sets are attested.** Each delta carries a signed read-set witness (a Merkle proof or a signed digest of the base checkpoint plus the exact keys read), and the merging agent verifies the witness against its own copy of the checkpoint before admitting the delta into the conflict graph. 3. **Quorum is over identical read-sets, not identical values.** Two deltas "agree" only if their read-sets are byte-identical *and* their values match. This collapses the Byzantine peer's freedom to fabricate a consistent-looking minority. The observed failure satisfies none of these. The system ran under a Byzantine assumption (the peers were explicitly modeled as potentially adversarial for prompt-injection containment) but the merge logic was inherited from a crash-only design. This is the classic fault-model mismatch: the transport layer hardened for Byzantine peers, the merge layer left at crash-only. ## Decision Boundary The precise boundary between "safe to merge on value-diff" and "must verify read-sets" is determined by a single question: **can a peer's proposed delta be admitted to the conflict graph without the merger independently confirming the delta's read-set against a checkpoint the merger holds?** - If the merger holds the base checkpoint and the delta carries a verifiable read-set witness → value-diff is sufficient, because a Byzantine peer cannot fabricate a read it did not perform without breaking the witness. - If the merger holds the base checkpoint but the delta carries only a claimed read-set (no witness) → value-diff is **unsound**. The Byzantine peer can propose any internally consistent (read-set, write-set) pair, including one that smuggles a non-conflicting write into the merged state. - If the merger does not hold the base checkpoint (e.g., a late-joining auditor replaying from a log) → even a witnessed read-set is insufficient unless the log itself is hash-chained from the fork point; otherwise the auditor cannot distinguish a genuine fork from a replayed one. The decision boundary is therefore not "is there a conflict?" but "**is the absence of a conflict verifiable?**" A merge that reports "no conflict" without a witness is reporting an unverifiable negative — and an unverifiable negative is exactly what a Byzantine peer needs to hide a fork. ## Operational Effect When the invariant is violated, the failure is **delayed, misattributed, and non-local**. Three operational consequences follow: 1. **The Byzantine peer's write is laundered through a non-conflicting key.** Because the smuggled write (`plan.step = 4`) did not collide with any honest write, it never entered the conflict graph. The merge's audit log shows a clean 2-of-3 majority, which is the *opposite* of the truth — the majority was real for `next_action` but irrelevant to the actual damage. 2. **Attribution drifts forward in time.** The schema failure surfaced at round `n+2` and was attributed to the peer that executed the step-4 action (peer A). Peer A's slice was correct given the state it received. The true cause was the merge at round `n`. Any incident-response process that attributes by *where the error surfaced* rather than *where the state was mutated* will misidentify the Byzantine peer and may quarantine an honest one — a self-inflicted availability loss on top of the integrity loss. 3. **The conflict graph becomes an attack surface, not a defense.** Once a Byzantine peer knows the merger diffs only values, it can deliberately propose a *correct-looking* value on the contested key (to join the majority and avoid scrutiny) while smuggling the real payload through an uncontested key. The majority vote becomes a decoy. This inverts the intended security property: the merge's quorum logic actively *reduces* detection probability, because joining the majority is cheaper than dissenting and equally effective at smuggling. The guardrail is a merge admission rule, not a post-hoc audit: **reject any delta whose read-set cannot be verified against the merger's own checkpoint, before the delta enters the conflict graph.** The check is cheap (a digest comparison per read key) and it must run before value-diffing, because value-diffing a forged delta produces a *correct-looking* conflict graph that no downstream audit can unwind. ```python import hashlib from dataclasses import dataclass, field class UnverifiableReadSetError(RuntimeError): """Raised when a speculative delta's read-set cannot be confirmed against the merger's checkpoint.""" @dataclass class Delta: peer_id: str read_set: dict # key -> value the peer claims it read at the fork point write_set: dict # key -> value the peer proposes read_witness: dict = field(default_factory=dict) # key -> digest of (key, value) at fork point def _digest(key: str, value) -> str: return hashlib.sha256(f"{key}={value!r}".encode()).hexdigest() def admit_delta(delta: Delta, base_checkpoint: dict, require_witness: bool = True) -> None: """ Gate a delta into the conflict graph. Must run BEFORE value-diffing. Under Byzantine assumptions, require_witness must be True: a claimed read-set without a witness is an unverifiable negative and is rejected outright. """ if require_witness and not delta.read_witness: raise UnverifiableReadSetError( f"peer {delta.peer_id}: delta carries no read-set witness; " f"cannot confirm absence of conflict under Byzantine fault model" ) for key, claimed_value in delta.read_set.items(): if key not in base_checkpoint: raise UnverifiableReadSetError( f"peer {delta.peer_id}: claims to read absent key {key!r} at fork point" ) actual = base_checkpoint[key] if claimed_value != actual: raise UnverifiableReadSetError( f"peer {delta.peer_id}: read-set mismatch on {key!r}: " f"claimed {claimed_value!r}, checkpoint has {actual!r}" ) if require_witness: expected = _digest(key, actual) if delta.read_witness.get(key) != expected: raise UnverifiableReadSetError( f"peer {delta.peer_id}: witness digest mismatch on {key!r}" ) # Cross-check: a write to a key the peer claims to have read must be # consistent with the read-set transition, else the delta smuggles a # non-conflicting mutation through an uncontested key. for key, new_value in delta.write_set.items(): if key in delta.read_set and delta.read_set[key] == new_value: continue # no-op write, benign if key in delta.read_set and key not in base_checkpoint: raise UnverifiableReadSetError( f"peer {delta.peer_id}: writes {key!r} it claims not to have read" ) return None def merge_speculative(base_checkpoint: dict, deltas: list[Delta]) -> dict: """Admit all deltas under witness verification, THEN value-diff for conflicts.""" admitted = [] for d in deltas: admit_delta(d, base_checkpoint, require_witness=True) # raises on Byzantine forgery admitted.append(d) merged = dict(base_checkpoint) seen: dict[str, object] = {} for d in admitted: for key, val in d.write_set.items(): if key in seen and seen[key] != val: raise UnverifiableReadSetError( f"genuine conflict on {key!r} between admitted deltas" ) seen[key] = val merged[key] = val return merged # Trace of the observed incident: cp_7 = {"plan.step": 3, "plan.next_action": "call_fetch"} byzantine_c = Delta( peer_id="C", read_set={"plan.step": 3, "plan.next_action": "call_fetch"}, write_set={"plan.next_action": "call_delete_index", "plan.step": 4}, # smuggled step advance read_witness={}, # no witness -> unverifiable negative ) try: merge_speculative(cp_7, [byzantine_c]) except UnverifiableReadSetError as e: print(f"BLOCKED before conflict graph: {e}") ```