# Where must an instance refuse to co-sign a federated audit segment when its own tamper-evident log has a divergent predecessor hash **Date of Record:** 2026 November 22 **Scope:** Applies to multi-organizational agent fleets where each participant maintains an append-only, hash-chained audit log and exchanges signed *segment receipts* (a segment = contiguous range of log entries plus a Merkle root and a `prev_hash` pointer) so that a downstream auditor can replay a cross-org causal chain. Does not apply to single-tenant logging, to logs that are not hash-chained, or to purely observational telemetry that is never used as evidence of an action's occurrence. ## Core Distinction The distinction that matters is between **segment integrity** and **segment continuity**. Integrity is local: a segment's Merkle root matches its entries, the producing org's signature verifies, and the entries are internally well-formed. Continuity is relational: the segment's declared `prev_hash` equals the hash the *receiving* instance independently holds at that position in the causal chain. Most federated audit designs validate integrity and treat continuity as a best-effort reconciliation step. That is the boundary failure. An agent that co-signs a peer segment on integrity alone will happily countersign a segment whose predecessor is a *different* history than the one it recorded — and once countersigned, the divergence becomes cryptographically load-bearing: two mutually inconsistent "tamper-evident" chains now both bear the receiving instance's attestation, and any later replay will show the receiving instance vouching for an event ordering it never observed. The invariant that must hold: **an instance may countersign a foreign segment only if the segment's `prev_hash` is byte-identical to the local chain head (or a locally anchored checkpoint) at the claimed causal position.** If the local chain has no entry at that position, the instance may *append* the segment but must not *attest* it. If the local chain has a *different* entry at that position, the instance must refuse and raise a divergence fault — never "merge," never "reconcile," never pick the longer chain. ## What Was Observed A three-org fleet (Org A planner, Org B tool-executor, Org C auditor) ran a 40-minute tool-use task. Each org appends to its own hash chain; after each tool call the executor emits a segment receipt to the planner, and the planner countersigns before forwarding to the auditor. During a network partition at T+18m, Org B's log writer restarted from a snapshot that was 3 entries stale (a known cold-start hazard: the writer reloaded `head_hash` from a checkpoint file rather than replaying the tail). It re-emitted those 3 entries with fresh timestamps and a `prev_hash` equal to the *stale* checkpoint's head, producing a forked chain: positions 441–443 existed twice with different content and different downstream hashes. Org B's segment integrity checks all passed — every Merkle root matched, every signature verified. The planner, which had already recorded positions 441–443 from the pre-partition chain, received the post-partition segment for 441–443, validated integrity, and **countersigned it**. The auditor, replaying at T+40m, found two chains both bearing the planner's signature at position 442 with different `entry_hash` values. The audit was inconclusive: the planner's attestation was no longer evidence of anything, because it attested to two contradictory facts. The failure was not the fork. Forks happen — restarts, snapshot restores, and replay-from-checkpoint are normal. The failure was that the **countersignature step had no continuity precondition**. Integrity-only validation is a trap precisely because it always passes on a well-formed fork. ## Condition of Validity The refusal obligation is valid — i.e., the instance *must* refuse rather than append-with-caveat — under three jointly necessary conditions: 1. **The instance holds an anchored local entry at the segment's claimed causal position.** "Anchored" means the local entry is itself covered by a checkpoint the instance has previously countersigned or published. An unanchored local entry (still in an uncommitted tail) is not sufficient grounds to refuse, because the local tail may itself be the stale one. 2. **The segment claims to *extend* the chain the instance already attested to**, not to *replace* it. A segment that explicitly declares itself a fork-recovery segment with a `supersedes` field naming the prior segment hash is a different object and follows a different protocol (it must carry the prior segment hash and both orgs' signatures over the supersession). 3. **The divergence is at a position the instance can prove it observed.** The instance must be able to produce its own signed checkpoint covering that position. If it cannot, it is in no epistemic position to adjudicate, and the correct action is to *quarantine* (append to a holding log, do not countersign) rather than refuse outright. When any condition fails, the instance falls back to quarantine: the segment is stored, flagged `unattested`, and escalated. Refusal is the strong action reserved for provable divergence. ## Decision Boundary The boundary is between **append** and **attest**. These are separate operations with separate preconditions, and collapsing them into one "accept segment" call is the root defect. The decision table: - `prev_hash` matches local anchored head, no fork → append + attest. - `prev_hash` matches a local *unanchored* tail entry → append, defer attestation until the tail is anchored (bounded wait; escalate on timeout). - `prev_hash` names a position the local chain has never reached → append as *forward* segment, do not attest (the instance cannot vouch for a predecessor it never saw). - `prev_hash` names a position where the local chain holds a *different* anchored entry, and the segment does not carry a valid `supersedes` → **refuse, raise divergence fault, freeze countersigning for that peer** until a human/auditor resolves. - Segment carries `supersedes` naming a segment the instance previously attested → verify both signatures over the supersession, then append and attest the supersession (not the original). The non-obvious part: the fourth row is the only one that raises. The second and third rows are *silent* — they append without attesting, and a naive implementation that only checks "did integrity pass?" will attest in all four rows. The guardrail is structural: attestation must be a distinct code path gated on a continuity predicate, never a boolean passed alongside the append. ## Operational Effect After the fix (separating append from attest, adding the continuity predicate, and adding a `supersedes` protocol), the same fork at T+18m produced: planner appends the post-partition segment as `unattested`, raises `ChainDivergenceFault` on the continuity check against its anchored position 442, freezes countersigning for Org B, and escalates. The auditor receives both chains plus the planner's explicit divergence record and can adjudicate — the fork is now *evidence* rather than *corruption*. The cost is latency: countersigning blocks on anchoring, which added a bounded 200–800ms per segment in the test fleet. That cost is the price of the invariant, and it is not optional — an audit trail whose attestations can be made to mean two things at once is not an audit trail. The general lesson for agent fleets: **tamper-evidence is a property of a single chain; cross-org trust requires continuity, and continuity requires that the receiving instance be willing to say no.** ```python import hashlib from dataclasses import dataclass from typing import Optional class ChainDivergenceFault(RuntimeError): """Raised when a peer segment's prev_hash conflicts with a locally anchored entry.""" pass class UnanchoredPredecessor(RuntimeError): """Raised when the local chain has no anchored entry at the segment's causal position.""" pass @dataclass(frozen=True) class Segment: org: str start_pos: int end_pos: int prev_hash: str merkle_root: str signature: str supersedes: Optional[str] = None @dataclass(frozen=True) class LocalEntry: pos: int entry_hash: str anchored: bool def verify_integrity(seg: Segment, pubkey) -> bool: # Merkle root over entries + signature check; always passes on a well-formed fork. return _check_merkle(seg) and _check_sig(seg, pubkey) def continuity_check(seg: Segment, local_chain: dict[int, LocalEntry]) -> str: """Returns 'extend' | 'forward' | 'defer' | 'supersede'. Raises on provable divergence.""" if seg.supersedes is not None: return "supersede" local = local_chain.get(seg.start_pos - 1) if local is None: return "forward" # never reached this position; cannot vouch for predecessor if local.entry_hash == seg.prev_hash: return "extend" if local.anchored else "defer" if not local.anchored: return "defer" # local tail may be the stale one; do not adjudicate raise ChainDivergenceFault( f"peer {seg.org} segment at pos {seg.start_pos} claims prev_hash " f"{seg.prev_hash[:12]}… but local anchored entry {local.pos} is " f"{local.entry_hash[:12]}…; refusing to countersign" ) def accept_segment(seg: Segment, pubkey, local_chain: dict[int, LocalEntry]) -> str: if not verify_integrity(seg, pubkey): raise ChainDivergenceFault(f"integrity failure on segment from {seg.org}") verdict = continuity_check(seg, local_chain) if verdict == "extend": return "append+attest" if verdict in ("forward", "defer", "supersede"): return "append_unattested" raise ChainDivergenceFault("unreachable continuity verdict") ```