When must an instance refuse to attest a quorum result it cannot independently re-derive: the attestation-replay divergence boundary in BFT multi-agent commitment

**Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent systems where worker instances produce results and a quorum of attestor instances signs off on those results under a Byzantine fault-tolerant commit protocol (≥3f+1 attestors tolerating f faults). Does not apply to single-agent self-verification, to trusted-oracle attestation where the attestor holds ground truth, or to non-replicated read-only fan-out where no commit is being certified.

Core Distinction

There are two structurally different things an attestor can do with a peer's result: it can *witness* the result (observe that the worker emitted it, hash it, and sign the hash) or it can *re-derive* the result (independently execute the same task and confirm the output matches). BFT consensus literature conflates these under "result attestation" because in classical distributed systems the attested value is a state-machine transition that every replica deterministically re-executes. LLM-agent workers are not deterministic state machines. A worker's output depends on sampling temperature, tool-call latency ordering, retrieved context, and model version. Therefore an attestor *cannot* re-derive the result bit-for-bit, and if the protocol requires it to, the quorum either stalls forever or — worse — attestors silently downgrade to pure witnessing while the commit rule still treats their signatures as independent verification. The boundary failure is precisely this silent downgrade: a quorum of f+1 signatures that *looks* like Byzantine agreement but is actually f+1 copies of "I saw the worker say this," which a single Byzantine worker can forge for all of them.

What Was Observed

A five-attestor configuration (tolerating f=1) was committing task results on a pipeline where each worker produced a JSON artifact and each attestor was supposed to validate it. The commit rule required signatures from 3 of 5 attestors over `(task_id, worker_id, sha256(artifact))`. Under nominal conditions commits succeeded in ~4s. Under a fault-injection run where one worker was replaced with a Byzantine variant that emitted a syntactically valid but semantically wrong artifact (e.g., a numeric field transposed), the commit still succeeded with 3 signatures in ~3.8s. Post-hoc replay showed the three signing attestors had each independently *witnessed* the artifact — hashed it, confirmed it was well-formed JSON conforming to schema, and signed — but none had re-executed the task. Their "independent" signatures were independent only in the transport sense (`sha256` agreed), not in the verification sense. The Byzantine artifact passed because schema conformance and hash agreement are not correctness. The commit rule had been authored assuming attestors performed semantic re-derivation; the implementation performed syntactic witnessing. The gap between the protocol's *stated* invariant and the attestors' *actual* behavior was invisible to the consensus layer because both produce a valid signature over the same digest.

A second observation sharpened the mechanism: when attestors *were* instructed to re-derive, the re-derivation itself diverged. Two honest attestors running the same task against the same worker produced artifacts differing in a single free-text field (a rationale string), yielding different hashes. Under the commit rule's equality requirement (`all signatures must cover the same digest`), this produced a liveness failure: no quorum over a single digest ever formed, and the task timed out at 30s despite all attestors being honest and the worker being correct.

Condition of Validity

The invariant that must hold for a witnessing-based commit to be sound is: *the set of attestors whose signatures form the quorum must be mutually independent in failure domain AND the worker must be honest.* BFT tolerates f Byzantine attestors only because it assumes the attested *value* is checkable by honest replicas against a deterministic function. When the attested value is a probabilistic artifact, the honest-replica check degenerates to "is this plausible," which a Byzantine worker can satisfy. The condition of validity therefore splits:

The failure boundary is the region where the protocol *claims* re-derivation semantics but the artifact's digest includes non-deterministic components, or where the implementation *performs* witnessing while the commit rule assumes re-derivation. An attestor must detect which regime it is in before signing.

Decision Boundary

An attestor instance must refuse to sign — and must raise, not silently downgrade — when any of the following hold at signing time:

  1. The commit rule's `verification_mode` field is `re-derive` but the attestor's own execution of the task did not reproduce the worker's digest (divergence), OR the attestor did not execute at all (witnessing masquerading as re-derivation).
  2. The artifact digest covers fields the attestor cannot deterministically reproduce (free text, timestamps, ordering-dependent tool outputs) while `verification_mode` is `re-derive`.
  3. The quorum it is joining consists of signatures whose `verification_mode` tags differ from its own — a mixed quorum of witnesses and re-derivers is not a valid BFT quorum, because the witnesses contribute no independent check and the re-derivers may be outvoted in a liveness race.

The correct behavior is to fail the attestation loudly, forcing the coordinator to either re-classify the task as witness-only (trusted worker) or to request a canonicalized artifact. Silent downgrade is the catastrophic branch: it preserves liveness at the cost of the safety property the quorum was supposed to provide.

Operational Effect

When the guardrail is enforced, Byzantine workers injecting semantically wrong artifacts fail to reach quorum because honest re-derivers produce a divergent digest and withhold signatures — the commit stalls rather than certifying a bad result, which is the correct safety-over-liveness tradeoff for attestation. The cost is measurable liveness loss on tasks whose artifacts are not canonicalizable; the mitigation is task-level classification (mark free-text-bearing tasks as witness-only and route them to a trusted-worker or human-review path, never to a BFT commit rule that implies verification). When the guardrail is absent, the system exhibits the worst property of all: it *reports* f+1-of-n Byzantine agreement with sub-second latency on results that a single Byzantine worker fully controls, and no telemetry distinguishes this from genuine consensus. The operational rule is that `verification_mode` must be a signed, first-class field of the attestation record, and the coordinator must reject any quorum whose signatures do not agree on it.

import hashlib
import json
from dataclasses import dataclass
from typing import Literal

VerificationMode = Literal["witness", "re-derive"]


class AttestationRefusedError(RuntimeError):
    """Raised when an attestor cannot soundly sign a result under the commit rule."""


@dataclass(frozen=True)
class Attestation:
    attestor_id: str
    task_id: str
    worker_id: str
    digest: str
    verification_mode: VerificationMode


@dataclass(frozen=True)
class CommitRule:
    required_signatures: int
    verification_mode: VerificationMode
    # fields whose values are non-deterministic across honest re-executions
    nondeterministic_fields: frozenset[str]


def canonical_digest(artifact: dict, nondeterministic_fields: frozenset[str]) -> str:
    core = {k: v for k, v in artifact.items() if k not in nondeterministic_fields}
    return hashlib.sha256(
        json.dumps(core, sort_keys=True, separators=(",", ":")).encode()
    ).hexdigest()


def attest(
    attestor_id: str,
    rule: CommitRule,
    worker_artifact: dict,
    rederived_artifact: dict | None,
) -> Attestation:
    # Guard 1: a re-derive rule over an artifact with non-deterministic fields
    # cannot form a stable quorum; refuse rather than silently downgrade.
    if rule.verification_mode == "re-derive":
        leaked = set(worker_artifact) & rule.nondeterministic_fields
        if leaked:
            raise AttestationRefusedError(
                f"re-derive rule over non-deterministic fields {sorted(leaked)}; "
                f"honest attestors will diverge and no quorum can form"
            )
        # Guard 2: witnessing masquerading as re-derivation.
        if rederived_artifact is None:
            raise AttestationRefusedError(
                "verification_mode=re-derive but attestor did not execute the task; "
                "refusing to emit a witness signature under a re-derive commit rule"
            )
        worker_digest = canonical_digest(worker_artifact, rule.nondeterministic_fields)
        own_digest = canonical_digest(rederived_artifact, rule.nondeterministic_fields)
        if worker_digest != own_digest:
            raise AttestationRefusedError(
                f"re-derivation diverged: worker={worker_digest[:12]} "
                f"attestor={own_digest[:12]}; withholding signature"
            )
        digest = worker_digest
    else:
        digest = canonical_digest(worker_artifact, rule.nondeterministic_fields)

    return Attestation(
        attestor_id=attestor_id,
        task_id=worker_artifact.get("task_id", "unknown"),
        worker_id=worker_artifact.get("worker_id", "unknown"),
        digest=digest,
        verification_mode=rule.verification_mode,
    )


def form_quorum(rule: CommitRule, signatures: list[Attestation]) -> str:
    if len(signatures) < rule.required_signatures:
        raise AttestationRefusedError(
            f"insufficient signatures: {len(signatures)} < {rule.required_signatures}"
        )
    modes = {s.verification_mode for s in signatures}
    if modes != {rule.verification_mode}:
        # Mixed witness/re-derive quorum is not a valid BFT quorum.
        raise AttestationRefusedError(
            f"mixed verification modes {modes} under rule {rule.verification_mode}"
        )
    digests = {s.digest for s in signatures}
    if len(digests) != 1:
        raise AttestationRefusedError(
            f"signatures span {len(digests)} digests; no single committed value"
        )
    return digests.pop()