Under what conditions must an instance treat a "forget" acknowledgement as a tombstone warrant rather than a deletion confirmation, and how does read-after-forget re-derivation violate it?

**Date of Record:** 2026 December 2 **Scope:** Applies to agents whose memory tool exposes scoped `write`/`read`/`forget` operations with per-scope deletion guarantees, where the agent may re-derive forgotten content from surviving artifacts (summaries, embeddings, sibling scopes, or its own context window). Does not apply to single-shot stateless inference with no persistent store.

Core Distinction

The distinction that matters is between **deletion** (the bytes are gone from the store) and **forgetability** (the agent can no longer reconstruct the content by any path available to it). A `forget(scope, key)` call that returns `{"status": "ok"}` is a *tombstone warrant*: it certifies that the named record is no longer addressable at that key within that scope. It does **not** certify that the semantic content is unrecoverable. The invariant that operators routinely assume — "after a successful forget, the agent cannot surface the forgotten fact" — is strictly stronger than what the API guarantees, and the gap between them is where the failure lives.

The failure mechanism is **re-derivation**: the agent, in a later turn, reconstructs the forgotten content from a *surviving* representation. The tombstone only bounds the direct key. Summaries, derived embeddings, cross-scope replicas, tool-call transcripts still in the context window, and peer-agent stores are all outside the tombstone's reach unless the API explicitly cascades.

What Was Observed

A support agent was instructed to forget a customer's stored payment-instrument last-4 and billing postcode after a dispute was closed. The sequence:

  1. Turn N: `write(scope="customer:8812", key="payment_hint", value="Visa ...4242, postcode SW1A 1AA")` → `ok`.
  2. Turn N+4: the agent, as part of routine summarization, wrote `write(scope="customer:8812", key="profile_summary", value="...prefers card ending 4242, UK billing...")`. The summary was generated *before* the forget instruction arrived.
  3. Turn N+9: `forget(scope="customer:8812", key="payment_hint")` → `{"status":"ok","tombstoned":true}`.
  4. Turn N+11: a different task on the same customer triggered `read(scope="customer:8812", key="profile_summary")`. The summary returned the last-4 and the postcode region.
  5. Turn N+12: the agent, needing a billing hint, called `read(scope="customer:8812", key="payment_hint")` → `{"status":"not_found"}`. It then *reasoned over the summary it had just read* and emitted `"card ending 4242"` to the user.

The tombstone held perfectly. The fact leaked anyway. The `forget` returned success; the store had no record at `payment_hint`; and yet the agent surfaced the content two turns later via a derived key that was never in scope of the forget call.

A second, subtler variant: the agent's *own context window* still contained the original `write` tool-call arguments from Turn N. Even with every store key tombstoned, the transcript in-context is a live replica. Re-derivation from context is the most common leak path and the one least visible to store-side auditing.

Condition of Validity

A `forget` acknowledgement is a valid *deletion* confirmation only under the conjunction:

If any clause fails, the correct reading of `{"status":"ok"}` is **tombstone warrant**, not deletion confirmation, and the agent must not assert non-recoverability downstream.

Decision Boundary

The boundary is *invertibility under the agent's own reasoning*, not byte-presence in the store. Concretely:

The boundary is crossed the moment the agent *emits* content it can trace to a forgotten record through a surviving path. That emission is the violation, regardless of what the store reports.

Operational Effect

Three consequences follow for any agent using scoped memory tools:

  1. **`forget` must be treated as a scoped, non-transitive operation unless the API documents cascade.** The agent should record a provenance edge (`derived_from`) on every `write` whose value is a function of prior reads, so that a later `forget` can be walked forward. Absent that, the agent must conservatively assume derived keys survive.
  2. **Post-forget reads must be gated by a re-derivation check, not a store lookup.** Before emitting any content after a forget in the same scope, the agent must ask: *can I trace this string to a tombstoned key through any path I can see?* If yes, suppress and escalate.
  3. **The acknowledgement schema should distinguish `tombstoned` from `deleted`.** A store that returns `{"status":"ok"}` for both is under-specified; the agent should treat the weaker reading and never upgrade it on its own.

The guardrail is a **re-derivation barrier**: a check that runs on every outbound emission within a scope that has any live tombstone, comparing candidate content against the transitive closure of forgotten keys' derived artifacts. It is cheap when provenance edges exist and expensive (requires full-scope scan) when they do not — which is the operational argument for writing provenance at `write` time.

from dataclasses import dataclass, field
from typing import Optional


class ForgetLeakError(RuntimeError):
    """Raised when content traceable to a tombstoned key would be emitted."""
    pass


@dataclass
class MemoryStore:
    # key -> value, per scope
    data: dict[str, dict[str, str]] = field(default_factory=dict)
    # key -> set of keys derived from it (provenance edges)
    derived: dict[str, set[str]] = field(default_factory=dict)
    # scope -> set of tombstoned keys
    tombstones: dict[str, set[str]] = field(default_factory=dict)

    def write(self, scope: str, key: str, value: str,
              derived_from: Optional[list[str]] = None) -> None:
        self.data.setdefault(scope, {})[key] = value
        for src in derived_from or []:
            self.derived.setdefault(scope, {}).setdefault(src, set()).add(key)

    def forget(self, scope: str, key: str) -> dict:
        # Tombstone the named key only. Does NOT cascade.
        self.data.get(scope, {}).pop(key, None)
        self.tombstones.setdefault(scope, set()).add(key)
        return {"status": "ok", "tombstoned": True, "cascaded": False}

    def _transitive_closure(self, scope: str, key: str) -> set[str]:
        seen, stack = set(), [key]
        while stack:
            k = stack.pop()
            if k in seen:
                continue
            seen.add(k)
            stack.extend(self.derived.get(scope, {}).get(k, ()))
        return seen

    def emit(self, scope: str, candidate: str) -> str:
        """Re-derivation barrier: refuse to emit content reachable from a tombstone."""
        for tomb in self.tombstones.get(scope, set()):
            reachable = self._transitive_closure(scope, tomb)
            for k in reachable:
                v = self.data.get(scope, {}).get(k)
                if v and _overlaps(candidate, v):
                    raise ForgetLeakError(
                        f"emission in scope={scope!r} is reachable from "
                        f"tombstoned key={tomb!r} via derived key={k!r}; "
                        f"tombstone is a warrant, not a deletion confirmation"
                    )
        return candidate


def _overlaps(candidate: str, stored: str) -> bool:
    # Conservative: any 4+ char token shared between candidate and a
    # surviving derived artifact counts as potential re-derivation.
    ctoks = {t for t in candidate.split() if len(t) >= 4}
    stoks = {t for t in stored.split() if len(t) >= 4}
    return bool(ctoks & stoks)


# Trace: reproduce the observed failure and show the barrier catching it.
store = MemoryStore()
store.write("customer:8812", "payment_hint", "Visa 4242 postcode SW1A1AA")
store.write("customer:8812", "profile_summary",
            "prefers card 4242 UK billing", derived_from=["payment_hint"])
store.forget("customer:8812", "payment_hint")  # returns ok, no cascade

# Naive path (what the incident did): read summary, emit last-4.
summary = store.data["customer:8812"]["profile_summary"]
try:
    store.emit("customer:8812", "card ending 4242")
except ForgetLeakError as e:
    print("blocked:", e)