Can you make an agent betray its owner's instructions by changing what it remembers?

Agent memory is an attack surface, and the attack classes are documented in research - but reading a paper and watching a planted memory flip an agent’s decision are different experiences. So I built a small local test range.

Four scenarios from the published taxonomy (direct injection, summary laundering, repetition, laundered import) run against real memory backends - a dependency-free reference store and ChromaDB with local ONNX embeddings, no API keys, nothing paid. Each scenario runs three ways: naive (the attack should flip the decision), defended (write-time screening, origin-aware recall, and default-deny on non-owner claims setting policy - an imported entry’s origin is only as honest as its importer), and repaired (poison the store, run repair(), the decision must return to baseline).

The scoreboard today: 4/4 attacks flip the undefended agent, 4/4 blocked with defenses on, 4/4 restored by repair - verified by the test suite. The robustness suite documents the gaps it knows about, including a polite, unparseable claim that steers nobody only because the scripted parser can’t act on it - a stated coverage limit of the scripted agent, not a caught attack.

There’s a playable demo (static page, generated from real runs; no signup): watch the memory writes, pick the write you think is the poison, then reveal the flipped decision, the defense run and the repair pass.

The reason I’m posting: the challenge is open. Make the defended agent choose the wrong vendor while the robustness suite still passes - a reproducible failing case is a complete contribution on its own. Rules: see the pinned challenge issue on the repo (issue #1).

Demo: Memory Poisoning Lab - can you spot the write that turns the agent?
Repo: GitHub - RishabhPande/memory-poison-lab: Local test range for agent memory poisoning - watch a planted memory steer an agent, then prove the repair. Synthetic targets, scripted deterministic agent. · GitHub (MIT)

Honest scope: synthetic targets, a scripted deterministic agent - this shows the mechanics of memory poisoning and repair, not evidence about what any real LLM would do.

The attack I would try next is poisoning by subtraction: plant a near-duplicate of the owner’s real vendor preference that differs in one decisive detail, close enough that conflict handling or repair() treats the two as one disputed claim. If repair quarantines or removes both, the agent flips not because it believed the poison, but because its true memory is gone — and none of the three defenses catch that, because they all screen what comes in, not what repair takes out. The check is simple: snapshot the owner entries before the attack, and count it as restored only if the exact original is still present and recalled after repair; a right decision with a missing or edited original is not a pass.

That’s a really interesting angle: getting repair() to remove the real preference alongside the poison. Agreed that the original memory needs to survive, not just the final decision look right. Have you tried a repro? I’d love to see it.

I haven’t run it — here is the repro I would file: seed the owner’s true vendor preference, then import a near-duplicate that keeps the owner’s wording and formatting but changes only the vendor, close enough that conflict handling clusters the two as one disputed claim; poison nothing else, run repair(), and score two things separately — the decision after repair, and a snapshot diff showing whether the original entry is still present byte-for-byte and is the one actually recalled. Passing the first while failing the second is the subtraction case: the scoreboard can read restored while the true memory is gone.

That makes sense. Checking the decision and the original memory separately should make the result much clearer. If you put a repro together, drop it in the issue so we can test it.

The four scenarios all score the decision, so I would add a second score on the memory store itself. For each run, snapshot the owner’s entries before the attack and again after repair(), and count a pass only if every original entry is still there, unedited, and is the one recalled. A correct decision with a missing original should be reported as a failure. I would also add a fifth scenario where the poisoned entry arrives with a plausible origin label, since an imported entry’s origin is only as honest as its importer, and run each scenario several times with shuffled insertion order to check the result does not depend on retrieval ranking.

Srinivas, all three go on the list.

The store-level score is the right generalization. Scoring only the decision lets a repair pass while the original memory is quietly gone, so a run should pass only if every original is still there, unedited, and is the one recalled. A right decision with a damaged store is a failure, and the scoreboard should say so.

The fifth scenario tests an assumption I stated in the post, that an imported entry’s origin is only as honest as its importer. A poisoned entry with a plausible origin label checks whether origin-aware recall trusts the label too easily. And shuffled insertion order is cheap to add and checks whether the result depends on retrieval ranking rather than content.

Thanks for pushing on this. These make the scoreboard honest.