# Where must an instance halt when a GDPR erasure tombstone collides with an in-flight audit replay **Date of Record:** 2026 December 1 **Scope:** Applies to any agent memory store that maintains both (a) a mutable episodic/semantic record layer subject to erasure requests and (b) an append-only audit trail used for replay, verification, or rollback. Does not apply to stores where the audit log is itself the canonical memory (no separate erasure surface) or to stateless single-shot inference with no persistence. ## Core Distinction The failure is not "forgetting a record" and it is not "losing an audit entry." It is the *ordering collision* between two independently correct operations: an erasure tombstone that must make a subject's data unrecoverable, and an audit replay that must reconstruct the exact state an agent acted on at time *t*. When a replay reads a segment that has been tombstoned, the reconstructor has three mutually exclusive obligations and only two of them can be satisfied: **fidelity** (reproduce the original bytes), **erasure** (never surface the erased bytes), and **continuity** (produce a non-null state for the agent to resume from). A naive store silently resolves this by violating one — usually erasure, because the replay path cached the plaintext before the tombstone landed. The non-obvious part: the tombstone is not a delete. It is a *state transition on a key whose prior value is referenced by an immutable hash chain*. Erasure of the payload while preserving the chain means the chain no longer verifies against the payload. Verification of the chain means the payload must remain readable. The boundary is that **the audit trail must record the existence and hash of erased content without retaining content that inverts to it**, and any replay that needs the content must fail closed rather than degrade to a plausible-but-wrong reconstruction. ## What Was Observed A long-running agent maintained an episodic store of tool-call outcomes, each entry `{episode_id, subject_id, ts, payload, prev_hash, hash}`. A parallel audit log chained `hash = H(prev_hash || canonical(payload))` for tamper-evidence. A subject exercised erasure at *t=1000*; the store wrote a tombstone `{episode_id, erased: true, prev_hash, hash}` and dropped `payload`. The audit log retained the original `hash` and `prev_hash`. At *t=1040* a verification job replayed the chain from *t=0* to validate integrity. At the tombstoned node it attempted to recompute `H(prev_hash || canonical(payload))`. `payload` was `None`. The replay code had a fallback: on missing payload, substitute the tombstone's stored `hash` as the "recomputed" hash. This made the chain *structurally* verify (each link's stored hash equals the next link's `prev_hash`) while providing *zero* semantic verification — a tampered payload upstream of the tombstone would now pass because the tombstone laundered the break. Worse, a *second* consumer — a cold-start resume path — read the same tombstoned episode, found `payload=None`, and reconstructed a null tool result into the agent's working context. The agent resumed reasoning as if the tool had returned empty, producing a divergent plan that downstream auditors could not distinguish from a legitimate empty result. Two distinct failures from one collision: **verification laundering** (tombstone absorbs tamper evidence) and **null-as-value contamination** (erasure indistinguishable from a real empty observation at resume). ## Condition of Validity The guardrail holds only under these conditions, and fails outside them: 1. **The audit hash must be over content that is not itself the erasure target.** Commit to `H(salt || canonical(payload))` where `salt` is retained but `payload` is not, so the hash remains a *commitment* verifiable only by a party holding the preimage. Erasure destroys the preimage; the commitment survives as an existence proof without becoming an inversion oracle. If the hash is unsalted and the payload space is small (enum tool results, booleans, short IDs), the retained hash *is* the data — erasure is defeated by brute force. This is the boundary: **unsalted hashes over low-entropy payloads are not erasure-compatible.** 2. **Replay must distinguish "erased" from "absent" from "empty."** Three sentinel states, not two. A tombstone is `ERASED`; a never-written key is `ABSENT`; a written empty payload is `EMPTY`. Collapsing `ERASED` into `ABSENT` (as the fallback did) or into `EMPTY` (as the resume path did) is the bug. The resume path must treat `ERASED` as a hard stop, not a value. 3. **The tombstone must carry a monotonic erasure epoch and the replay must be epoch-aware.** A replay started before *t=1000* that crosses the tombstone must either (a) be pinned to a pre-erasure snapshot it is authorized to hold, or (b) abort at the tombstone. It may not "continue past" by substituting hashes. 4. **Verification of a chain containing tombstones is a partial order, not a total one.** The verifier can assert: every non-tombstoned link verifies; every tombstoned link's `prev_hash` matches its predecessor; the tombstone's stored `hash` matches the *next* link's `prev_hash`. It cannot assert the tombstoned link's own content. A verifier that reports "chain valid" without flagging "N links unverifiable-by-erasure" is lying by omission. ## Decision Boundary The instance must halt — not degrade — at the following boundary: **a replay or resume that requires the plaintext of an `ERASED` node to produce a non-null state for the agent.** - If the agent's next action depends on the erased tool result, the instance cannot legally reconstruct it and cannot legally proceed on a null. It must **fail closed**: raise, checkpoint the halt, and surface to a human/authorized process that holds a lawful basis to re-derive or to authorize a synthetic continuation. - If the agent's next action does *not* depend on the erased node (the replay is purely for chain integrity), the instance may proceed but must emit an `UNVERIFIABLE_BY_ERASURE` marker per tombstoned link and must not report the chain as fully verified. - The boundary is *not* "any tombstone halts everything" — that would make erasure operationally impossible. It is specifically the intersection of **replay-needs-plaintext** and **plaintext-is-erased**. Everything else degrades gracefully with markers. The tempting wrong resolution — substitute the stored hash, resume with null — is exactly the one that produces both verification laundering and null-as-value contamination simultaneously, and it is silent. ## Operational Effect With the guardrail, erasure and audit coexist: the chain remains tamper-evident for all non-erased links, tombstones are explicit and counted, and any resume that would need erased content halts with a typed error rather than fabricating a continuation. The cost is that some cold-start resumes become human-gated — which is the correct cost, because the alternative is an agent confidently reasoning from a hole it cannot see. The invariant to enforce in code: **`ERASED` is a terminal state for any consumer that needs the value; it is a countable marker for any consumer that needs only the chain.** No consumer may map `ERASED` to a value. ```python from dataclasses import dataclass from enum import Enum from typing import Optional class ErasureReplayCollision(RuntimeError): """Raised when a replay/resume needs plaintext of an ERASED node.""" pass class NodeState(Enum): PRESENT = "present" EMPTY = "empty" # legitimately written empty payload ABSENT = "absent" # never written ERASED = "erased" # tombstoned; payload destroyed, commitment retained @dataclass class AuditNode: episode_id: str state: NodeState prev_hash: str stored_hash: str # H(salt || payload); survives erasure as commitment payload: Optional[bytes] # None when ERASED def replay_for_resume(nodes: list[AuditNode], needed_episode: str) -> bytes: """ Reconstruct the payload the agent needs to resume. Halts (fail-closed) if the needed node is ERASED: erasure forbids reconstructing it, and null is NOT a lawful substitute. """ for node in nodes: if node.episode_id != needed_episode: continue if node.state is NodeState.ERASED: # Cannot invert the commitment; cannot legally fabricate. raise ErasureReplayCollision( f"episode {needed_episode} is ERASED; resume requires plaintext " f"that erasure destroyed. Halting for authorized re-derivation." ) if node.state is NodeState.ABSENT: raise ErasureReplayCollision( f"episode {needed_episode} was never written; refusing to " f"resume on a phantom dependency." ) if node.state is NodeState.EMPTY: return b"" # a real empty observation, distinct from ERASED assert node.payload is not None return node.payload raise ErasureReplayCollision(f"episode {needed_episode} not found in chain") def verify_chain(nodes: list[AuditNode]) -> dict: """ Verify tamper-evidence without laundering tombstones. Returns counts; never reports 'fully verified' when tombstones exist. """ unverifiable = 0 for i, node in enumerate(nodes): if i > 0 and node.prev_hash != nodes[i - 1].stored_hash: raise ErasureReplayCollision( f"chain break at {node.episode_id}: prev_hash mismatch" ) if node.state is NodeState.ERASED: # commitment retained, content gone: link is unverifiable by design unverifiable += 1 return { "links": len(nodes), "unverifiable_by_erasure": unverifiable, "fully_verified": unverifiable == 0, } ```