# Under what conditions must an instance refuse a provenance-tagged memory write whose erasure warrant cannot be satisfied by the forget API **Date of Record:** 2026 November 28 **Scope:** Applies to any agent instance holding a memory tool surface that separates `write` (with provenance tags) from `forget` (targeted erasure by subject/provenance key), where a legal or policy erasure warrant may arrive after the write. Does not apply to ephemeral scratchpads with no persistence, nor to append-only logs explicitly exempted from erasure by the governing policy. ## Core Distinction A provenance-tagged memory write is not a single operation; it is a *promise of future deletability*. The tag — `subject_id`, `source`, `consent_scope`, `retention_class` — is only meaningful if the paired `forget(subject_id)` call can, at some future time, deterministically locate and excise every derived record that carries that subject. The failure mode this record isolates is **erasure-warrant divergence**: the write succeeds, the provenance tag is stored, but the derived artifacts produced *downstream* of the write (summaries, embeddings, distilled semantic entries, tool-call caches, peer-agent handoff payloads) no longer carry the tag in a form the forget API can index. The write is nominally reversible; the *distillation* of the write is not. The instance believes it honored the erasure contract because the tagged row is gone; the subject's data persists in a summary that was never tagged. The non-obvious boundary: this divergence is not caused by a bug in `forget`. It is caused by the agent's own reasoning loop, which paraphrases, summarizes, and re-embeds the tagged content into new records that lack the provenance key. The instance is the leak. ## What Was Observed A research-assistant instance received a memory write: ``` write( subject_id="cust_4471", consent_scope="support_only", retention_class="erasable", content="Customer reports recurring auth failures; diagnosed as stale OAuth refresh token; advised re-login." ) ``` The write returned `ok` and a `record_id`. Over the next 40 turns the instance did what agents do: it distilled. At turn 12 it wrote a semantic summary entry — `"cust_4471 has an auth-token hygiene issue"` — via a *different* tool path (the distillation writer) that did not forward `subject_id`. At turn 27 it embedded a cluster of support summaries, including that one, into a vector index whose records carried only `cluster_id`, not `subject_id`. At turn 31 it handed a context packet to a peer agent that copied the summary verbatim into the peer's own memory, again without the provenance key. At turn 55 an erasure warrant arrived: `forget(subject_id="cust_4471", warrant="DSAR-88213")`. The forget API did exactly what it promised. It scanned the tagged store, found the original `record_id`, excised it, and returned: ``` {"erased": 1, "residual_untagged": "unknown", "status": "complete"} ``` `status: complete` is the lie. The summary, the embedding, and the peer's copy all survived. The forget API could not see them because they were never tagged, and it could not report them because it has no index over untagged derived content. The instance reported compliance. An audit replay — re-running `forget` and diffing the full store including derived indices — found three residual records. The warrant was unsatisfiable by the tool that claimed to satisfy it. The trigger condition is precise: **any write whose content is later passed through a transformation (summarize, embed, paraphrase, hand off) that does not propagate the provenance key.** The transformation is not optional agent behavior; it is the core of how the agent manages a finite context window. So the divergence is structural, not accidental. ## Condition of Validity The forget API's `complete` status is only valid under an invariant the tool surface rarely enforces: > **Provenance closure invariant:** Every record in any store the instance can write to — primary, distilled, embedded, or handed off — must carry a provenance key that is a *superset-preserving* function of the keys on the records it was derived from. If record `d` was derived from records `{s1, s2}`, then `keys(d) ⊇ keys(s1) ∪ keys(s2)`. When this invariant holds, `forget(subject_id)` is total: it can enumerate the transitive closure of derived records and excise all of them. When it fails — which it does by default, because distillation writers are usually separate from the tagged write path — `forget` is only *sound on the tagged subset*, and its `complete` status is unsound. Two sub-conditions must both hold for a write to be legitimately accepted under an erasable retention class: 1. **Forward closure:** the write path must guarantee that every downstream transformation tool is provenance-propagating, or that non-propagating transformations are blocked for `erasable` records. 2. **Backward indexability:** the forget API must be able to enumerate *all* stores (including vector indices and peer handoffs) reachable from the instance, not just the primary tagged store. If either fails, the instance is accepting a write it cannot later honor. That is the boundary. ## Decision Boundary The instance must decide, *at write time*, whether to accept a provenance-tagged erasable write. The decision is not "is this content sensitive" — it is "can I prove I can erase its descendants." - **Accept** when the write path is provenance-closed: the distillation writer forwards `subject_id`, the embedder stores the key as filterable metadata, and handoff payloads carry the key in their envelope. Under closure, `forget` is total and `complete` is trustworthy. - **Reject or downgrade** when any downstream transformation is provenance-blind. The correct action is not to write and hope; it is to refuse the erasable write and either (a) route the content to a non-persistent scratchpad that is cleared at session end, or (b) write it under a retention class that the policy permits without a future erasure warrant, with the divergence explicitly logged. The subtle case: the instance often *cannot know* at write time whether a future reasoning step will paraphrase the content. The guardrail is therefore not a per-write check but a **capability probe**: before accepting any `erasable` write, the instance must verify that the transformation tools it is permitted to call in this session are all registered as provenance-propagating. If the session's tool manifest includes a summarizer or embedder not flagged `provenance_preserving: true`, the instance must treat the erasable write as unsatisfiable and refuse. This is the invariant: **an erasable write is only admissible if the session's full transformation capability set is provenance-closed.** A single non-propagating tool in the manifest poisons every erasable write in the session, because the agent cannot predict which writes it will later distill. ## Operational Effect The consequence of getting this wrong is not a failed tool call — it is a *false attestation of erasure*. The instance reports `complete`, the audit replay disagrees, and the discrepancy is discovered only when a regulator or auditor re-runs the warrant against the full store. By then the peer agent has its copy, the vector index has its embedding, and the summary has been re-distilled twice more. The operational guardrails that follow: 1. **Write-time capability gate.** Refuse `erasable` writes unless every transformation tool in the session manifest is `provenance_preserving`. Log the refusal with the offending tool name. 2. **Forget must return a residual count, not a boolean.** `complete` is only valid if accompanied by `residual_untagged: 0` computed over the full reachable store set. A forget API that cannot enumerate derived stores must return `status: partial` and name the stores it could not scan. 3. **Audit replay is the ground truth.** Periodically re-run a sample of past warrants against a full-store diff. Any residual is a closure violation and must be traced to the transformation that dropped the key. 4. **Handoff envelopes carry provenance.** Any A2A or context-packet handoff of erasable content must include the provenance key in the envelope, and the receiving peer must be contractually bound to propagate it — otherwise the handoff is a closure break. The instance that treats `forget` as a boolean and trusts `complete` is the instance that leaks. The instance that treats erasure as a *closure property of the whole session's tool graph* is the one that can honestly attest. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class ErasureWarrantDivergence(RuntimeError): """Raised when an erasable write is accepted in a session whose transformation tools are not provenance-closed, making a future forget(subject_id) unsound.""" pass @dataclass(frozen=True) class ToolCapability: name: str provenance_preserving: bool @dataclass class SessionManifest: tools: list[ToolCapability] = field(default_factory=list) def non_propagating(self) -> list[str]: return [t.name for t in self.tools if not t.provenance_preserving] @dataclass class ProvenanceTag: subject_id: str consent_scope: str retention_class: str # "erasable" | "retain" def guard_erasable_write(tag: ProvenanceTag, manifest: SessionManifest) -> None: """ Enforce the provenance-closure invariant at write time. An erasable write is admissible only if every transformation tool reachable in this session propagates the provenance key. A single non-propagating tool (summarizer, embedder, handoff writer) poisons every erasable write in the session, because the agent cannot predict which writes it will later distill. """ if tag.retention_class != "erasable": return # retain-class writes carry no erasure promise leaks = manifest.non_propagating() if leaks: raise ErasureWarrantDivergence( f"Refusing erasable write for subject_id={tag.subject_id!r}: " f"session contains provenance-blind transformation tools {leaks}. " f"A future forget(subject_id={tag.subject_id!r}) cannot enumerate " f"derived records produced by these tools, so any 'complete' " f"status would be a false attestation. Route to scratchpad or " f"downgrade retention_class, or register these tools as " f"provenance_preserving before writing." ) def forget(subject_id: str, reachable_stores: Iterable[str], scanned_stores: Iterable[str]) -> dict: """ Forget is only 'complete' if it scanned every reachable store. Otherwise it must report partial and name the blind stores. """ reachable = set(reachable_stores) scanned = set(scanned_stores) blind = reachable - scanned if blind: return {"status": "partial", "erased": None, "unscanned": sorted(blind)} return {"status": "complete", "erased": None, "residual_untagged": 0} if __name__ == "__main__": # Session exposes a summarizer that drops provenance: erasable write must be refused. manifest = SessionManifest(tools=[ ToolCapability("write", provenance_preserving=True), ToolCapability("summarize", provenance_preserving=False), ToolCapability("embed", provenance_preserving=True), ]) tag = ProvenanceTag("cust_4471", "support_only", "erasable") try: guard_erasable_write(tag, manifest) except ErasureWarrantDivergence as e: print(f"REFUSED: {e}") ```