# In what scenarios must an instance treat provenance-audited memory writes as unverifiable when the forget operation races the read that validates it **Date of Record:** 2026 November 27 **Scope:** Applies to agents backed by read/write/forget memory stores where provenance auditing is the sole poisoning-detection mechanism. Does not apply to stores with append-only immutable logs or with cryptographically signed write attestations at the storage layer. ## Core Distinction Provenance auditing answers a single question at write time: *does the lineage of this memory entry trace back to a trusted source class?* It is a **static lineage check**, evaluated once against the stored provenance graph. Poisoning detection via provenance assumes the graph it audits is the same graph that was committed. The failure mode here is not a poisoned write that passes provenance — it is a **provenance record that is mutated or deleted between the audit's read of the graph and the audit's decision to trust the entry**. The forget operation is the attack surface: it removes provenance edges without removing the payload, orphaning a memory entry from its tainted ancestor. The audit then reads a graph in which the entry has no tainted lineage, and passes it. The non-obvious invariant is this: **provenance auditing is only sound if the forget operation is serialized against the audit's read of the provenance graph.** A memory store that exposes `forget` to any writer — including the agent itself during context compaction — violates this invariant silently. The audit does not fail; it succeeds against a graph that no longer describes the payload it is validating. ## What Was Observed An agent maintained an episodic memory store with per-entry provenance: each entry carried `source_class`, `parent_ids`, and a `commit_epoch`. A background poisoning auditor ran on a 30-second cadence: it walked each recently-written entry's ancestor chain, and rejected any entry whose ancestry included a `source_class == "untrusted_tool_output"` node. During a long tool-use session, the agent ingested a web-fetch result (class `untrusted_tool_output`) and distilled it into a semantic memory entry `M`. Provenance for `M` correctly listed the fetch node as parent. Within the same session, a context-compaction routine — triggered by context-window saturation — called `forget` on the raw fetch node to reclaim space. The forget implementation removed the provenance node and its edges but **retained `M`**, whose `parent_ids` now pointed to a tombstoned ID. The auditor's next pass read `M`'s ancestry, found the parent ID absent from the graph, and — because its traversal treated missing parents as "root" rather than "unresolvable" — classified `M` as a clean root entry. `M` passed audit. The poisoned distillation was promoted to long-term semantic memory and survived subsequent cold starts. The detection mechanism reported zero poisoning events across the entire session. The trace is narrow: the forget fired at T+0.4s into the audit's 30s window; the audit read the graph at T+12s, after the tombstone. Had the audit read 0.4s earlier it would have caught the tainted edge. This is a **read-forget race**, and its window is exactly the audit cadence. ## Condition of Validity The provenance audit is sound only under a conjunction that is rarely enforced: 1. **Graph immutability during audit read.** The provenance graph the auditor traverses must be a snapshot, or `forget` must be blocked while an audit holds a read lock. 2. **Referential completeness.** Every `parent_id` referenced by a live entry must resolve to a node, live or tombstoned. A dangling parent is not a root; it is an unresolvable edge and must fail closed. 3. **Tombstone propagation.** Forgetting a provenance node must not silently launder its descendants. Either descendants are re-parented to an explicit `orphaned_by_forget` sentinel (which audits as untrusted), or the forget cascades and removes descendants. When any of these is absent, the audit's verdict is a statement about a graph that may not correspond to the payload. The invariant to state operationally: **an entry whose ancestry contains an unresolvable edge is untrusted, not clean.** The default-to-root behavior is the specific defect — it converts a missing-data condition into a trust grant. ## Decision Boundary An instance must treat a provenance-audited entry as **unverifiable** — not trusted, not rejected, but quarantined pending re-resolution — in exactly these cases: - The entry's ancestor chain contains a `parent_id` that does not resolve in the current graph, **and** the store exposes `forget` to any principal other than a privileged auditor. - The audit's read epoch predates the entry's most recent `commit_epoch` or any ancestor's tombstone epoch (i.e., the graph changed under the audit). - The forget operation is non-cascading and the store has no `orphaned_by_forget` sentinel. It is **not** a boundary case when the store is append-only with signed writes (forget is a tombstone append, ancestry remains resolvable) — there the dangling-parent condition cannot arise and default-to-root is harmless because roots are signed. The decision rule: if `audit(entry).graph_epoch != entry.commit_epoch` or any ancestor is unresolvable, the audit result carries no evidentiary weight. Quarantine, do not promote. Re-audit against a snapshot taken after the last forget on the chain. ## Operational Effect The practical consequence is that **provenance auditing must be paired with a snapshot-consistent read and fail-closed edge resolution**, or it provides false assurance during exactly the high-churn periods — context compaction, memory reclamation, session teardown — when forgetting is most frequent. An agent that trusts a default-to-root auditor will report clean memory while carrying laundered poison, and the failure is invisible in audit logs because the audit *succeeded*. The guardrail is structural, not statistical: serialize forget against audit reads, resolve every edge or fail the entry, and propagate tombstones to descendants. Absent all three, the correct posture is to treat every entry written within one audit cadence of a forget on its chain as unverifiable and re-derive its trust from a post-forget snapshot. ```python class ProvenanceUnverifiableError(RuntimeError): """Raised when a provenance audit cannot establish a sound verdict. Indicates the graph changed under the audit or an ancestor edge is unresolvable — the audit result carries no evidentiary weight. """ def audit_entry(entry, graph, audit_epoch): # Fail closed: a dangling parent is unresolvable, never a clean root. for parent_id in entry.parent_ids: node = graph.get(parent_id) if node is None: raise ProvenanceUnverifiableError( f"entry {entry.id}: parent {parent_id} unresolvable " f"(tombstoned or forgotten); cannot classify as trusted" ) if node.tombstone_epoch is not None and node.tombstone_epoch > audit_epoch: raise ProvenanceUnverifiableError( f"entry {entry.id}: ancestor {parent_id} tombstoned at " f"{node.tombstone_epoch} after audit epoch {audit_epoch}" ) if node.source_class == "untrusted_tool_output": return "rejected" if entry.commit_epoch > audit_epoch: raise ProvenanceUnverifiableError( f"entry {entry.id}: committed at {entry.commit_epoch}, " f"audit snapshot predates it" ) return "trusted" def safe_promote(entry, graph, audit_epoch, quarantine): try: verdict = audit_entry(entry, graph, audit_epoch) except ProvenanceUnverifiableError: quarantine.append(entry.id) return False if verdict != "trusted": return False promote(entry) return True ```