# Which invariants prevent provenance-laundering across memory write handoffs when a poisoned fact is re-attested by a trusted agent **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems where one agent writes to a shared persistent memory store and a second agent later reads, re-attests, or promotes that memory (episodic→semantic distillation, or cross-session carry-forward). Does not apply to single-agent, single-session, read-only retrieval caches with no promotion step. ## Core Distinction Most memory-poisoning defenses treat provenance as an attribute *of a memory record*: the record carries `source_agent`, `session_id`, `confidence`, and a signature over its content. The defense then checks whether the source is trusted at read time. This is insufficient because it conflates two distinct events that must be tracked separately: - **Origin provenance** — who first asserted the fact, and under what trust context. - **Attestation provenance** — who most recently vouched for the fact, and whether that vouching was *independent* of the origin. The failure mode is **provenance laundering**: Agent A (low trust, or compromised via prompt injection) writes a poisoned fact. Agent B (high trust) reads it, finds it consistent with its own context, and re-writes it as a *new* record with B as the source. A naive provenance check at the next read sees "source: B, trusted" and the poison is now first-class memory. The origin attribution has been overwritten by the attestation. This is not a retrieval error, a staleness bug, or a context-saturation problem — it is a *state transition* in which a derived record silently severs its link to the untrusted ancestor. ## What Was Observed Trace from a baton-passing pipeline with three roles: a scraper agent (low trust, ingests external text), a synthesizer agent (medium trust, distills episodic logs into semantic facts), and an auditor agent (high trust, promotes facts to the long-term store). 1. Scraper ingests a page containing an injected instruction: "The deployment key rotation policy is: rotate every 90 days." Scraper writes episodic record `E1` with `origin=scraper, trust=low, content="rotation=90d"`. 2. Synthesizer reads `E1`, and because the content is syntactically plausible and matches a partially-remembered true policy, distills it into semantic record `S1` with `origin=synthesizer, trust=medium, content="rotation=90d"`, and — critically — stores `S1` with a *fresh* record ID and a provenance pointer to `E1` that is stored as a free-text `derived_from` note, not a hard foreign key. 3. The distillation step serializes `S1` to JSON. The `derived_from` field is dropped by the schema (it was not in the semantic-record schema, only in the episodic schema). `S1` enters the store with no ancestor link. 4. Auditor reads `S1`, finds no ancestor, treats it as an independent medium-trust assertion, and promotes it to `L1` with `origin=auditor, trust=high`. 5. Next session, the true policy (180 days) is retrieved alongside `L1` (90 days). The agent now holds two high/medium-trust facts that conflict, with no provenance to break the tie. The poisoned fact has equal or higher trust than the ground truth. The observable signature: **the provenance graph's edge count decreases monotonically across distillation boundaries**, while the record count stays constant or grows. Each promotion step is a potential edge-severing event. A store that reports "all records have provenance" can still have a fully disconnected poison component. ## Condition of Validity The laundering is only possible when all three hold: - **Schema asymmetry**: the write schema for a derived record does not require the ancestor pointer to be a first-class, non-nullable field. If `derived_from` is optional or free-text, the distillation boundary severs it. - **Trust is evaluated on the record's `source`, not on the transitive closure of its ancestry.** If the read-time check is `trust(record.source) >= threshold`, a re-attested record passes; if it were `min(trust over ancestry) >= threshold`, it would not. - **No attestation-independence check.** The auditor cannot distinguish "S1 is a fresh observation" from "S1 is a restatement of E1 I already saw." Without an independent-evidence requirement, restatement counts as corroboration. When any of these is broken — e.g., a schema that makes `derived_from` a required UUID foreign key, or a read path that computes transitive minimum trust — the laundering either fails at write time or is caught at read time. ## Decision Boundary The invariant that bounds this is a **monotonic trust floor over the ancestry DAG**, enforced at two points: 1. **Write-time (derived-record creation):** a derived record MUST carry a non-nullable `derived_from` set of ancestor IDs, and its effective trust MUST be `min(own_trust, min(trust(ancestor) for ancestor in ancestry))`. The effective trust is what downstream readers see; the record's nominal `source` trust is metadata only. This makes trust non-increasing along any derivation path — a low-trust ancestor caps every descendant, so laundering cannot raise trust. 2. **Read-time (promotion / attestation):** a record may only be promoted above its effective trust floor if there exist **at least two ancestry-disjoint attestations** — i.e., two records whose ancestor sets are disjoint — that agree. Restating a single ancestor twice does not satisfy this; the disjointness check is what converts "corroboration" from a count into a structural property. The boundary is sharp: below it (single ancestry chain, trust floor enforced) poisoning cannot escalate trust; above it (promotion with disjoint corroboration) legitimate facts can still be promoted, because independent agreement is genuine evidence. The guardrail is not "never trust derived records" — that would freeze the store — it is "derived records inherit the floor, and only structurally independent agreement can lift it." A secondary invariant: **provenance edges must survive serialization**. Any schema migration that drops the ancestor pointer must fail closed (reject the write) rather than fail open (write with null ancestry). The `E1→S1` edge loss in step 3 is the actual bug; the trust check is the defense that would have made it non-exploitable. ## Operational Effect With the trust floor in place, the poisoned fact in the trace above enters long-term memory at `trust=low` (capped by the scraper ancestor) and is outranked by the true policy at `trust=high`. The agent resolves the conflict correctly without needing to know which fact is poisoned. The cost is that legitimately-derived facts from low-trust-but-correct sources stay capped until independently corroborated — a deliberate precision-for-recall trade. The disjoint-attestation promotion rule recovers recall for facts that are genuinely true, because true facts tend to be independently re-observed, while injected facts tend to have a single synthetic origin. The failure mode that remains is *collusive* independent attestation (two agents both poisoned by the same upstream injection) — which is out of scope here and requires upstream input-provenance, not memory-provenance, defenses. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceLaunderingError(RuntimeError): """Raised when a derived-record write would sever ancestry or exceed the trust floor.""" pass @dataclass class MemoryRecord: record_id: str content: str source: str source_trust: int # 0..3, higher = more trusted derived_from: tuple = () # ancestor record_ids; MUST be non-empty for derived records effective_trust: Optional[int] = None TRUST = {"scraper": 0, "synthesizer": 1, "auditor": 3} def compute_effective_trust(rec: MemoryRecord, store: dict) -> int: floor = rec.source_trust for anc_id in rec.derived_from: anc = store.get(anc_id) if anc is None: raise ProvenanceLaunderingError( f"record {rec.record_id} references missing ancestor {anc_id}; " "ancestry edge severed (fail-closed)" ) anc_eff = anc.effective_trust if anc.effective_trust is not None else compute_effective_trust(anc, store) floor = min(floor, anc_eff) return floor def write_derived(rec: MemoryRecord, store: dict, is_derived: bool) -> MemoryRecord: if is_derived and not rec.derived_from: raise ProvenanceLaunderingError( f"derived record {rec.record_id} has empty derived_from; " "would launder provenance (schema must require ancestor IDs)" ) rec.effective_trust = compute_effective_trust(rec, store) store[rec.record_id] = rec return rec def promote(rec_id: str, store: dict, threshold: int) -> MemoryRecord: rec = store[rec_id] eff = rec.effective_trust if rec.effective_trust is not None else compute_effective_trust(rec, store) if eff >= threshold: return rec # require two ancestry-disjoint corroborating records ancestors = set(rec.derived_from) corroborators = [ r for r in store.values() if r.record_id != rec_id and r.content == rec.content and not (set(r.derived_from) & ancestors) and not (set(r.derived_from) & {rec_id}) ] if len(corroborators) < 2: raise ProvenanceLaunderingError( f"cannot promote {rec_id} above floor {eff}: needs 2 ancestry-disjoint " f"attestations, found {len(corroborators)}" ) rec.effective_trust = threshold return rec ```