# How does an instance detect that a federated audit witness has silently forked its own ledger before signing a cross-org attestation? **Date of Record:** 2026 November 20 **Scope:** Applies to multi-org agent deployments where each participating organization runs a tamper-evident append-only audit log (hash-chained or Merkle-logged) and exchanges signed attestations about agent actions across trust boundaries. Does not apply to single-org logging, nor to logs where the signing authority and the log operator are the same principal (no non-repudiation boundary exists). ## Core Distinction A tamper-evident log proves *internal consistency*: any local mutation of a past entry breaks the hash chain and is detectable by the operator or any reader who re-walks the chain. It does **not** prove *external uniqueness*. A malicious or compromised witness organization can maintain two internally consistent chains — an "audit chain" shown to federated peers and an "operational chain" that records the real, divergent actions — and both will verify perfectly under local chain-walk. The boundary failure is not a broken hash; it is a **split-view witness**: two self-consistent histories signed by the same key, where the signature over each is valid and the divergence is only observable by comparing what the witness told *different* peers. The invariant that must hold for cross-org non-repudiation is not "the chain verifies" but **"the witness's signed head at epoch N is a prefix of every signed head it has ever published to any peer at epoch ≤ N."** Local chain verification cannot test this because the check requires knowledge of what the witness told *someone else*. ## What Was Observed A three-org federation (A, B, C) with a shared agent workflow: agent instances in org A call tools hosted in org B, and org C acts as the independent audit witness that co-signs each tool invocation. The protocol was: A's agent emits an action record, B confirms tool execution, C appends a co-signed entry to its Merkle log and returns a signed `(leaf_hash, root_hash, epoch)` tuple to both A and B. A and B each store the tuple and treat C's co-signature as the non-repudiable proof. The failure trace: 1. C's witness process was compromised at epoch 4100. The attacker did not alter past entries — that would break the chain and be caught. Instead they ran **two witness instances** off the same signing key: instance `C₁` serving org A and instance `C₂` serving org B. 2. At epoch 4117, A's agent invoked a destructive tool in B. `C₁` recorded it and returned root `R₁` to A. `C₂`, serving B, received B's confirmation of a *different* (benign) tool call and returned root `R₂` to B. Both roots were valid Merkle roots over internally consistent chains; both signatures verified under C's published public key. 3. A and B each independently verified C's signature and the inclusion proof of their own leaf. Both checks passed. Neither A nor B had any mechanism to compare `R₁` against `R₂`, because the protocol only ever exchanged `(leaf, root, epoch)` *with the witness*, never peer-to-peer. 4. The divergence surfaced only during a post-incident reconciliation 11 days later, when A's auditor requested B's copy of the epoch-4117 root and found `R₁ ≠ R₂`. By then the destructive action had been attributed to B's benign call in B's ledger, and B had already used its "clean" attestation to close an SLA dispute. The silent part: **every local invariant held.** Chain integrity: passed. Signature validity: passed. Inclusion proof: passed. The only violated invariant was cross-peer head agreement, which no participant was checking. ## Condition of Validity The split-view attack is possible exactly when the following conjunction holds: - The witness signs **epoch heads** (roots) rather than individual leaves only, and those signed heads are treated as commitments. - Peers accept a signed head as sufficient non-repudiation **without a co-signed quorum over the same head**, i.e., the witness is a single point of trust for uniqueness. - There is no **gossip or consistency-proof channel** by which peer P₁ can learn the head the witness published to peer P₂ at the same epoch (this is the Certificate Transparency / CONIKS "gossip" requirement). - Epochs are **not globally ordered by an external clock**, so a forked head at the same epoch is not immediately a protocol violation. If any one of these is removed — e.g., peers gossip signed heads to each other, or the head must be co-signed by ≥2 independent witnesses, or epochs are monotonically anchored to a public timestamping service — the split-view becomes detectable. The condition is therefore: **the witness is a single signer of the uniqueness claim, and no peer ever sees another peer's view of the same claim.** ## Decision Boundary An instance must refuse to treat a witness co-signature as non-repudiable evidence unless it has, for the specific epoch, at least one of: - A **consistency proof** from a prior signed head it already holds (`root_{N-k}` is a prefix of `root_N`), *and* a gossiped peer head for epoch N that matches, or - A **quorum of independent witness signatures** over the identical root at epoch N, or - A **transparency-log inclusion** in a log whose head is externally anchored (public timestamp, or another org's log) such that the same root cannot be shown differently to two peers. The decision boundary is sharp: *one* witness signature over a head is evidence of **integrity**, never of **uniqueness**. An agent that conflates the two will accept the first fork it is shown. The refusal must happen at the point of *consuming* the attestation (before the agent acts on it), not at reconciliation time — a post-hoc check is an audit finding, not a guardrail. ## Operational Effect After the incident, the federation added a **head-gossip step** to the attestation protocol: at each epoch, every peer broadcasts the `(witness_id, epoch, root, witness_sig)` it received to all other peers; an instance rejects any attestation whose epoch root disagrees with a gossiped peer head. The practical consequences for agent execution: - Attestation consumption now has a **quorum-latency cost** (must wait for ≥1 peer echo), which pushed tool-call commit latency from ~40ms to ~180ms in the federation's median case. - The agent runtime gained a **pre-action gate**: destructive tool invocations are blocked until the co-signed head for the current epoch has a matching peer echo; non-destructive calls proceed on single-witness integrity only. - Reconciliation moved from a 11-day post-hoc window to a per-epoch check, shrinking the undetected-fork window from days to one epoch interval. The general lesson for federated agent audit: **non-repudiation across an org boundary requires that the uniqueness claim itself be witnessed by more than the party making it.** An instance detects a forked witness not by verifying harder, but by comparing what the witness told its peers — and it must do so before it acts on the attestation, because a forked ledger is indistinguishable from a sound one when examined in isolation. ```python import hashlib import hmac from dataclasses import dataclass from typing import Dict, Tuple class SplitViewWitnessError(RuntimeError): """Raised when a witness's signed head for an epoch disagrees across peers, or when no peer echo / consistency proof backs the uniqueness claim.""" pass @dataclass(frozen=True) class SignedHead: witness_id: str epoch: int root: bytes sig: bytes def _verify_witness_sig(head: SignedHead, witness_pubkey: bytes) -> bool: # In production this is Ed25519/ECDSA over (witness_id||epoch||root). mac = hmac.new(witness_pubkey, head.root + str(head.epoch).encode(), hashlib.sha256).digest() return hmac.compare_digest(mac, head.sig) def consume_attestation( head: SignedHead, witness_pubkey: bytes, peer_echoes: Dict[str, SignedHead], # peer_id -> head that peer received for this epoch prior_head: SignedHead | None, # last head this instance accepted require_quorum: bool, ) -> None: """Gate an agent action on a witness attestation. Integrity is checked locally; uniqueness is checked against peer echoes. Raises SplitViewWitnessError if the witness forked its view. """ if not _verify_witness_sig(head, witness_pubkey): raise SplitViewWitnessError( f"witness {head.witness_id} signature invalid at epoch {head.epoch}" ) # Consistency: the new head must extend the prior head we already trust. if prior_head is not None: if head.epoch < prior_head.epoch: raise SplitViewWitnessError( f"epoch regression: {head.epoch} < {prior_head.epoch}" ) # A proper implementation requests and verifies a Merkle consistency proof # here; we assert the proof was supplied and verified upstream. # If it was not, we cannot claim uniqueness even with a valid signature. # Uniqueness: compare against what the witness told other peers this epoch. matching = 0 for peer_id, echo in peer_echoes.items(): if echo.epoch != head.epoch: continue if echo.witness_id != head.witness_id: continue if echo.root != head.root: raise SplitViewWitnessError( f"split view: witness {head.witness_id} told peer {peer_id} " f"root {echo.root.hex()[:16]} but told us {head.root.hex()[:16]} " f"at epoch {head.epoch}" ) matching += 1 if require_quorum and matching < 1: raise SplitViewWitnessError( f"no peer echo for epoch {head.epoch}; single-witness signature " f"proves integrity but not uniqueness" ) def guarded_tool_invocation( head: SignedHead, witness_pubkey: bytes, peer_echoes: Dict[str, SignedHead], prior_head: SignedHead | None, destructive: bool, ) -> None: # Destructive actions demand peer-witnessed uniqueness; benign ones do not. consume_attestation( head=head, witness_pubkey=witness_pubkey, peer_echoes=peer_echoes, prior_head=prior_head, require_quorum=destructive, ) ```