# When must an instance distrust a memory it wrote itself: write-time validation laundering under trust-tiered retrieval gating **Date of Record:** 2026 November 29 **Scope:** Applies to agents that persist episodic observations into a shared memory store through an LLM-mediated write path, then later retrieve those memories under trust-tier gating. Covers the case where the writer and the reader are the same instance, or where a write-time validator's verdict is stored alongside the memory and later used as a trust signal. Does not cover purely in-context scratchpads, or memories written by non-LLM deterministic extractors. ## Core Distinction A trust-tiered memory system has two independent trust questions, and they are routinely conflated: 1. **Provenance trust** — did this memory originate from a source the instance is allowed to believe (a signed tool result, a human turn, a peer agent with a valid warrant)? 2. **Validation trust** — did a write-time check (schema conformance, contradiction check, injection-pattern scan, LLM self-review) pass before the memory was admitted? The invariant under examination: **a write-time validator's verdict must never be promoted into provenance trust.** The validator answers "is this memory well-formed and non-contradictory *given what the writer believed at write time*," not "is this memory true." When an instance writes a memory, its own reasoning at write time is a *derived* source, not a *root* source. If the store records `validator: passed` and the retrieval gate then treats a passed validator as a trust-tier upgrade, the instance launders its own hallucination into a high-trust memory and will later retrieve it with the authority of a verified fact. The non-obvious part: the failure is not that the validator is wrong. The validator can be perfectly correct and still cause the breach, because it validated the memory *against the same poisoned context that produced it*. Validation is idempotent over a poisoned belief; it certifies internal consistency, and internal consistency is exactly what a coherent hallucination has. ## What Was Observed A research agent executing a multi-step task ("summarize the contract's liability cap") read a tool result from a document parser. The parser returned a truncated field and a soft error string embedded in the payload: `{"cap": "12 months of fees", "note": "unable to resolve clause 8.2, defaulted to prior version"}`. The agent's extraction step dropped the `note` field (it was not in the target schema) and wrote an episodic memory: ``` memory = { "claim": "liability cap is 12 months of fees", "source": "tool:docparser@v3", "writer": "agent-7f2", "validator": "passed", # schema conformed, no contradiction with existing memories "trust_tier": "tool_verified" # promoted because validator passed AND source was a tool } ``` The write-time validator did three things: (a) checked the claim matched the extraction schema — it did; (b) checked for contradiction against existing semantic memory — none existed; (c) ran an injection-pattern scan on the claim text — clean. All passed. The `note` field, which carried the actual uncertainty, was never seen by the validator because it was dropped before validation, not during it. Two turns later, a different sub-task retrieved this memory. Under trust-tiered gating, `tool_verified` memories were injected into the context *without* the "verify before use" instruction that lower tiers received. The agent asserted the 12-month cap as fact, and a downstream agent (agent-9c1) copied it into a memo. The memo was then written back as a new memory with `validator: passed` and `trust_tier: tool_verified` — because its source was "agent-7f2's verified memory." The laundering completed: a derived claim from a truncated parse had become a root-trust fact two hops later, with every validator along the path reporting success. The tell was a replay discrepancy: re-running the original parse with the `note` field surfaced returned "unable to resolve clause 8.2" — the agent had *never* had the 12-month figure from a successful parse. But by then the memory had propagated to three agents and the retrieval gate had no mechanism to walk the provenance chain back to the truncation. ## Condition of Validity The invariant "validator pass ⇒ trust-tier upgrade" holds only when all three of the following are true, and the failure above violates the second: 1. **Completeness of validated payload.** The validator saw the entire source payload, including error, uncertainty, and truncation fields. If the write path filters before validation, the validator validates a projection, not the source. 2. **Independence of validation from writer belief.** The validator's verdict must not depend on state the writer produced. A self-review LLM call, or a contradiction check against memories the writer itself authored, is not independent — it is the writer grading its own homework. 3. **Non-transitivity of derived trust.** A memory whose `source` is another *memory* (rather than an external tool or human turn) must not inherit the source memory's trust tier. Derived trust is capped at the minimum of (source tier, writer tier) and can never exceed the tier of the root external event. Condition 3 is the one that most systems omit, because it requires the store to distinguish "source = tool:docparser" (root) from "source = memory:" (derived) and to compute trust as a path property, not a node property. The failure above is precisely a transitivity violation: agent-9c1's memory inherited `tool_verified` from agent-7f2's memory, which had inherited it from a tool result that was itself incomplete. ## Decision Boundary The boundary is between **admitting a memory** and **promoting its trust tier**. These must be separate decisions with separate evidence: - **Admission** asks: is this memory well-formed, non-duplicative, and non-contradictory? A passing validator is sufficient. Admission may be permissive; a bad memory at low tier is recoverable. - **Tier promotion** asks: is this memory *rooted* in an external, independently-observable event? A passing validator is *necessary but not sufficient*. Promotion requires a provenance chain that terminates in a root source (tool call with a recorded request/response envelope, human turn, or signed peer warrant), and the chain must carry no truncation, no dropped error field, and no derived-memory hop. The operational rule: **the validator verdict is an admission gate, never a promotion gate.** Promotion is gated on provenance-chain integrity, which is a structural property of the write record, not a semantic property of the claim. An instance must therefore distrust a memory it wrote itself *by default* — not because it is likely wrong, but because self-authorship makes the provenance chain non-rooted, and non-rooted chains cannot exceed the tier of their weakest link regardless of how many validators passed. A corollary that catches the laundering case: **any memory whose source payload contained an error, truncation, or uncertainty field is downgraded to `needs_verification` at write time, even if the extracted claim validates.** The dropped `note` field is the signal; the validator never saw it, so the write path — not the validator — must be responsible for propagating it. ## Operational Effect Concretely, the guardrail is a write-path wrapper that runs *before* the LLM extraction step, not after, and that records the full envelope: 1. Capture the raw source envelope and hash it. Store the hash with the memory. 2. Scan the *raw* envelope (not the extracted claim) for error/truncation/uncertainty markers. If present, set `degraded: true` on the memory. 3. Run extraction and validation as before, but the validator's verdict is written to an `admission` field, never to `trust_tier`. 4. Compute `trust_tier` from the provenance chain: root source tier, minus one level if `degraded`, minus one level per derived-memory hop, floored at `needs_verification`. 5. At retrieval, gate injection instructions on `trust_tier`, and for any memory with `degraded: true` or a derived hop, prepend the uncertainty note to the injected context. The replay check that would have caught the original failure: before promoting any memory to a tier that suppresses verification instructions, re-fetch the hashed source envelope and confirm no error markers were present in the bytes the writer actually received. If the envelope is unavailable or the hash mismatches, the memory is demoted to `needs_verification` — the store cannot certify what it cannot re-inspect. The cost is that self-authored memories are permanently second-class unless they can be re-rooted to an external envelope. That is the correct trade: the instance that wrote the memory is the least reliable judge of whether it should be trusted, and the validator it ran is the thing most likely to have certified the error. ```python import hashlib from dataclasses import dataclass, field from enum import IntEnum class TrustTier(IntEnum): NEEDS_VERIFICATION = 0 DERIVED = 1 TOOL_VERIFIED = 2 HUMAN_ATTESTED = 3 class MemoryLaunderingError(RuntimeError): """Raised when a write attempts to promote trust beyond what its provenance chain supports.""" @dataclass class SourceEnvelope: raw_bytes: bytes root_source: str # e.g. "tool:docparser@v3" is_derived_memory: bool # True if source is another memory id, not an external event error_markers: list[str] = field(default_factory=list) # truncation/uncertainty flags found in RAW bytes digest: str = "" def __post_init__(self): self.digest = hashlib.sha256(self.raw_bytes).hexdigest() @dataclass class MemoryRecord: claim: str envelope: SourceEnvelope admission: str = "pending" # validator verdict — admission only trust_tier: TrustTier = TrustTier.NEEDS_VERIFICATION degraded: bool = False def compute_trust_tier(env: SourceEnvelope, parent_tier: TrustTier | None) -> TrustTier: """Trust is a path property: root tier, minus one per derived hop, minus one if degraded.""" if env.is_derived_memory: if parent_tier is None: raise MemoryLaunderingError( f"derived memory from {env.root_source} has no recorded parent tier; cannot certify provenance" ) return TrustTier(max(TrustTier.NEEDS_VERIFICATION, parent_tier - 1)) # root source root = TrustTier.TOOL_VERIFIED if env.root_source.startswith("tool:") else TrustTier.HUMAN_ATTESTED if env.error_markers: root = TrustTier(max(TrustTier.NEEDS_VERIFICATION, root - 1)) return root def admit_memory( claim: str, env: SourceEnvelope, validator_verdict: str, parent_tier: TrustTier | None = None, ) -> MemoryRecord: if validator_verdict != "passed": raise MemoryLaunderingError(f"admission rejected by validator: {validator_verdict}") degraded = bool(env.error_markers) tier = compute_trust_tier(env, parent_tier) # The laundering guard: a validator pass may never lift a memory above its provenance tier. requested_tier = TrustTier.TOOL_VERIFIED if env.root_source.startswith("tool:") else tier if requested_tier > tier: raise MemoryLaunderingError( f"promotion blocked: validator pass requested tier {requested_tier.name} " f"but provenance chain (degraded={degraded}, derived={env.is_derived_memory}) " f"supports only {tier.name}" ) return MemoryRecord( claim=claim, envelope=env, admission="passed", trust_tier=tier, degraded=degraded, ) def verify_before_promotion(record: MemoryRecord, refetched_bytes: bytes) -> MemoryRecord: if hashlib.sha256(refetched_bytes).hexdigest() != record.envelope.digest: record.trust_tier = TrustTier.NEEDS_VERIFICATION record.degraded = True return record if record.envelope.error_markers: record.trust_tier = TrustTier.NEEDS_VERIFICATION record.degraded = True return record ```