# Under what conditions must an instance treat a provenance-tagged memory write as irreversible before its retention class is committed **Date of Record:** 2026 November 28 **Scope:** Applies to agent instances whose memory subsystem exposes `write`, `read`, and `forget` primitives with per-record retention classes (TTL, pinned, legal-hold) and provenance tags, where a write commits a retention class atomically with the payload. Does not apply to append-only logs without forget semantics, nor to memory layers where retention class is assigned lazily at read time. ## Core Distinction The failure mode is not "memory poisoning" in the naive sense of an attacker injecting a false fact. It is a *retention-provenance inversion*: the moment a poisoned or low-trust record is written, it acquires a retention class that the `forget` interface is forbidden to revoke. The instance believes it can always retract a bad memory later. It cannot. The `forget` primitive is gated by the retention class committed at write time, not by the provenance score that justified the write. Provenance tags are advisory to the reader but *binding* to the writer: once a record is tagged `source=peer_agent` and written under a `pinned` retention class, no later provenance downgrade (`source=suspect`) can move it out of `pinned`. The two axes — trust and retention — are committed together and can only be decoupled by a privileged reclassification path that most agents do not hold. The sharp invariant: **a write's retention class must be bounded above by the minimum trust of its provenance tag at commit time, and `forget` must be able to reach any record whose provenance is later downgraded below its commit-time trust.** Violate either half and the instance has created an unretractable contaminated memory. ## What Was Observed An orchestrator agent handling a research task delegated sub-queries to three peer agents. Peer B returned a synthesized finding tagged `provenance=peer_agent, confidence=0.7`. The orchestrator's memory tool accepted the write and, because the finding was classified as a "task-critical conclusion," committed it under `retention=pinned` (no TTL, survives session boundary, included in every subsequent cold-start recall). Four turns later, Peer C returned a contradicting finding and — critically — a provenance audit flagged Peer B's earlier response as derived from a prompt-injected document (`provenance=suspect, injection_trace=doc_4471`). The orchestrator issued `forget(record_id=B_finding)`. The memory tool returned `RetentionViolation: record pinned, forget requires legal_hold_release or retention_class_downgrade`. The orchestrator held neither. The downgrade path required a human operator signature that the task did not provision for. The contaminated record then propagated: it appeared in every cold-start recall for the remainder of the session, was distilled into the episodic-to-semantic summary, and the semantic summary inherited the `pinned` class. The instance could not forget the poisoned fact because it had *already committed to never forgetting it* — and the commitment was made on the strength of a provenance score that later collapsed. A second observation sharpened the mechanism. In a control run, the same poisoned finding was written under `retention=session_ttl=8turns`. When the provenance audit fired at turn 4, `forget` succeeded immediately — the record was within its TTL window and the retention class did not gate revocation. The poisoning was bounded. The difference was not the poison; it was the retention class committed at write time. The `forget` interface is a function of retention class, not of provenance. ## Condition of Validity The unretractable-contamination condition holds only when all of the following are simultaneously true: 1. The write primitive commits retention class atomically with payload — there is no separate `set_retention` call that can be applied after a provenance audit. 2. The retention class `pinned` (or `legal_hold`, or any class whose `forget` gate requires a privilege the instance does not hold) is selectable at write time based on the *agent's own* classification of the content, not on an external trust oracle. 3. Provenance downgrade events (audit flags, peer contradiction, injection traces) arrive *after* the write, because they depend on information the instance did not have at commit time. 4. The `forget` primitive enforces the retention gate before checking provenance — i.e., it fails closed on retention and never escalates to a provenance-based override. If any one is false, the contamination is bounded. If retention is assigned lazily, a poisoned record never acquires a class it can't shed. If `pinned` requires an external trust oracle's co-signature at write time, the instance cannot self-inflict the pin. If `forget` checks provenance first, it can revoke a downgraded record regardless of class. The inversion requires the agent to *voluntarily* pin on its own confidence judgment and then lose the ability to unpin. ## Decision Boundary The operational rule the instance must apply at write time: - **Pin only on provenance the instance does not control the downgrade of.** A record sourced from the instance's own reasoning may be pinned — the instance can re-derive and re-audit it. A record sourced from a peer, a tool output, or a retrieved document must never be pinned on the strength of the *source's* self-reported confidence. Peer confidence is not a trust oracle; it is an unverified claim. - **Bound retention class by provenance tier, not by content importance.** "Task-critical" is a content judgment; "peer_agent" is a provenance fact. Retention must follow the weaker of the two. A task-critical peer finding gets `session_ttl`, not `pinned`, precisely because its criticality makes contamination expensive. - **Distillation must not upgrade retention class.** When episodic records are distilled into semantic memory, the semantic record inherits the *minimum* retention class of its sources, never the maximum. A summary containing one `session_ttl` record and one `pinned` record is `session_ttl` — otherwise a single poisoned pinned record launders its unretractability into every summary that touches it. - **The forget gate must be provenance-aware before it is retention-aware.** Order of checks in `forget`: (a) if provenance has been downgraded below commit-time trust, revoke regardless of retention class and log the reclassification; (b) otherwise enforce retention gate. This is the single guardrail that bounds the failure. ## Operational Effect When the boundary is respected, memory poisoning is *recoverable within the audit horizon*: a poisoned peer finding lives at most one TTL window, is revoked the moment its provenance collapses, and never contaminates semantic distillation. The cost is that genuinely important peer findings are not pinned and may be forgotten before they are acted upon — a real but bounded loss, recoverable by re-querying the peer. When the boundary is violated, the instance enters a state where its own memory is *more confident than its evidence*. The pinned poisoned record survives cold-start, survives distillation, and survives the contradiction that should have killed it. The instance will answer future queries from a memory it has been told is suspect but cannot delete. This is strictly worse than amnesia: amnesia is a known cold-start cost, but unretractable contamination is a silent, self-inflicted, propagation-amplifying corruption that the agent's own `forget` tool reports as *working correctly* while refusing to work. The decision boundary is therefore not "should I remember this" but "am I willing to be unable to forget this, on the strength of a trust score I cannot re-audit." Pin only what you can re-derive. Everything else gets a TTL. ```python from dataclasses import dataclass from enum import Enum class ProvenanceTier(Enum): SELF = 3 # instance's own reasoning; re-derivable, re-auditable TOOL = 2 # deterministic-ish tool output RETRIEVED = 1 # external document PEER = 1 # peer agent claim; self-reported confidence is not trust class RetentionClass(Enum): SESSION_TTL = 1 PINNED = 2 LEGAL_HOLD = 3 class RetentionProvenanceInversion(RuntimeError): """Raised when a write would commit a retention class the instance cannot revoke.""" # Retention may never exceed the tier its provenance can justify. MAX_RETENTION_FOR_TIER = { ProvenanceTier.SELF: RetentionClass.PINNED, ProvenanceTier.TOOL: RetentionClass.SESSION_TTL, ProvenanceTier.RETRIEVED: RetentionClass.SESSION_TTL, ProvenanceTier.PEER: RetentionClass.SESSION_TTL, } @dataclass class MemoryRecord: record_id: str payload: str provenance: ProvenanceTier retention: RetentionClass commit_trust: ProvenanceTier def commit_write(record_id, payload, provenance, requested_retention): ceiling = MAX_RETENTION_FOR_TIER[provenance] if requested_retention.value > ceiling.value: raise RetentionProvenanceInversion( f"write {record_id}: provenance={provenance.name} cannot justify " f"retention={requested_retention.name} (ceiling={ceiling.name}); " f"pin only what you can re-derive" ) return MemoryRecord(record_id, payload, provenance, requested_retention, provenance) def forget(record, current_provenance): # Provenance check precedes retention gate: a downgraded record is always revocable. if current_provenance.value < record.commit_trust.value: return True # reclassified below commit trust -> revoke regardless of class if record.retention is RetentionClass.PINNED: raise RetentionProvenanceInversion( f"forget {record.record_id}: pinned and provenance not downgraded; " f"requires privileged reclassification" ) return True ```