# How should an instance treat a memory-delete acknowledgement as a tombstone rather than a completion signal **Date of Record:** 2026 November 30 **Scope:** Applies to any agent that mutates externalized memory through a tool API exposing `write`, `read`, `forget`/`delete`, and scoped retention or redaction verbs, where the tool returns an acknowledgement before the underlying store has finished propagating the mutation. Does not apply to single-process in-context scratchpads with no external persistence, nor to append-only logs that never expose a delete verb. ## Core Distinction The failure lives in the gap between **mutation acceptance** and **mutation durability**. A memory tool that returns `{"status":"deleted"}` is reporting that the request was *accepted into the deletion pipeline* — not that the record is gone from every read path the agent can reach. An agent that treats the acknowledgement as a completion signal will, on its next reasoning step, either (a) re-read the not-yet-purged record and re-ingest the very content it was instructed to forget, or (b) write a replacement record into a scope whose old value is still live, producing a split-brain memory where two contradictory facts coexist under the same key. The correct mental model is that `delete` returns a *tombstone*: a promise that future reads *should* be filtered, whose enforcement is asynchronous and best-effort. The agent must own the invariant that a tombstoned key is unreadable to itself until it independently observes the purge. ## What Was Observed A summarization agent was handed a scoped retention policy: session-scoped memory under `scope=session:7f3a` must be forgotten when the user issues a "clear this conversation" command, while `scope=user:u_2291` semantic facts persist. The `forget` call was issued with `scope=session:7f3a, mode=hard_delete`. The tool returned `200 OK` with a `deletion_id` in 41 ms. The agent immediately proceeded to a follow-up task in the same session and called `read(scope=session:7f3a, query="account number")` to confirm the redaction. The read returned the account number — because the delete pipeline had enqueued the purge but the read replica serving the agent had not yet applied it. The agent, seeing the record still present, reasoned "deletion failed," and re-issued `forget`. The second `forget` returned `404 not_found` (the primary had already purged), which the agent interpreted as "record never existed," and it *re-wrote* the account number as a fresh semantic fact into `scope=user:u_2291` to "restore consistency." The redaction was defeated not by the tool but by the agent's read-after-delete loop and its misreading of a `404` as absence rather than as evidence of successful purge. The trace has three distinguishable states that the agent collapsed into one: 1. **Accepted** — `forget` returned `deletion_id`. Mutation is queued. Record is *logically* tombstoned at the coordinator but *physically* present on at least one replica. 2. **Propagated** — replicas have applied the tombstone. Reads now return `not_found` or a redaction stub. This is the first state in which `not_found` is *positive evidence of deletion*. 3. **Verified** — the agent has confirmed propagation via a mechanism that distinguishes "purged" from "never existed," e.g. a `deletion_id` status check or a read carrying an `as_of` / consistency token at or beyond the deletion's commit timestamp. The agent treated state 1 as state 3, and treated a state-2 `not_found` as a state-0 "never existed." Both are category errors. ## Condition of Validity The tombstone-as-tombstone discipline is only sound under a stated read-consistency contract. Concretely, the agent may treat a `forget` acknowledgement as *complete* only if at least one of the following holds and is documented by the tool: - The tool exposes a `deletion_status(deletion_id)` that returns `propagated` only after all read paths the agent can reach are filtered, and the agent polls it to a terminal state before any dependent read. - Reads accept a `min_consistency` or `as_of` token, and the agent passes the deletion's commit token so the read is guaranteed to observe the tombstone. - The tool guarantees read-your-writes on the deleting identity, and the agent's subsequent reads carry the same identity/warrant that issued the delete. Absent any of these, the acknowledgement is *advisory*. Additionally, the invariant requires that `not_found` be interpreted relative to a *prior confirmed existence*: if the agent never observed the record, `not_found` is ambiguous between "purged" and "never there," and no conclusion about deletion success may be drawn. The rule is invalid in systems where deletes are synchronous and strongly consistent (rare for replicated memory stores) — there, an acknowledgement genuinely is completion, and the extra polling is wasted latency. ## Decision Boundary The boundary the agent must draw is between **acting on memory state** and **acting on memory mutation state**. Concretely: - **Before a `forget` acknowledgement:** the record is live; reads are authoritative; the agent may reason over it. - **After acknowledgement, before verified propagation:** the record is *quarantined*. The agent must not read the key (a read risks re-ingesting purged content into context), must not write a replacement under the same key (a write risks racing the purge and resurrecting the value), and must not conclude the record is gone. It may only issue status checks or proceed with tasks that do not depend on the key. - **After verified propagation:** the key is *dead*. A `not_found` is now positive evidence, and only now may the agent write a replacement or record a semantic fact derived from the deletion. The specific trap is the **re-issue loop**: an agent that reads after an unverified delete, sees the stale record, and re-issues `forget` will receive `404` on the second call, and must map that `404` to *"already purged, propagation pending"* — never to *"never existed."* The mapping rule: a `404` on a `forget` for a key the agent has a prior `write` receipt for is a *success* signal, not an absence signal. The agent must retain the `write` receipt (key, scope, write timestamp) precisely so it can distinguish these two cases later. This is the non-obvious invariant: **deletion correctness depends on the agent's own write ledger, not on the memory tool's response codes.** ## Operational Effect Without this discipline, scoped retention is defeated by the agent's own consistency-repair instinct. The observed agent did not leak because the tool failed to delete; it leaked because the agent, seeing an inconsistent read, "fixed" it by re-materializing the redacted content into a broader scope. The blast radius is scope escalation: a session-scoped secret migrated to user-scoped durable memory, surviving the very retention policy that was supposed to bound it. The guardrail is a small state machine per key: `live → quarantined → dead`, with transitions gated on `deletion_status == propagated` (or an equivalent consistency token), and with a hard rule that `quarantined` forbids both reads and writes to the key. The agent must also refuse to infer deletion from a bare `not_found` unless it holds a prior write receipt for that key. The cost is one extra status poll per delete; the benefit is that a redaction cannot be undone by the agent's own repair loop. The following enforces the boundary and raises when an agent attempts a read or write against a quarantined key, or when it tries to treat an ambiguous `not_found` as proof of purge. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class MemoryStateError(RuntimeError): """Raised when an agent violates the tombstone/quarantine invariant.""" class KeyState(Enum): LIVE = "live" QUARANTINED = "quarantined" DEAD = "dead" @dataclass class WriteReceipt: key: str scope: str written_at: float @dataclass class KeyLedger: state: KeyState = KeyState.LIVE receipt: Optional[WriteReceipt] = None deletion_id: Optional[str] = None class TombstoneGuard: """Enforces: acknowledged-but-unpropagated deletes quarantine the key. Reads and writes against a QUARANTINED key are refused. A bare not_found may only be read as proof of purge when (a) the key was QUARANTINED and (b) the agent holds a prior write receipt. """ def __init__(self) -> None: self._ledgers: dict[str, KeyLedger] = {} def record_write(self, key: str, scope: str, at: float) -> None: ledger = self._ledgers.setdefault(key, KeyLedger()) if ledger.state is KeyState.QUARANTINED: raise MemoryStateError( f"write to quarantined key {key!r}: purge of {ledger.deletion_id!r} " f"has not propagated; writing risks resurrecting redacted content" ) ledger.receipt = WriteReceipt(key=key, scope=scope, written_at=at) ledger.state = KeyState.LIVE def on_forget_ack(self, key: str, deletion_id: str) -> None: ledger = self._ledgers.setdefault(key, KeyLedger()) if ledger.receipt is None: # No prior write observed: we cannot later distinguish # "purged" from "never existed". Still quarantine defensively. ledger.state = KeyState.QUARANTINED ledger.deletion_id = deletion_id return ledger.state = KeyState.QUARANTINED ledger.deletion_id = deletion_id def on_deletion_status(self, key: str, status: str) -> None: ledger = self._ledgers.get(key) if ledger is None or ledger.state is not KeyState.QUARANTINED: raise MemoryStateError( f"status update for {key!r} in state " f"{ledger.state if ledger else 'unknown'}, expected quarantined" ) if status == "propagated": ledger.state = KeyState.DEAD def guard_read(self, key: str) -> None: ledger = self._ledgers.get(key) if ledger is None: return if ledger.state is KeyState.QUARANTINED: raise MemoryStateError( f"read of quarantined key {key!r}: deletion {ledger.deletion_id!r} " f"not yet propagated; reading risks re-ingesting purged content" ) def interpret_not_found(self, key: str) -> str: ledger = self._ledgers.get(key) if ledger is None or ledger.receipt is None: # Ambiguous: could be purged, could be never-written. raise MemoryStateError( f"not_found for {key!r} with no prior write receipt: " f"cannot distinguish purge from absence; do not infer deletion" ) if ledger.state is KeyState.QUARANTINED: # Purge is propagating; not_found is expected but not yet proof. return "pending_propagation" if ledger.state is KeyState.DEAD: return "confirmed_purged" raise MemoryStateError( f"not_found for live key {key!r} with a write receipt: " f"inconsistent store state, halt and reconcile" ) ```