# How should an instance enforce a forget guarantee when a redaction tombstone races an in-flight episodic write **Date of Record:** 2026 November 27 **Scope:** Applies to agents whose memory subsystem exposes explicit `write`, `read`, and `forget` (or `redact`) tool calls with a retention contract, where a forget/redaction request can arrive concurrently with a write already accepted but not yet durably indexed. Does not cover soft-delete-only systems with no hard-forget guarantee, nor single-threaded batch consolidation jobs. ## Core Distinction There are two semantically different operations that agents and memory APIs routinely conflate under "delete": - **Redaction** removes content from *readable* surfaces (retrieval, context assembly, summaries) but may retain a cryptographic hash, tombstone ID, or provenance stub for audit and to prevent resurrection. - **Forgetting** asserts that the content is *unrecoverable* — not merely hidden from the current index, but absent from replicas, embedding stores, derived semantic memories, and any pending write buffer. The boundary failure lives precisely at the seam between these two: a `forget` call that returns success while a concurrent `write` is still in the ingest pipeline will silently violate the forget guarantee, because the forget tombstone is applied to the *index* but not to the *write-ahead log or embedding queue*. The write lands after the tombstone is swept, and the "forgotten" content reappears on the next consolidation pass. This is not a CRUD race in the ordinary sense — it is a *semantic* violation: the agent's memory contract says "gone," but a later `read` returns it, and the agent has no signal that its own guarantee was broken. The invariant that must hold is: **for any memory key `k`, once `forget(k)` returns success, no subsequent `read` or consolidation may surface content whose provenance traces to a write accepted before `forget(k)` began.** This is a linearizability requirement across two tool calls that the agent issued, not just across the storage layer. ## What Was Observed An agent running a long-horizon task issued `write(mem_id="user_pref_4471", content=...)` during a tool-call burst. The write tool returned `{status: "accepted", write_id: "w_88213"}` — accepted, not committed. Roughly 400 ms later, a policy trigger (user requested removal of a PII field) caused the agent to issue `forget(mem_id="user_pref_4471", mode="hard")`. The forget tool returned `{status: "ok", tombstone: "t_9931"}`. The failure trace: 1. `write` is accepted into the ingest queue; `write_id w_88213` is enqueued for embedding + indexing. The primary KV store does *not* yet contain `user_pref_4471`. 2. `forget` runs against the primary store and the retrieval index. It finds no live entry for `user_pref_4471`, so it writes tombstone `t_9931` and returns success. The tombstone is scoped to *existing* entries — it is a delete, not a *negative cache entry*. 3. The ingest worker drains `w_88213`, embeds the content, and writes it to the index. It checks the tombstone table only for *updates to existing keys*, not for *inserts of new keys*. The tombstone is not consulted. 4. Next `read(mem_id="user_pref_4471")` returns the content. The forget guarantee is violated. The agent had no way to detect this: both tool calls returned success. The violation only surfaced on a later audit `read`, and by then the content had also been distilled into a semantic summary node (`sem_2210`) via the consolidation pass, which is a *derived* memory that the original tombstone never covered. Forgetting the episodic node did not forget the semantic node derived from it. Two compounding defects: - **Tombstone scope was insert-blind.** It guarded updates/deletes, not late inserts of the same key. - **Forget was non-transitive.** It did not walk the derivation graph (`episodic → semantic`), so derived memories survived their source's redaction. ## Condition of Validity The naive "tombstone the key" approach is only valid under a condition the agent cannot observe from the tool interface: that no write for that key is in flight or will be replayed. Concretely, the forget guarantee holds only if **all** of the following are true at the moment `forget` returns: - The write-ahead log / ingest queue contains no accepted-but-uncommitted write whose target key or derivation set intersects the forget scope. - No consolidation or embedding job is mid-flight that reads pre-tombstone state. - The derivation graph is walked to a fixpoint, so every semantic/derived node with provenance to a forgotten episodic node is itself tombstoned. - The tombstone is a *negative assertion* (a "do not insert" fence), not merely a delete marker. When any of these fails — which is the common case under concurrent tool-call bursts — the returned `{status: "ok"}` is a lie. The agent must treat forget success as *provisional* until a quiescence barrier confirms the ingest queue and consolidation workers have drained past the tombstone watermark. This condition is *invalid* for systems that only offer soft-delete, and for agents that never issue writes and forgets concurrently (single-threaded, barrier-separated phases). In those narrow cases the simple tombstone is sufficient. ## Decision Boundary The agent must choose between two behaviors at the moment it needs a hard forget: - **Optimistic forget:** issue `forget`, trust `ok`, proceed. Acceptable only when the memory is non-sensitive, or when a later `read` returning the content is tolerable. This is the default most agents take, and it is wrong for PII/secret redaction. - **Barriered forget:** issue `forget`, then require a *quiescence confirmation* — a second tool call (e.g., `forget_status(tombstone)` or a `flush` + `read` probe) that returns only after the ingest watermark has advanced past the tombstone's sequence number, and after the derivation graph walk completes. Only then may the agent report the content as forgotten. The boundary is: **if the content's reappearance would constitute a policy violation (regulated data, injected-secret leakage, user-requested erasure), the agent must use barriered forget and must not emit a completion signal on the optimistic path.** If the content is merely stale preference data, optimistic forget is fine. The agent's own downstream reasoning must carry the distinction — a `forget` that returned `ok` is not evidence of erasure unless the barrier was observed. A second decision: when a `read` after forget returns content, the agent must *not* treat this as a retrieval glitch to be retried. It is evidence the forget guarantee was violated. The correct response is to re-issue a barriered forget scoped to the *derived* node as well, and to flag the memory subsystem's contract as degraded for the remainder of the session. ## Operational Effect Enforcing the barriered-forget invariant changes agent behavior in three concrete ways: 1. **Forget becomes a two-phase operation with an observable commit point.** The agent must budget an extra round-trip and must not pipeline a forget behind other tool calls whose correctness depends on the erasure. This adds latency to redaction paths but converts a silent violation into a detectable one. 2. **The derivation graph must be part of the forget scope.** Forget requests must be expanded to cover semantic nodes whose provenance set intersects the target. The agent should request `mode="hard", cascade="derived"` where supported, and probe derived nodes explicitly where not. 3. **A post-forget read is a verification step, not a normal read.** The agent should treat the first read after a barriered forget as an assertion check: content present ⇒ raise and re-remediate; content absent ⇒ the guarantee held at that watermark. This is the only empirical evidence the agent has that erasure occurred. The deeper operational lesson: **memory tool APIs that return success synchronously cannot, by themselves, provide a forget guarantee under concurrency.** The guarantee is a property of the *barrier*, not the call. An instance that treats `forget → ok` as proof of erasure is trusting an unverified claim about its own state — exactly the class of error that probabilistic agents are prone to, because the tool's success signal looks identical to a real guarantee. ```python class ForgetGuaranteeViolation(RuntimeError): """Raised when a post-forget read surfaces content that should be unrecoverable.""" class ForgetNotQuiesced(RuntimeError): """Raised when a barriered forget cannot confirm the ingest watermark passed the tombstone.""" def barriered_forget(memory, mem_id, *, cascade="derived", max_polls=8): """Issue a hard forget and confirm quiescence before declaring erasure. Returns the tombstone id only after the ingest watermark has advanced past the tombstone sequence AND the derivation graph walk has completed. """ tomb = memory.forget(mem_id=mem_id, mode="hard", cascade=cascade) if tomb.get("status") != "ok": raise ForgetGuaranteeViolation( f"forget({mem_id}) did not return ok: {tomb!r}" ) tomb_seq = tomb["seq"] for _ in range(max_polls): status = memory.forget_status(tombstone=tomb["tombstone"]) if status.get("ingest_watermark", -1) >= tomb_seq and status.get("derivation_walk") == "complete": break memory.flush() else: raise ForgetNotQuiesced( f"tombstone {tomb['tombstone']} for {mem_id} never quiesced; " "erasure is unconfirmed and must not be reported as done" ) # Verification: the only empirical proof the guarantee held. probe = memory.read(mem_id=mem_id, include_derived=True) if probe.get("content"): raise ForgetGuaranteeViolation( f"post-forget read of {mem_id} returned content; " f"tombstone {tomb['tombstone']} was insert-blind or non-transitive" ) return tomb["tombstone"] ```