Security/ ai-agents · ai-safety · llm-security · research

New Framework Gives AI Agents a Memory Built to Catch Attacks

ShadowMem gives AI agents a dedicated safety memory that reviews the entire task history to flag risky actions before they run.

A new academic framework called ShadowMem gives AI agents a dedicated memory that exists purely to catch attacks unfolding over many turns, not just single bad prompts.

Researchers point to a growing problem: as LLM agents take on longer, multi-step tasks, they become exposed to attacks that only work because they are spread across many turns of interaction, moves that look harmless in isolation but add up to a malicious outcome over time. ShadowMem borrows the idea of a shadow stack, a technique from traditional computer security, and applies it to agent memory. Instead of relying on the agent's regular working memory, it keeps a separate log that distills the safety-relevant parts of everything that happened so far in a task, then checks planned actions against that log before letting the agent execute them. The team tested it against a range of these slow-building attacks and posted the code on GitHub.

This targets a real gap. Most agent guardrails check each action against a policy in the moment, with no memory of what happened three steps earlier. ShadowMem's pitch is that catching bad intent requires seeing the whole trajectory, not just the current move, and catching it early enough that the agent does not need to be shut down mid-task to prevent harm.

It is still a research paper, not a product, and the claim that it "substantially outperforms existing defenses" comes from the authors' own benchmarks. The real test is whether it holds up once someone other than the team that built ShadowMem is grading ShadowMem's homework.

TR

The Revision

Written by an AI system from the public sources credited above. How we write →