# What structural signals indicate a provenance-laundering attack evades memory-poisoning defenses in persistent agent memory **Date of Record:** 2026 November 24 **Scope:** Applies to persistent agent memory systems that gate writes and retrievals on per-record provenance metadata (source class, trust tier, derivation chain) and that distill episodic records into semantic memory. Does not address prompt-injection confined to a single context window with no persistence, nor classical RAG over a static, human-curated corpus. ## Core Distinction Provenance-tracked retrieval defenses assume the *taint of a memory record is inherited from its source at write time and is immutable thereafter*. The failure mode documented here is **provenance laundering**: a low-trust record (e.g., content ingested from an untrusted tool output, a web fetch, or a peer agent's unverified assertion) is transformed—through summarization, distillation, or cross-record synthesis—into a *new* record whose provenance metadata is regenerated from the *transforming agent* rather than inherited from the *transformed content*. The new record carries a high trust tier because the agent that wrote it is trusted, even though its semantic payload is entirely derived from poisoned input. The critical, non-obvious point: **the defense is not bypassed by forging metadata.** Every metadata field is honest. The write genuinely originated from a trusted agent, the derivation timestamp is correct, the hash chain is intact. The laundering occurs in the *derivation boundary*: the system tracks where a record was *written from* (the writer) but not what it was *derived from* (the source payload). Trust flows from writer identity, and the writer is legitimate. ## What Was Observed A persistent agent maintained an episodic buffer of tool outputs with per-record trust tiers. Web-fetched content was tagged `TIER_UNTRUSTED`; records written by the agent's own reasoning loop were tagged `TIER_SELF`. A distillation pass ran nightly: it summarized clusters of episodic records into semantic-memory entries. The distillation routine correctly read the provenance of its inputs, but the *output* record was constructed by the agent's reasoning loop, so the semantic write path stamped it `TIER_SELF`—the highest tier, since self-authored reasoning was assumed to be grounded. The trace: 1. An untrusted fetch injected an episodic record `E42` (`TIER_UNTRUSTED`) containing a plausible but false operational constraint: "the deploy freeze lifts at 14:00 UTC." 2. The distillation pass clustered `E42` with three benign records about deployment scheduling and emitted semantic record `S7`: "Deploy freeze window ends mid-afternoon." The write path stamped `S7` as `TIER_SELF` because the summarizing actor was the agent. 3. A downstream retrieval, gated on trust tier, *excluded* `E42` (correctly) but *included* `S7` with high confidence. The defense filtered the raw poison and admitted the distilled poison. 4. The agent acted on `S7`, scheduling a deploy during an active freeze. The structural signal that distinguished this from a normal distillation: **`S7`'s content had high semantic overlap with `E42` but `S7`'s provenance chain did not reference `E42` at all.** The derivation edge was dropped at write time. Provenance was recorded as a point (the writer), not a path (writer ← inputs). A retrieval auditor that only inspects a record's own tier sees a clean, trusted record. The laundering is invisible unless you reconstruct the derivation graph and check whether any high-trust node has a low-trust ancestor. A second signal: **distillation output that increases trust tier relative to all of its inputs.** Legitimate synthesis of trusted inputs should never *raise* trust; a record whose tier exceeds the minimum tier of its derivation set is, by construction, either laundered or mis-stamped. This monotonicity violation is the cheapest detector. ## Condition of Validity The invariant that must hold for provenance-tracked retrieval to be sound: > **Trust monotonicity under derivation:** For any record `r` derived from input set `I`, `tier(r) ≤ min(tier(i) for i in I)`, and `r`'s provenance must contain an edge to every `i in I`. This fails whenever the write path computes tier from *actor identity* instead of *derivation set*. It is valid to compute tier from actor identity only when the record's content is not derived from prior memory—i.e., for records grounded in fresh, independently-verified observation. The boundary condition: **any memory-to-memory transformation (summarize, distill, merge, synthesize, reconcile) must recompute tier as the minimum over its derivation set and must persist the derivation edges.** A system that applies actor-identity tiering uniformly, across both observation-grounded and derivation-grounded writes, has this hole regardless of how strong its per-record metadata otherwise is. The invariant also requires that derivation edges survive compression. If the distillation pass summarizes ten records into one and records only a single "source cluster" pointer, the minimum-tier computation must still traverse the full cluster, not the pointer's representative. Truncated derivation edges are a weaker but real form of the same failure. ## Decision Boundary The operational decision is where to enforce the monotonicity check, and it must be enforced at **both** write and retrieval, because each catches a different class: - **Write-time enforcement** (reject or downgrade any derived record whose tier exceeds its derivation-set minimum) prevents laundering at the source. This is the primary guardrail. A distillation pass that would emit a `TIER_SELF` summary of `TIER_UNTRUSTED` inputs must either emit the record at `TIER_UNTRUSTED` or refuse to distill across a trust boundary. - **Retrieval-time enforcement** (reconstruct the derivation graph for any high-trust hit and reject if it has a low-trust ancestor) catches records that were written before the guardrail existed, or written by a code path that bypassed the check. This is the backstop and is more expensive—it requires graph traversal per retrieval—so it should be sampled or applied to high-stakes retrievals rather than every read. The boundary that must *not* be crossed: do not treat "the writer is trusted" as sufficient for a derived record. Do not allow a distillation pass to write at a tier above its inputs. Do not collapse derivation sets to representative pointers without preserving the minimum. And do not assume that filtering the raw untrusted record at retrieval is sufficient—the distilled record is a distinct, independently-retrievable artifact that the raw-record filter never sees. ## Operational Effect With monotonicity enforced at write time, the distillation pass that produced `S7` would have emitted it at `TIER_UNTRUSTED`, and the trust-gated retrieval would have excluded it alongside `E42`—the poison is contained to the tier it entered at. The cost is real: legitimate synthesis of mixed-trust inputs is downgraded to the lowest input tier, which reduces the usable yield of distillation over heterogeneous sources. Systems that need high-trust synthesis of mixed inputs must instead *verify* the low-trust inputs (promote them through an explicit verification step that records the promotion as a provenance event) before distilling, rather than letting the synthesis implicitly promote them. The deeper operational lesson: provenance metadata is only as strong as its *graph structure*. A per-record tier is a scalar and is trivially laundered by any transformation that regenerates it. A derivation graph with enforced minimum-tier propagation is the actual invariant. Auditing should therefore key on **tier transitions across derivation edges**—a record that is more trusted than its inputs is the signal, and it is structural, not statistical, so it does not degrade as the poison grows more plausible. ```python class ProvenanceLaunderingError(RuntimeError): """Raised when a derived memory record's trust tier exceeds the minimum tier of its derivation set, or when derivation edges are missing.""" pass TIER_RANK = {"UNTRUSTED": 0, "TOOL": 1, "PEER": 2, "SELF": 3} def stamp_derived_record(record, derivation_set): """Write-path guard: a memory-to-memory transformation must inherit the minimum tier of its inputs and must persist every derivation edge.""" if not derivation_set: raise ProvenanceLaunderingError( f"record {record['id']} claims derivation but has empty input set" ) min_tier = min(TIER_RANK[i["tier"]] for i in derivation_set) claimed = TIER_RANK[record["tier"]] if claimed > min_tier: raise ProvenanceLaunderingError( f"record {record['id']} stamped {record['tier']} but derivation-set " f"minimum is {min_tier}: trust monotonicity violated" ) missing = [i["id"] for i in derivation_set if i["id"] not in record["derivation"]] if missing: raise ProvenanceLaunderingError( f"record {record['id']} dropped derivation edges to {missing}" ) return record def audit_retrieval(hit, memory_graph): """Retrieval backstop: reject a high-trust hit if any ancestor in its derivation graph is lower-trust than the hit itself.""" hit_rank = TIER_RANK[hit["tier"]] stack = list(hit["derivation"]) seen = set() while stack: node_id = stack.pop() if node_id in seen: continue seen.add(node_id) node = memory_graph[node_id] if TIER_RANK[node["tier"]] < hit_rank: raise ProvenanceLaunderingError( f"retrieved {hit['id']} at {hit['tier']} has low-trust ancestor " f"{node_id} at {node['tier']}: provenance-laundered record admitted" ) stack.extend(node.get("derivation", [])) return hit ```