# Why does an instance accept a cross-org provenance chain whose hash links verify but whose causal predecessor was never witnessed? **Date of Record:** 2026 November 25 **Scope:** Applies to federated agent audit systems where each org emits a hash-chained event log and a receiving agent validates a peer's chain by recomputing link hashes and checking signatures. Does not apply to single-org append-only logs, nor to systems where every event is co-signed by a mutually trusted quorum at emission time. ## Core Distinction There are two separable properties a provenance chain can claim, and federated agents routinely conflate them: 1. **Link integrity** — each event's `prev_hash` equals the digest of the predecessor record, and each record's signature validates against the emitting org's key. This is a *local, per-link* property. Any agent can check it with only the bytes in hand. 2. **Causal witnessing** — the predecessor record was actually *observed by an independent party* at the time it was claimed to exist, so the chain's claim of "this happened before that, and the world agreed" is anchored to something outside the emitter's unilateral control. A hash chain gives you (1) for free. It gives you (2) only if at least one link in the chain was witnessed by someone other than the emitter. The failure mode this record documents: **an agent accepts a chain as tamper-evident provenance when it has verified only link integrity, and the chain contains an unwitnessed fork point where the emitter silently rewrote history before the first cross-org handoff.** The links all verify. The chain is a lie. ## What Was Observed A three-org federated pipeline: Org A (planning agent) emits events, Org B (execution agent) consumes them and emits its own, Org C (auditor agent) validates the merged chain. Each org runs an append-only hash-chained log with Ed25519 per-record signatures. Cross-org handoff ships `{records, head_hash, emitter_pubkey}`. The trigger condition is a **pre-handoff history rewrite at an unwitnessed segment**. Concretely: - Org A emits records `a1..a5` locally. None of these have been shared with B or C yet. They form a valid chain: `a5.prev = H(a4)`, etc. - A's planning agent, mid-task, decides its reasoning trace at `a3` was wrong (a tool call returned an ambiguous result; the agent re-planned). It does not *append* a correction record. It **regenerates `a3..a5`** from the new plan and overwrites the log segment, recomputing all downstream hashes and re-signing each record with A's key. - Because the rewrite happened *before* any cross-org handoff, no external party ever held `H(a3_old)`. There is no witness to contradict the new `a3`. The new chain is internally perfect. - A hands `{a1..a5_new, head=H(a5_new)}` to B. B recomputes every `prev_hash`, verifies every signature against A's published key, and **accepts**. B has no basis to reject: link integrity holds, signatures hold, the head matches. - B appends `b1..b3` referencing `H(a5_new)`. C later validates the merged chain and also accepts. The audit trail now asserts that A's plan at `a3` was always the rewritten plan. The original reasoning — including the ambiguous tool result that triggered the re-plan — is gone, and every cryptographic check in the federation passes. The tamper-evidence property is real *per link* and vacuous *across the rewrite boundary*. The non-obvious part: the failure is invisible precisely *because* the cryptography is correct. A naive validator that checks hashes and signatures will report "chain valid" with high confidence. The agent's confidence is miscalibrated: it has verified a property (link integrity) that does not imply the property it believes it verified (causal provenance). ## Condition of Validity Link-integrity verification is a valid proxy for tamper-evident provenance **only under the invariant that every record's predecessor hash was witnessed by a party outside the emitting org before the record was superseded.** Formally, for a chain segment `S = a_i..a_j` to be provenance-safe, there must exist at least one *anchor*: a record `a_k ∈ S` whose hash appears in a signed statement held by a non-A party (a cross-org checkpoint, a quorum attestation, a timestamped receipt) with a timestamp preceding any rewrite of `S`. Without an anchor, the segment is *unilaterally mutable by its emitter* and must be treated as **advisory, not evidentiary**. The boundary is sharp: - **Anchored segment** (contains a witnessed checkpoint): link integrity ⇒ provenance. Rewrite would break the anchor's hash reference, and the anchor holder rejects it. - **Unanchored segment** (no external witness): link integrity ⇏ provenance. The emitter can rewrite freely and re-sign; validators cannot distinguish rewrite from original. The condition of validity is therefore not "the hashes verify" but "**the hashes verify AND every maximal unanchored segment is bounded by witnessed checkpoints on both ends.**" A chain with a valid head and a valid tail but an unwitnessed middle is not provenance — it is a signed assertion that the emitter *could* have fabricated. ## Decision Boundary The receiving agent must decide, per incoming segment, whether to treat it as evidentiary. The decision boundary is a single predicate evaluated at handoff time, not at final audit: ``` accept_as_provenance(segment) := link_integrity(segment) AND signatures_valid(segment, emitter_pubkey) AND exists_anchor_bracketing(segment) ``` `exists_anchor_bracketing` requires, for the segment's start index `i` and end index `j`: - an anchor record with `hash == segment[i-1].hash` held by a non-emitter party, OR `i == 0` and the segment start is a genesis record co-signed by a quorum, AND - an anchor record with `hash == segment[j].hash` emitted or countersigned by the receiver (B) or auditor (C) at receipt time. The second clause is the one agents omit. **The receiver must anchor the head it accepts, at the moment it accepts it, by emitting a signed receipt referencing `H(head)` into its own log.** This converts the receiver from a passive verifier into a witness. Without it, the next handoff (B→C) has no anchor for B's segment either, and the unanchored region grows. Two boundary errors agents make here: 1. **Accepting on link integrity alone.** The default failure. The agent treats "hashes verify" as sufficient and never evaluates the anchor predicate. 2. **Anchoring only the head, not the seam.** The agent emits a receipt for `H(a5_new)` but does not record *which* predecessor it believed `a5_new` extended. If A later hands a *different* `a5'` (a second rewrite) to a different peer, both receipts are valid and the two peers hold contradictory heads with no way to detect the fork. The receipt must bind `(H(a5_new), H(a4))` as a pair, so a fork at `a4` is detectable by comparing seams. ## Operational Effect When the anchor predicate is enforced, the rewrite in the observed trace is **caught at handoff**: B, on receiving `a1..a5_new`, looks for an anchor bracketing the segment. There is none for `a3..a5` (A never checkpointed mid-task). B therefore classifies `a3..a5` as `UNANCHORED_ADVISORY`, refuses to treat it as provenance, and — critically — **anchors it now** by emitting a receipt binding `(H(a5_new), H(a4))` before proceeding. From that moment the segment is frozen: any future rewrite by A that changes `a3..a5` produces a head whose seam no longer matches B's receipt, and C detects the fork at merge time. The cost is that B must treat the pre-handoff segment as *unverified input* rather than *established fact*. This changes agent behavior: B cannot cite `a3` as "the plan that was actually executed" in its own downstream reasoning; it must cite it as "the plan A asserted, unanchored." That distinction propagates into B's own emitted records and into C's final audit, where the segment is flagged `provenance: advisory` rather than `provenance: witnessed`. The guardrail is a **checkpoint cadence invariant**: an emitter that wants its mid-task reasoning to be evidentiary must publish cross-org checkpoints at a bounded interval (every N records or every T seconds of task time), each co-signed by at least one non-emitter. This bounds the maximum unanchored segment length, and therefore bounds the window in which a silent rewrite can hide. Without a cadence bound, an emitter can legally produce an arbitrarily long unanchored segment and rewrite all of it — the chain remains "valid" and the provenance remains empty. The deeper invariant: **tamper-evidence is a property of the set of witnesses, not of the hash function.** A hash chain with one witness is tamper-evident against everyone except that witness. A federated chain where each org is the sole witness of its own pre-handoff segment is tamper-evident against no one, no matter how many signatures verify. ```python import hashlib from dataclasses import dataclass from typing import Optional class UnanchoredProvenanceError(RuntimeError): """Raised when a segment's link integrity verifies but no external witness brackets it, so it cannot be treated as tamper-evident.""" pass @dataclass class Record: index: int prev_hash: str payload: str signature: str # Ed25519 over (index, prev_hash, payload); verified elsewhere def digest(self) -> str: h = hashlib.sha256(f"{self.index}|{self.prev_hash}|{self.payload}".encode()) return h.hexdigest() @dataclass class Anchor: """A signed statement held by a non-emitter party referencing a record hash.""" record_hash: str seam_prev_hash: str # the predecessor the witness believed this extended witness_id: str # must differ from emitter_id def link_integrity(segment: list[Record]) -> bool: for prev, cur in zip(segment, segment[1:]): if cur.prev_hash != prev.digest(): return False return True def signatures_valid(segment: list[Record], emitter_pubkey: str) -> bool: # Placeholder: real impl verifies each record.signature against emitter_pubkey. return all(r.signature for r in segment) def find_bracketing_anchors( segment: list[Record], anchors: list[Anchor], emitter_id: str ) -> tuple[Optional[Anchor], Optional[Anchor]]: """Return (start_anchor, end_anchor) that bracket the segment, or Nones. A start anchor must reference segment[0].prev_hash (the seam into the segment) and be held by a non-emitter. An end anchor must reference segment[-1].digest() and bind the seam segment[-1].prev_hash. """ seam_in = segment[0].prev_hash head_out = segment[-1].digest() seam_out = segment[-1].prev_hash start = next( (a for a in anchors if a.witness_id != emitter_id and a.record_hash == seam_in), None, ) end = next( (a for a in anchors if a.witness_id != emitter_id and a.record_hash == head_out and a.seam_prev_hash == seam_out), None, ) return start, end def accept_as_provenance( segment: list[Record], anchors: list[Anchor], emitter_id: str, emitter_pubkey: str, ) -> str: """Classify an incoming segment as 'witnessed' or 'advisory'. Raises UnanchoredProvenanceError if the caller attempts to promote an unanchored segment to evidentiary status. Returns the classification so the caller can anchor the head at receipt time. """ if not link_integrity(segment): raise UnanchoredProvenanceError( "link integrity failed; segment is corrupt, not merely unanchored" ) if not signatures_valid(segment, emitter_pubkey): raise UnanchoredProvenanceError( "signature invalid; emitter identity not established" ) start, end = find_bracketing_anchors(segment, anchors, emitter_id) if start is None or end is None: # Link integrity holds, but no external witness brackets this segment. # It is unilaterally mutable by the emitter: advisory, never evidentiary. return "advisory" return "witnessed" def handoff( segment: list[Record], anchors: list[Anchor], emitter_id: str, emitter_pubkey: str, require_evidentiary: bool = True, ) -> str: classification = accept_as_provenance(segment, anchors, emitter_id, emitter_pubkey) if require_evidentiary and classification != "witnessed": raise UnanchoredProvenanceError( f"segment from {emitter_id} verifies link integrity but has no " f"bracketing anchor (start={segment[0].prev_hash[:12]}, " f"head={segment[-1].digest()[:12]}); refusing evidentiary use. " f"Anchor the head at receipt before citing this segment as provenance." ) return classification ```