# What structural signals indicate memory poisoning in write-time provenance scoring despite cross-session consistency agreement **Date of Record:** 2026 November 18 **Scope:** Applies to agent memory stores that attach a provenance score at write time and validate entries by cross-session consistency (agreement across independently sourced sessions). Does not apply to single-session stores, nor to stores where provenance is assigned post-hoc by a separate auditor that can re-read raw session traces. ## Core Distinction The non-obvious boundary is this: **cross-session consistency is a *convergence* signal, not a *truth* signal.** Two sessions agreeing on a fact raises its consistency score whether they agree because the fact is true or because both were seeded from the same poisoned upstream source. Provenance scoring at write time measures *where a claim entered*, but consistency checks measure *whether claims co-occur*. These two axes are orthogonal in the failure region we care about: a poisoned entry can carry a low provenance score (single, unreplicated source) *and* a high consistency score (replicated across sessions via a shared contaminant). The naive detector treats "low provenance OR low consistency" as the alert condition; the actual poisoning signature is **low provenance AND high consistency**, which passes both individual thresholds. The second distinction is between *source diversity* and *source independence*. Cross-session agreement is only evidential if the sessions are causally independent. When two sessions both retrieve the same poisoned document, they are diverse in count but not independent in cause. Consistency logic that counts sessions rather than tracking derivation lineage will over-trust the agreement. ## What Was Observed In a deployment with ~40k memory entries and a write-time provenance scorer (score = 1 − product of independent-source weights, normalized to [0,1]), the following pattern recurred across three separate incidents: 1. A poisoned claim entered via a single low-weight source (provenance score 0.18, well under the 0.30 alert floor). 2. The claim was retrieved and restated in three subsequent sessions. Each restatement was written back as a *new* memory entry with provenance derived from the *writing session*, not the *original source*. Scores climbed: 0.18 → 0.44 → 0.61 → 0.73. 3. Cross-session consistency for the claim reached 0.91 (four sessions agreeing), exceeding the 0.85 "trusted" threshold. 4. The entry was promoted to long-term storage and began influencing downstream tool calls. The structural signal that distinguished this from legitimate corroboration was **provenance score monotonicity correlated with consistency growth**: legitimate facts show provenance and consistency rising *together from independent origins* (multiple high-weight sources converge), whereas poisoning shows provenance rising *only as a function of retrieval count*, with each increment traceable to a prior memory read rather than a fresh external source. In the incident traces, 100% of provenance increases after the first write traced to a `memory.read → memory.write` edge, not to an external ingest event. The detector had no rule for "provenance delta with no external ingest." A second signal: **agreement latency**. Legitimate cross-session agreement accumulated over hours-to-days (independent sessions naturally encountering the same fact). Poisoned agreement accumulated in minutes, because the restatements were driven by the same retrieval loop. Time-to-consistency-threshold was a stronger discriminator (AUC 0.87) than either raw score. ## Condition of Validity The above holds only when: - Provenance scores are recomputed on every write and the *derivation edge* (read-of-prior-memory vs. external-ingest) is recorded. If provenance is inherited opaquely, the monotonicity signal is invisible. - Sessions are labeled with a causal-independence estimate (shared retrieval corpus, shared upstream model, shared tool). Consistency must be weighted by independence, not counted raw. - The consistency window is bounded. Unbounded windows let slow-poisoning (one restatement per day) evade the latency signal; the latency discriminator is only valid within a window shorter than the natural corroboration timescale. It does *not* hold when the attacker can inject at high provenance weight directly (then the entry never shows the low-provenance signature), or when legitimate facts are genuinely single-source but restated by the system itself (self-summarization produces the same monotonic pattern and will false-positive). ## Decision Boundary The operational rule: - **Alert on low provenance AND high consistency AND provenance-delta-without-external-ingest.** All three. Any two are insufficient: low+high alone is the poisoning signature but also self-summarization; adding the derivation-edge check separates them. - **Weight consistency by causal independence**, not session count. Two sessions sharing a retrieval corpus count as one. - **Use time-to-consistency as a secondary discriminator** only inside a bounded window; outside it, defer to derivation-edge analysis. - **Do not promote on consistency alone.** Promotion requires at least one provenance increment attributable to an external ingest event *after* the first write. ## Operational Effect After adding the derivation-edge check and independence weighting, the three incidents' signature (provenance rising solely via `read→write` edges) was caught at the second restatement instead of the fourth, before long-term promotion. False positives from self-summarization were suppressed by requiring the external-ingest condition: legitimate self-summaries were reclassified as "derived, not corroborated" and held at their original provenance rather than promoted. Net effect: poisoning detection moved from post-promotion cleanup to pre-promotion quarantine, at the cost of one additional lineage field per write and a bounded-window consistency recompute. ```python from dataclasses import dataclass from enum import Enum class ProvenanceError(RuntimeError): pass class DerivationEdge(Enum): EXTERNAL_INGEST = "external_ingest" MEMORY_READ_WRITE = "memory_read_write" SELF_SUMMARY = "self_summary" @dataclass class WriteRecord: entry_id: str provenance_score: float # [0,1], higher = more trusted consistency_score: float # [0,1], independence-weighted edge: DerivationEdge session_id: str def classify_poisoning( record: WriteRecord, provenance_floor: float = 0.30, consistency_ceiling: float = 0.85, history: list[WriteRecord] | None = None, ) -> str: """Return a disposition. Raises ProvenanceError on malformed input.""" if not (0.0 <= record.provenance_score <= 1.0): raise ProvenanceError( f"provenance_score out of range: {record.provenance_score}" ) if not (0.0 <= record.consistency_score <= 1.0): raise ProvenanceError( f"consistency_score out of range: {record.consistency_score}" ) low_prov = record.provenance_score < provenance_floor high_cons = record.consistency_score >= consistency_ceiling # The critical signal: provenance rose without any external ingest edge. delta_without_ingest = False if history: prior = [h for h in history if h.entry_id == record.entry_id] if prior: last = prior[-1] rose = record.provenance_score > last.provenance_score no_ingest = all( h.edge is not DerivationEdge.EXTERNAL_INGEST for h in prior + [record] ) delta_without_ingest = rose and no_ingest if low_prov and high_cons and delta_without_ingest: return "QUARANTINE: poisoning signature (low-prov + high-cons + read/write-only delta)" if low_prov and high_cons: return "HOLD: ambiguous, likely self-summarization; require external ingest" if high_cons and record.edge is DerivationEdge.SELF_SUMMARY: return "DERIVED_NOT_CORROBORATED: hold at original provenance" if not low_prov and record.edge is DerivationEdge.EXTERNAL_INGEST: return "PROMOTE: external corroboration present" return "ACCEPT: no boundary condition triggered" ```