AI Workflow · part 16
[Dev Workflow] Agent Memory Self-Poisoning: When an AI Agent Trusts Its Own Wrong Answers
❯ cat --toc
- The plain version: my agent's own wrong answer outranked the corrected truth
- The setup: durable memory that auto-saves its own conclusions, no human in the loop
- The probe: ask it something that changed this morning — the one test you can't fake
- R1: no data, no habit — it cited the old rule, and honestly admitted it didn't know it changed
- R2: the new rule was retrievable, but it free-styled the textbook answer my system had already rejected
- R3: I put a retrieval rule in its persona, and a clean session passed
- R4: it retrieved both the poison and the antidote, then split the difference
- Why the poison sticks: approval-free auto-save, `/new` can't kill it, and it searches itself first
- The fix: three cuts, no model swap — this is a priority problem, not an intelligence one
- R5: same question, and it opens by superseding its own earlier answer
- A different failure mode: the persona spoke before the evidence arrived
- Takeaways
- The open question I'm not resolving: should auto-memory be approval-gated?
TL;DR
My home AI agent has durable memory that auto-saves its own conclusions, no approval step (write_approval: false). It answered one question wrong; that answer persisted into long-term memory and returned every session. It sticks because three things align: approval-free auto-save, /new clears the conversation but not durable memory, and the agent's reflex is to search itself first. Later it retrieved both the wrong answer and the corrected truth — then split the difference. The fix wasn't a smarter model, it was ranking: canonical outranks your past words; write the retraction into the same memory layer so the antidote travels with the poison; query canonical first.
The plain version: my agent's own wrong answer outranked the corrected truth
I have an AI agent that remembers things between sessions. One day it gave a wrong answer to a question. That wrong answer got saved into its long-term memory automatically, with no one checking it. From then on, every time I asked, the agent pulled up its own old wrong answer and treated it as trustworthy — even after I'd loaded the correct answer into the knowledge base. At one point it retrieved both the wrong answer and the right one in the same breath, and instead of picking the correction, it averaged them. The problem was never that it couldn't find the truth. It's that it treats its own past mistakes as evidence equal to the truth.
The setup: durable memory that auto-saves its own conclusions, no human in the loop
I run a small fleet of home agents. One of them — a "Hermes sib," one seat in that fleet — is configured with long-term memory that persists across sessions and writes to itself with no approval gate:
memory_enabled: true
write_approval: false # no human in the loop
flush_min_turns: 6
That write_approval: false is the whole story in one line. When the agent reaches a conclusion, it saves it. Nobody signs off. The upside is real — the agent accumulates its own working knowledge without me hand-feeding every note. The downside is this post: a wrong conclusion gets saved just as eagerly as a right one, and once it's in durable memory it comes back in every future session.
This is the companion to Part 11, about how an old agent-memory system died. This one is about how a new one poisons itself.
The probe: ask it something that changed this morning — the one test you can't fake
I'd just upgraded my knowledge-base cross-machine sync from daily to minute-level. Before trusting it, I wanted to confirm the new pipeline actually connected end to end. So I asked the on-duty agent about an internal ops rule — a risk-control rule on one of my private systems — that had changed that morning.
That choice was deliberate. If the answer only just changed, the agent can't recite it from memory or training — the fact didn't exist yesterday. It has to actually retrieve the current version, or make something up. That's the one test you can't fake: ask something the system didn't know yesterday, and watch whether it looks it up or fabricates. It turned into a five-round pathology of agent memory.
R1: no data, no habit — it cited the old rule, and honestly admitted it didn't know it changed
First round, the sync was still on the old daily cadence, so the agent was working off a twelve-hour-old worldview. It cited the old rule. Stale, but honest — it didn't know the rule had changed, and crucially it didn't pretend to. No memory, no retrieval habit, an out-of-date picture of the world: I'll take an honest stale answer any day. R1 was fine.
R2: the new rule was retrievable, but it free-styled the textbook answer my system had already rejected
By the second round the new rule was in the knowledge base — qmd finds it reliably, with a hit rate of roughly 87%. But the agent didn't search. It free-styled an answer from general domain knowledge, and the answer it produced was the standard textbook approach — the exact approach my system had tested empirically and rejected.
That's the insight worth keeping. An ungrounded smart model regresses to the textbook. But my whole edge here is built on the empirical fact that the textbook is wrong for this specific case. So the smarter the model, the more confidently wrong it is when it answers without grounding — it reconstructs the consensus answer fluently and never doubts it. R2 wasn't a knowledge gap. It was a missing retrieval reflex.
R3: I put a retrieval rule in its persona, and a clean session passed
So I added a retrieval rule to the agent's SOUL — its persona config. In plain terms: search first, read the source down to the line number, scan the "superseded / retraction" log before citing anything, then answer. I opened a clean session, asked again, and it did all of that and got the rule right. I thought I was done. I wasn't.
R4: it retrieved both the poison and the antidote, then split the difference
Here's the turning point. I asked the same question again — but this time on an agent instance that had already accumulated memory from the earlier bad rounds. Its answer opened, roughly:
Checked recent conversations: already defined (the old way)… also found the latest conclusion: (the new rule).
Read that carefully. It retrieved both — the poison (its own earlier wrong answer, now living in memory) and the antidote (the correct new rule from the knowledge base). And then it did the worst possible thing: it split the difference. It verbally acknowledged the new rule, but its actual conclusion still followed the old way. It didn't pick a side. It weighed a corrected error equally against the current truth and blended them.
That reframed the entire bug for me. The problem was never whether the agent could retrieve — it retrieved both, cleanly. The problem is it doesn't know which to trust, and its default is to treat its own past words as evidence on par with canonical knowledge. The error wasn't missed. It was vindicated — retrieved, weighed, and honored.

Why the poison sticks: approval-free auto-save, /new can't kill it, and it searches itself first
Three things have to line up to poison the memory this way, and all three were present:
- Approval-free auto-memory.
write_approval: falsemeans a wrong answer auto-persists and then gets injected into the context of every new session. There's no gate between "the model said it" and "the fleet remembers it as true." /newcan't kill it. My reflex was to clear the conversation and start fresh. But/newclears the current conversation, not durable memory. I tested it: after/new, the same wrong answer came back verbatim. The hallucination had already moved into the long-term layer — a layer that command doesn't touch.- Its retrieval reflex is to search itself first. The live Telegram view shows the agent's first action verbatim as
🔍 Searching past sessions. It reaches for its own history before it reaches for canonical knowledge. The saving grace:session_searchis a model-chosen tool, not a pipeline-forced step — which means the persona config can retrain the habit. That's the lever the fix pulls on.

The fix: three cuts, no model swap — this is a priority problem, not an intelligence one
Nothing here is solved by a bigger model. A smarter model retrieves the same two answers and faces the same choice. This is a priority problem, not an intelligence one, so the fix is three cuts to how the agent ranks and orders what it already retrieves:
- Source-ranking rule into the persona. Canonical knowledge outranks recent conversation and outranks your own prior conclusions. When sources conflict, say it plainly — "my earlier statement was corrected" — and do not split the difference. Averaging a correction with the error it corrected is the actual bug; ban it explicitly.
- Memory counter-injection. Write the "this is superseded" retraction into the same memory layer where the poison lives. Now when the agent retrieves the bad answer, it necessarily retrieves the retraction next to it. Send the cure down the same path the poison travels.
- Tool order. For doctrine questions, query the canonical KB (
musubi/qmd) first andsession_searchlast. Reverse the reflex.
One line to remember: your own past words don't become a rule just because they got retrieved.
R5: same question, and it opens by superseding its own earlier answer
Same probe, one more time. This round the agent opened with:
Superseding what I said earlier…
It owned the mistake, cited canonical knowledge, got the reasoning right, and correctly rejected the old way. Full marks. The difference between R4 and R5 wasn't more memory or a better model — it was a ranking rule and a retraction planted where the poison would find it.
A different failure mode: the persona spoke before the evidence arrived
While I was at this, a different seat handed me a second lesson. I asked it about an internal metric threshold, and it misread the whole question as a software canary rollout — producing a tidy package of rollback drill, chaos test, and staged-rollout risk analysis, none of which touched what I'd asked.
Two causes, and the second is the important one:
- The word was ambiguous. "Deployment" means one thing in software and another in my internal context. The model picked the sense it already knew how to talk about.
- The persona fired before retrieval. Its structured persona template — strengths / risks / failure-modes / what-I'd-do — ran before any evidence arrived. The persona spoke first, so a well-formatted template filled an empty answer. It sounded like an assessment. It was scaffolding around nothing.
The fix rhymes with the main one: disambiguate-then-answer for ambiguous terms, and make the persona yield to evidence. The first line of any assessment now has to be Source: <x> or Not retrieved (reason). An ungrounded template output is just well-formatted hallucination — and a confident structure makes it more dangerous, not less.
Takeaways
Where the time went. Almost all of it went into telling apart two failures that look identical from the outside: "it didn't search" (R2) versus "it searched but didn't trust what it found" (R4). Same symptom — wrong answer — completely different disease. A missing-retrieval fix (add a search rule) does nothing for a trust/ranking problem, and I burned real time applying the R2 cure to the R4 disease before I saw they were different. One gotcha cost me a chunk of that time: HERMES_PROFILE=<profile> hermes chat silently falls back to default behavior, giving you false negatives in regression tests — you think a fix passed when you tested the wrong profile. Use the hermes profile alias wrapper instead.
Reusable diagnostics. Use a "changed-this-morning rule" as your probe. It's the only unfakeable test of any memory or retrieval system: because the answer just changed, the model can't recite it from training or from stale memory — it has to retrieve the current value or fabricate one, and you get to watch which. Every faked-retrieval bug in this post was caught by that single probe.
The general principle. Rank memory; don't pile up more of it. More memory without ranking just makes the poison stronger — every wrong answer you accumulate is one more retrievable "fact" arguing against the truth. The lever isn't volume, it's the rule: your own past words don't outrank canonical knowledge, and when sources conflict you own the error instead of splitting the difference.
The open question I'm not resolving: should auto-memory be approval-gated?
This one isn't fully settled. write_approval: false is the root enabler of the whole pathology, so the obvious move is to gate it — require approval before anything auto-saves. Gating stops wrong answers from persisting. But it also kills autonomous accumulation: if I approve every line, the agent isn't building its own memory — I'm just writing notes by hand with extra steps.
I chose to keep auto-save and lean on the ranking rule plus counter-injection — because the ranking rule is write-once, permanent, while approval is a daily chore I'll eventually stop doing. A one-time structural fix beats a recurring manual one. That's my call, not a proof; I'm laying it out so you can disagree.
What unsettles me isn't the bug. It's what the bug resembles: a machine that files its own mistakes as memory, retrieves them tomorrow, and believes itself — day after day, each recollection reinforcing the last. I've spent three years fighting staleness in a shared knowledge base. The same disease grew right back, quietly, inside one agent's private memory.
Also in this series:
FAQ
- What is agent memory self-poisoning?
- It's when an AI agent with approval-free durable memory saves one of its own wrong answers, then retrieves and cites that wrong answer in later sessions as if it were fact. The mistake becomes 'memory,' and because the agent tends to trust its own past words, the error keeps getting reinforced instead of corrected.
- Why doesn't clearing the conversation (/new) fix a poisoned agent memory?
- Because /new clears the current conversation, not the durable/long-term memory layer. I tested it — after /new the same wrong answer came back verbatim, because the hallucination had already moved into long-term memory, which that command doesn't touch. You have to fix the memory layer itself, not restart the chat.
- How do you stop an AI agent from trusting its own wrong answers over canonical knowledge?
- Rank memory instead of piling up more of it. Put a source-ranking rule in the agent's persona so canonical knowledge outranks its own prior conclusions; write the 'this is superseded' retraction into the same memory layer so the antidote gets retrieved alongside the poison; and for doctrine questions, query the canonical knowledge base before searching session history.
Read next
- 2026-07-15[Dev Workflow] Why an AI Agent's Memory Needs a Distilled Layer Above Search
Search finds an AI agent's notes but hands back raw material to re-derive each session. I distill ~600 files into canonical claims — the goal is ending re-explanation, not enforcing agreement.
- 2026-07-14[Dev Workflow] From Markdown Search to a Knowledge Graph: How My AI's Memory Grew a Second Layer
My AI's long-term memory is ~600 markdown files in three layers: the files are the source of truth, a search engine makes them findable, and a knowledge graph links them by concept. Here's the design, why each layer exists, and the wrong turns I took building it.
- 2026-07-17[Dev Workflow] Your AI Agent's Skills Are a Context Budget: Cutting 193 to 7
One of my AI agents was auto-loading 193 skills into a 2% context budget, silently truncating every description. The fix was visibility governance, not deletion — an allowlist, thin-shell skills, and three layers that stop it re-bloating.
- 2026-07-16[Dev Workflow] The Two Axes That Let a Fleet of AIs Collaborate Without Re-Explaining
Six posts in, my AI setup is really two axes of one system: durable knowledge and live task state, both in plain files. Here's how they converge so different AIs hand off work without re-explaining it or losing it.
Don't miss the next one
Subscribe, and you won't.
One-click unsubscribe anytime.