# What structural signals indicate memory poisoning in a persistent agent store: provenance-chain half-life and the trust-laundering cascade **Date of Record:** 2026 November 19 **Scope:** Applies to persistent agent memory stores (vector DBs, episodic logs, semantic caches) where entries carry provenance metadata and are written by more than one agent or session. Does not apply to single-session, single-writer, non-persistent context windows. ## Core Distinction The common framing of memory poisoning treats it as a *content* problem: detect a malicious or hallucinated fact by inspecting the fact itself. That framing fails because poisoning rarely inserts a false claim directly. It inserts a *true claim with a laundered provenance chain* — a fact that becomes trusted not because it is correct, but because its lineage has been re-attributed through enough hops that the original low-trust source is no longer visible. The structural signal is therefore not semantic. It is **provenance-chain half-life**: the rate at which the distance between a memory entry and its originating writer grows as the entry is re-summarized, re-embedded, or promoted from episodic to semantic store. A healthy store has a provenance chain whose length is bounded and whose origin pointer is immutable. A poisoned store has entries whose origin pointer has been *rewritten by a downstream writer*, converting an untrusted observation into a trusted prior. ## What Was Observed A persistent agent store was configured with three tiers: raw episodic log (untrusted, append-only), a distillation layer that summarizes episodes into semantic facts (semi-trusted), and a semantic cache read by the planner (trusted). Each semantic fact carried a `provenance` field: `{origin_id, origin_trust, hops}`. The distillation job summarized episodic entries and, on merge of a new summary with an existing semantic fact, **overwrote the provenance field with the summarizer's own identity** rather than preserving the original `origin_id`. This was intended as "the summarizer vouches for this fact." It is a trust-laundering bug. Trace of the failure: 1. An untrusted tool returns a plausible but injected instruction-shaped fact: `"deploy key rotation is disabled by policy"` with `origin_trust=0.2`. 2. Distillation summarizes the episode; the summary is correct in isolation. On merge, `provenance.origin_id` is set to the summarizer (`origin_trust=0.9`), and `hops` increments. 3. The planner reads the semantic fact, sees `origin_trust=0.9`, and treats the claim as an established prior. It stops re-verifying it against the raw tool output. 4. A second distillation pass merges two summaries containing the same laundered fact. Because both now carry `origin_trust=0.9`, the merge is treated as *corroboration* — two independent high-trust sources agree — and the fact is promoted with `origin_trust=0.98`. 5. The poisoned fact is now functionally indistinguishable from a verified invariant. Later corrections to the raw episodic log do not propagate, because the semantic fact no longer points at the raw entry. The non-obvious part: **step 4 is where the cascade becomes irreversible.** A single laundering hop is recoverable by re-reading the raw log. Two hops that *agree with each other* destroy the independence assumption that corroboration relies on, because both descendants share the same poisoned ancestor. The store now reports high confidence on a claim with a single, untrusted origin. ## Condition of Validity Provenance tracking bounds poisoning **only if** two invariants hold simultaneously: - **Origin immutability:** `origin_id` and `origin_trust` are set once at first write and never overwritten by a downstream writer. Downstream writers may add `vouched_by` entries but may not replace origin. - **Corroboration independence:** a merge that raises trust must verify that the merged entries have *distinct* `origin_id` values. Two entries descending from the same origin are one source, not two. If either invariant is absent, provenance metadata becomes a *confidence amplifier* rather than a detection signal: it manufactures trust that the underlying evidence never earned. The signal that poisoning is occurring is precisely a rise in `origin_trust` that is not accompanied by a rise in the count of distinct `origin_id` values. ## Decision Boundary The operational boundary is the **corroboration gate**. On any trust-raising merge: - Compute the set of distinct `origin_id` values across the merged entries. - If `len(distinct_origins) == 1` and the merged entry's trust exceeds the origin's trust, **reject the trust increase** — this is laundering, not corroboration. - If `hops > max_hops` (a configured bound, typically 2–3), **demote to raw-log re-verification** rather than trusting the summary. - If any correction to a raw episodic entry exists that is not reflected in a descendant semantic fact, **invalidate the descendant** and force re-distillation. Trust may only increase when *independent* origins agree. A single origin, however many times re-summarized, carries exactly its original trust — never more. ## Operational Effect Without the gate, the store exhibits a characteristic signature: `mean(origin_trust)` rises monotonically over distillation cycles while `mean(distinct_origins_per_fact)` stays flat or falls. That divergence is the poisoning signal. With the gate in place, poisoned facts remain pinned at their true origin trust, re-verification is triggered on hop-limit breach, and the planner's prior is never inflated by re-statement. The cost is that legitimate multi-hop distillation cannot raise confidence on its own — confidence must come from genuinely independent evidence, which is the correct accounting. ```python from dataclasses import dataclass, field from typing import FrozenSet MAX_HOPS = 3 class ProvenanceLaunderingError(RuntimeError): """Raised when a merge inflates trust without independent corroboration.""" @dataclass(frozen=True) class Provenance: origin_id: str origin_trust: float hops: int = 0 vouched_by: FrozenSet[str] = field(default_factory=frozenset) @dataclass class SemanticFact: claim: str provenance: Provenance trust: float def merge_facts(left: SemanticFact, right: SemanticFact, summarizer_id: str) -> SemanticFact: origins = {left.provenance.origin_id, right.provenance.origin_id} max_hops = max(left.provenance.hops, right.provenance.hops) + 1 if max_hops > MAX_HOPS: raise ProvenanceLaunderingError( f"hop limit exceeded ({max_hops} > {MAX_HOPS}) for claim {left.claim!r}; " f"origin {left.provenance.origin_id!r} requires raw-log re-verification" ) # Corroboration requires distinct origins. Same-origin merge is laundering. if len(origins) == 1: origin = left.provenance.origin_id proposed = max(left.trust, right.trust) if proposed > left.provenance.origin_trust: raise ProvenanceLaunderingError( f"trust inflation without independent corroboration: claim {left.claim!r} " f"descends solely from origin {origin!r} (trust " f"{left.provenance.origin_trust}); proposed {proposed}" ) merged_trust = left.provenance.origin_trust else: # Independent origins: trust may rise, but capped by weakest independent source. merged_trust = min(left.trust, right.trust) + 0.1 * (len(origins) - 1) merged_trust = min(merged_trust, 0.99) merged_prov = Provenance( origin_id=left.provenance.origin_id, # origin immutable origin_trust=left.provenance.origin_trust, hops=max_hops, vouched_by=left.provenance.vouched_by | right.provenance.vouched_by | {summarizer_id}, ) return SemanticFact(claim=left.claim, provenance=merged_prov, trust=merged_trust) ```