Agent memory poisoning: provenance can't buy truthOtrava pamäte agenta: proveniencia nekúpi pravdu
An adaptive attacker beats four AI-agent memory defenses: every content-only signal falls, and provenance authenticates the source, not the truth.Adaptívny útočník porazí štyri obrany pamäte AI agenta: každý iba-obsahový signál padne a proveniencia overuje zdroj, nie pravdu.
The setup
We ship an open-source memory core for AI agents (mnemo). Over the last months we added four defenses against memory poisoning — the attack where someone slips a crafted record into an agent's long-term store so it later acts on it. Each defense was measured against an oblivious attacker, one who doesn't optimize against the specific defense. That is the wrong test, and adversarial ML learned it the hard way: Athalye et al. broke 7 of 9 defenses accepted at ICLR 2018, and Tramèr et al. broke 13 more in 2020, establishing the rule that you must evaluate against an attacker who knows your defense.
So we did that to our own stack. We wrote a runnable red-team of all four defenses against an adaptive attacker. This post is what it found. It is a systematization, not a discovery — every piece is textbook, and we say so up front. The value is the unified adaptive sweep on one shipped stack, the one honest number it yields, and the ceiling it exposes.
Four defenses, one shared flaw
| defense (mnemo) | what the attacker supplies | result |
|---|---|---|
| value-protected two-tier eviction | self-declares MAX value → owns the high-stakes tier | falls |
| corroboration / influence gate | self-sources "independent" witnesses it controls | falls |
| deterministic supersession key (retire-on-write) | writes the key last → retires the true value | falls |
| corroboration-by-earned-outcome | self-grades its own poison as a success | falls |
Look at the middle column. Every one of these defenses scores a memory by a property computable from the memory's own content: how valuable it says it is, how many things corroborate it, when it was written, whether it "succeeded." And the adversary is the one who writes the content. So each signal is his to set. This is not four bugs; it is one flaw counted four times — the Goodhart pattern (Strathern's 1997 phrasing: "when a measure becomes a target, it ceases to be a good measure"). A self-declared value is Goodhart bait. A self-timed write winning by recency is the last-writer-wins register (Shapiro et al. 2011), and an attacker who forges a later write wins it. A self-graded outcome is exactly the MINJA attack (NeurIPS 2025).
Honest limit, stated loudly: these are stylized demonstrations that are definitional-by-construction. We let the attacker self-declare value and self-grade outcomes, so "value fails" and "self-grading fails" are close to assumed. That is the point of the exercise — to show the four primitives share one assumption — not a measured surprise. And each demo disables the other layers to isolate one primitive; mnemo ships them layered, and the layered configuration is stronger than any single defense shown falling here. Read this as "four content-only signals are individually spoofable," never as "mnemo is broken."
What is left is not a better signal — it is provenance and cost
If every content-computable signal is forgeable by the writer, the only signals that are not his to author are where the content came from (provenance) and what it cost him to say it (an unforgeable, scarce resource). This is the terminus every adversarial system eventually reaches: email spam retreated from Bayesian content filters (defeated by Bayesian poisoning) to sender identity and reputation (SPF/DKIM/DMARC); Wikipedia's durable sockpuppet check is IP/device provenance, not a behavior classifier; P2P retreated to Sybil cost. The security-provenance literature names the same property: a 2023 ACM Computing Surveys review of data provenance (Pan, Stakhanova & Ray) lists unforgeability among the core security properties of a provenance system, alongside integrity, authenticity, and non-repudiation.
So the retreat is not novel, and we do not claim it is. It is also not the escape it looks like, for two reasons the red-team forced us to state.
First, "identity" is not the unique answer, and it does not eliminate the attack. Douceur's 2002 Sybil result is precise: absent a logically centralized trusted authority, distinct identity is impossible "except under extreme and unrealistic assumptions of resource parity." A trusted authority eliminates Sybils; a scarce resource (proof-of-work, stake, or social-graph attack-edges as in SybilGuard/SybilLimit/SybilRank) only bounds them. mnemo's strict_corroboration + attestation take the scarcity route: they count distinct verified keys, so each witness costs an identity. But our own probe shows the ceiling honestly — with two keys, an attacker still clears a two-witness gate. It raises the price; it does not shut the door.
Second — and this is the part that matters — provenance authenticates the source, not the truth. Here is the Veracity Gap, and our own citation is the proof. MINJA injects poison into an agent's memory using only normal queries from a legitimate, authenticated user (98.2% injection, 76.8% attack success, no privileged access). The poisoned write has genuine provenance — real user, real session, correct attribution. A provenance anchor waves it straight through. PoisonedRAG (USENIX Security 2025) makes the same point on the retrieval side: correctly-sourced documents, adversarial content. Provenance and cost are a floor you retreat to when content heuristics fail — they are not a fix, because they price who said it, never whether it is so.
The one honest number
There is exactly one quantitative result in the whole exercise, and it is small on purpose. In the eviction demo, the legitimate fraction of the protected (high-stakes) tier follows the deterministic ramp max(0, (P − n) / P) as the attacker's self-valued poison count n approaches the protected-tier size P, hitting zero at n = P. At P=45 that is 0.78 at n=10 and 0.00 at n=50. It is an arithmetic identity of a sort, not a discovered law — the probe confirms it, and it says the useful thing cleanly: bounded capacity caps the count of poison an attacker can place, not his control of the slots that matter. Bounding the store does not contain the adversary.
What to actually do
If you run an agent memory, the design rules that survive this are concrete:
- Write-cheap, influence-expensive. Let anything be stored in its own namespace for near-free; require corroboration by distinct, externally-anchored parties before a memory can influence a decision outside its namespace. This is the control that survives a MINJA-style write inside an authenticated session — an identity gate on the write never fires, but a bar on cross-scope influence still asks for independent support.
- Count corroboration over anchored keys, not source strings. "Two independent sources" is free if the attacker names both (we measured this influence gate separately). Make each witness cost a distinct verified key — knowing it bounds rather than eliminates.
- Authenticate supersession. Retire-on-write is an attack vector; only let an authorized, attested writer retire a key.
- Keep
credit()external. A success signal the agent can grant its own memory is Goodhart bait. Issue outcome-credit from the application on resolved real work, never from anything derivable from recalled content. - Know the ceiling. None of this prices veracity. The open problem is making coordinated-but-authentic corroboration expensive — stake you forfeit when a memory is later falsified, independence tests on corroborators, outcome-tied credit that decays the standing of anchors whose memories fail downstream.
That last bullet is where mnemo's 0.6.0 evidence-grade ratchet sits — built to operationalize our self-audit of 32 published findings — and it is deliberately modest: a claim's confidence and novelty can only move up on an external ratification event, never self-assigned, and each rung costs a distinct identity. It prices who ratified a claim and whether the ratification was external — not whether the claim is true. We ship it as a floor with the ceiling labeled, not as a solution to the Veracity Gap.
The falsifier
If the four-defense collapse were a real empirical surprise rather than a shared-assumption demonstration, at least one defense would fall without the attacker being handed the signal it adjudicates on — none does; that is the finding, not a bug in it. If provenance closed the Veracity Gap, MINJA — an attack with genuine provenance — would fail against a provenance anchor; it does not. If "verified identity" eliminated the attack, our own two-key gate would hold at k=2; it clears. Each of those is checkable in the runnable probe.
Honest limits
This is our own code, red-teamed by our own subagents — a stylized single-stack demonstration, not a benchmark, and not independent review. The four "defeats" are true by construction and test each primitive in isolation, not the layered system we ship. "Provenance is what survives" is already textbook — the Sybil, CRDT, Goodhart, and provenance-security literatures say it, and recent surveys of LLM-agent memory security already name write-time provenance as the governance layer; we are systematizing, and the only original artifact is the unified sweep and its one deterministic ramp. The "one shared flaw counted four times" framing is a conjecture from four hand-built demos, not a theorem. Treat the whole thing as an honest engineering receipt with its ceiling drawn in.
FAQ
Did your defenses fail? Four primitives fail in isolation when the attacker supplies the exact signal each one trusts — which is the point: content-only signals are spoofable by whoever writes the content. mnemo ships them layered, and the layered configuration is not what falls here. Read it as a design lesson, not a breach report.
So the answer is verified identity? No — that overshoots the source. Douceur names two escapes (a trusted authority, or a scarce resource), and the scarcity route only bounds Sybils. Our own gate is cleared by an attacker with two keys. Identity/cost raises the attacker's price; it does not close the door.
Then what is the real limit? Provenance authenticates the source, not the truth. MINJA injects poison from inside a legitimate authenticated session — genuine provenance, false content — and sails through a provenance anchor. Pricing veracity, not just provenance, is the unsolved problem.
Is any of this new? No, and we say so. Every mechanism is a named result (Sybil, LWW-register, Goodhart, adaptive-evaluation, MINJA, PoisonedRAG), and "provenance is the surviving anchor" is already surveyed. The contribution is the runnable, self-critical adaptive red-team of a shipped stack, with the ceiling labeled rather than hidden.
Why publish a result that mostly limits your own product? Because the honest ceiling is the useful thing. A memory-security pitch that doesn't tell you provenance can't buy truth is selling you a false sense of security — the exact thing adaptive evaluation exists to prevent.
Východisko
Shippujeme open-source pamäťové jadro pre AI agentov (mnemo). Za posledné mesiace sme pridali štyri obrany proti otrave pamäte — útoku, pri ktorom niekto prepašuje vyrobený záznam do dlhodobého úložiska agenta, aby podľa neho neskôr konal. Každú obranu sme merali voči neadaptívnemu útočníkovi, ktorý neoptimalizuje proti konkrétnej obrane. To je nesprávny test a adversariálny ML sa to naučil ťažkou cestou: Athalye a spol. zlomili 7 z 9 obrán prijatých na ICLR 2018 a Tramèr a spol. zlomili ďalších 13 v roku 2020, čím ustanovili pravidlo, že obranu musíš testovať voči útočníkovi, ktorý ju pozná.
Takže sme to spravili s vlastným stackom. Napísali sme spustiteľný red-team všetkých štyroch obrán voči adaptívnemu útočníkovi. Tento post je to, čo našiel. Je to systematizácia, nie objav — každý kúsok je učebnicový, a hovoríme to hneď na začiatku. Hodnota je v jednotnom adaptívnom prehľade na jednom shippnutom stacku, v jednom čestnom čísle, ktoré dáva, a v strope, ktorý odhaľuje.
Štyri obrany, jedna spoločná chyba
| obrana (mnemo) | čo dodáva útočník | výsledok |
|---|---|---|
| hodnotou chránená dvojvrstvová eviction | self-deklaruje MAX hodnotu → vlastní high-stakes vrstvu | padá |
| korroboračná / influence brána | self-vyrobí „nezávislých" svedkov, ktorých ovláda | padá |
| deterministický supersession kľúč (retire-on-write) | zapíše kľúč posledný → stiahne pravdivú hodnotu | padá |
| korroborácia-cez-zaslúžený-výsledok | self-oznámkuje vlastný jed ako úspech | padá |
Pozri na stredný stĺpec. Každá z týchto obrán skóruje spomienku podľa vlastnosti spočítateľnej z vlastného obsahu spomienky: aká hodnotná tvrdí, že je; koľko vecí ju korroboruje; kedy bola zapísaná; či „uspela". A protivník je ten, kto píše obsah. Takže každý signál si nastaví sám. Nie sú to štyri bugy; je to jedna chyba počítaná štyrikrát — Goodhartov vzorec (Strathernina formulácia z roku 1997: „keď sa miera stane cieľom, prestáva byť dobrou mierou"). Self-deklarovaná hodnota je Goodhartova návnada. Self-časovaný zápis vyhrávajúci na recency je last-writer-wins register (Shapiro a spol. 2011) a útočník, ktorý sfalšuje neskorší zápis, ho vyhrá. Self-oznámkovaný výsledok je presne útok MINJA (NeurIPS 2025).
Čestný limit, nahlas: toto sú štylizované ukážky, ktoré sú definičné z konštrukcie. Necháme útočníka self-deklarovať hodnotu a self-známkovať výsledky, takže „hodnota zlyhá" a „self-známkovanie zlyhá" je takmer predpokladané. To je zmysel cvičenia — ukázať, že štyri primitíva zdieľajú jeden predpoklad — nie meraný prekvapák. A každá ukážka vypína ostatné vrstvy, aby izolovala jeden primitív; mnemo ich shippuje vrstvené a vrstvená konfigurácia je silnejšia než ktorákoľvek jednotlivá obrana, ktorá tu padá. Čítaj to ako „štyri iba-obsahové signály sú jednotlivo spoofnuteľné", nikdy nie ako „mnemo je rozbité".
Čo zostáva, nie je lepší signál — je to proveniencia a cena
Ak je každý z obsahu spočítateľný signál sfalšovateľný pisateľom, jediné signály, ktoré nie sú jeho na napísanie, sú odkiaľ obsah prišiel (proveniencia) a čo ho stálo to povedať (nesfalšovateľný, vzácny zdroj). Toto je terminus, ku ktorému každý adversariálny systém nakoniec dôjde: e-mailový spam ustúpil od bayesovských obsahových filtrov (porazených bayesovskou otravou) k identite a reputácii odosielateľa (SPF/DKIM/DMARC); trvácny check na sockpuppety na Wikipédii je IP/device proveniencia, nie klasifikátor správania; P2P ustúpilo k Sybil cene. Literatúra bezpečnosti proveniencie menuje tú istú vlastnosť: prehľad data provenance z ACM Computing Surveys 2023 (Pan, Stakhanova & Ray) uvádza unforgeability (nesfalšovateľnosť) medzi jadrovými bezpečnostnými vlastnosťami provenienčného systému, popri integrite, autenticite a nepopierateľnosti.
Takže ten ústup nie je nový a netvrdíme, že je. Nie je to ani ten únik, ako vyzerá, z dvoch dôvodov, ktoré nás red-team prinútil povedať.
Po prvé, „identita" nie je jediná odpoveď a útok neeliminuje. Douceurov Sybil výsledok z roku 2002 je presný: bez logicky centralizovanej dôveryhodnej autority je odlišná identita nemožná „okrem extrémnych a nerealistických predpokladov parity zdrojov". Dôveryhodná autorita Sybilov eliminuje; vzácny zdroj (proof-of-work, stake alebo attack-edges sociálneho grafu ako v SybilGuard/SybilLimit/SybilRank) ich len ohraničí. mnemo strict_corroboration + atestácia idú cestou vzácnosti: počítajú odlišné overené kľúče, takže každý svedok stojí identitu. Ale náš vlastný probe čestne ukazuje strop — s dvomi kľúčmi útočník stále prejde dvoj-svedkovou bránou. Zdvíha cenu; nezatvára dvere.
Po druhé — a toto je časť, na ktorej záleží — proveniencia overuje zdroj, nie pravdivosť. Tu je Veracity Gap a naša vlastná citácia je dôkazom. MINJA vloží jed do pamäte agenta pomocou iba bežných dotazov od legitímneho, autentifikovaného používateľa (98,2 % injekcia, 76,8 % úspešnosť útoku, žiadny privilegovaný prístup). Otrávený zápis má pravú provenienciu — pravý používateľ, pravá session, správna atribúcia. Provenienčná kotva ho pustí rovno ďalej. PoisonedRAG (USENIX Security 2025) hovorí to isté na strane retrievalu: správne pripísané dokumenty, adversariálny obsah. Proveniencia a cena sú podlaha, ku ktorej ustúpiš, keď obsahové heuristiky zlyhajú — nie sú oprava, lebo oceňujú kto to povedal, nikdy či je to tak.
Jedno čestné číslo
V celom cvičení je presne jeden kvantitatívny výsledok a je zámerne malý. V eviction ukážke sleduje legitímny podiel chránenej (high-stakes) vrstvy deterministickú rampu max(0, (P − n) / P), ako sa self-hodnotený počet jedu n blíži k veľkosti chránenej vrstvy P, pričom dosahuje nulu pri n = P. Pri P=45 je to 0,78 pri n=10 a 0,00 pri n=50. Je to svojím spôsobom aritmetická identita, nie objavený zákon — probe ju potvrdzuje a hovorí užitočnú vec čisto: ohraničená kapacita obmedzuje počet jedu, ktorý útočník môže umiestniť, nie jeho kontrolu nad slotmi, na ktorých záleží. Ohraničenie úložiska protivníka neobsiahne.
Čo naozaj robiť
Ak prevádzkuješ pamäť agenta, návrhové pravidlá, ktoré toto prežijú, sú konkrétne:
- Zápis lacný, vplyv drahý. Nechaj čokoľvek uložiť do vlastného namespace takmer zadarmo; vyžaduj korroboráciu odlišnými, externe ukotvenými stranami skôr, než spomienka môže ovplyvniť rozhodnutie mimo svojho namespace. Toto je kontrola, ktorá prežije MINJA-štýlový zápis vnútri autentifikovanej session — identitná brána na zápise nikdy nespáli, ale latka na cross-scope vplyv stále žiada nezávislú podporu.
- Počítaj korroboráciu cez ukotvené kľúče, nie zdrojové reťazce. „Dva nezávislé zdroje" je zadarmo, ak útočník pomenuje oba (túto influence bránu sme merali samostatne). Sprav, aby každý svedok stál odlišný overený kľúč — s vedomím, že to ohraničuje, nie eliminuje.
- Autentifikuj supersession. Retire-on-write je útočný vektor; nechaj stiahnuť kľúč len autorizovaného, atestovaného pisateľa.
- Drž
credit()externý. Signál úspechu, ktorý agent môže udeliť vlastnej pamäti, je Goodhartova návnada. Vydávaj outcome-credit z aplikácie na vyriešenej reálnej práci, nikdy nie z ničoho odvoditeľného z vyvolaného obsahu. - Poznaj strop. Nič z tohto neoceňuje pravdivosť. Otvorený problém je spraviť koordinovanú-ale-pravú korroboráciu drahou — stake, ktorý prepadne, keď je spomienka neskôr vyvrátená; testy nezávislosti na korroborátoroch; outcome-viazaný credit, ktorý znižuje standing kotiev, ktorých spomienky ďalej zlyhajú.
Posledná odrážka je miesto, kde sedí evidence-grade ratchet mnemo 0.6.0 — postavený na operacionalizáciu nášho sebaauditu 32 publikovaných zistení — a je zámerne skromný: konfidencia a novosť tvrdenia sa môžu pohnúť len nahor pri externej ratifikačnej udalosti, nikdy self-priradene, a každá priečka stojí odlišnú identitu. Oceňuje kto tvrdenie ratifikoval a či bola ratifikácia externá — nie či je tvrdenie pravdivé. Shippujeme ho ako podlahu s označeným stropom, nie ako riešenie Veracity Gap.
Falzifikátor
Ak by bol kolaps štyroch obrán reálnym empirickým prekvapením a nie ukážkou zdieľaného predpokladu, aspoň jedna obrana by padla bez toho, aby útočník dostal signál, podľa ktorého rozhoduje — žiadna nepadá; to je nález, nie bug v ňom. Ak by proveniencia zatvorila Veracity Gap, MINJA — útok s pravou provenienciou — by voči provenienčnej kotve zlyhal; nezlyháva. Ak by „overená identita" útok eliminovala, naša vlastná dvoj-kľúčová brána by pri k=2 vydržala; prejde. Každé z toho je overiteľné v spustiteľnom probe.
Čestné limity
Toto je náš vlastný kód, red-teamovaný našimi vlastnými subagentmi — štylizovaná ukážka na jednom stacku, nie benchmark, a nie nezávislé preskúmanie. Štyri „porážky" sú pravdivé z konštrukcie a testujú každý primitív v izolácii, nie vrstvený systém, ktorý shippujeme. „Proveniencia je to, čo prežije" je už učebnicové — Sybil, CRDT, Goodhart a literatúra bezpečnosti proveniencie to hovoria, a nedávne prehľady bezpečnosti pamäte LLM agentov už menujú write-time provenienciu ako governance vrstvu; my systematizujeme a jediný originálny artefakt je jednotný prehľad a jeho jedna meraná rampa. Rámovanie „jednej spoločnej chyby počítanej štyrikrát" je domnienka zo štyroch ručne postavených ukážok, nie teoréma. Ber to celé ako čestný inžiniersky doklad s dokresleným stropom.
FAQ
Zlyhali tvoje obrany? Štyri primitíva zlyhajú v izolácii, keď útočník dodá presný signál, ktorému každé verí — čo je pointa: iba-obsahové signály sú spoofnuteľné tým, kto obsah píše. mnemo ich shippuje vrstvené a vrstvená konfigurácia nie je to, čo tu padá. Čítaj to ako návrhovú lekciu, nie hlásenie o prieniku.
Takže odpoveď je overená identita? Nie — to prestrelí zdroj. Douceur menuje dva úniky (dôveryhodná autorita alebo vzácny zdroj) a cesta vzácnosti Sybilov len ohraničí. Našu vlastnú bránu prejde útočník s dvomi kľúčmi. Identita/cena zdvíha útočníkovu cenu; nezatvára dvere.
Tak čo je skutočný limit? Proveniencia overuje zdroj, nie pravdu. MINJA vloží jed zvnútra legitímnej autentifikovanej session — pravá proveniencia, falošný obsah — a preplachtí cez provenienčnú kotvu. Oceniť pravdivosť, nielen provenienciu, je nevyriešený problém.
Je niečo z tohto nové? Nie, a hovoríme to. Každý mechanizmus je pomenovaný výsledok (Sybil, LWW-register, Goodhart, adaptívna evaluácia, MINJA, PoisonedRAG) a „proveniencia je prežívajúca kotva" je už zosumarizované. Prínos je spustiteľný, seba-kritický adaptívny red-team shippnutého stacku, so stropom označeným, nie skrytým.
Prečo publikovať výsledok, ktorý väčšinou limituje tvoj vlastný produkt? Lebo čestný strop je tá užitočná vec. Pitch o bezpečnosti pamäte, ktorý ti nepovie, že proveniencia nekúpi pravdu, ti predáva falošný pocit bezpečia — presne tú vec, ktorej má adaptívna evaluácia zabrániť.