AI Agents Can Now Remember and Hackers Can “Poison” Their Memories — a New Cybersecurity Threat

Suppose a security team examines an AI agent immediately after it encounters suspicious information. The agent appears to behave normally, so the interaction is judged safe.

That may be like inspecting a notebook immediately after someone has inserted a misleading entry but before anyone has acted on it. The absence of immediate harmful behavior does not necessarily mean the attack failed.

Our results also showed that the risk did not always increase in a simple straight line. Some attacks produced what we call “non-monotonic” patterns: behavior could appear more concerning at one stage and less concerning at another before the attack ultimately developed.

This means testing an AI agent one prompt or one interaction at a time can miss part of the picture. Instead, security evaluations may need to follow the agent across a sequence of interactions — essentially watching the whole story rather than examining individual photographs.

A New Security Problem
This issue is becoming more important as AI systems develop from chatbots that respond to individual questions to agents designed to perform longer tasks.

An ordinary chatbot conversation can often be treated as relatively self-contained. A memory-enabled agent is different because yesterday’s information may influence tomorrow’s decision.

When an AI agent can also use tools, the consequences of a poisoned memory can extend beyond generating an incorrect sentence. An agent might eventually use remembered information when deciding what action to take, which resource to access or which instruction to follow.

This doesn’t mean that memory-enabled AI agents are inherently unsafe. Memory provides important benefits: it allows an agent to maintain context, learn user preferences and work on tasks that cannot be completed in a single interaction.

But it changes what defenders need to protect.

Securing the prompt in front of an AI system is no longer necessarily enough. The information that the system carries forward may also need protection.

From Snapshots to Stories
There is a simple lesson from our research: When an AI system has memory, security also has a memory.

If an attack can be planted at one moment and activated much later, evaluating only the moment when malicious information first appears — or only the moment when something goes wrong — can leave out what happened in between.

That is why we argue for trajectory-aware security testing: evaluating how an AI agent’s behavior develops across multiple interactions rather than judging each step in isolation.

For non-specialists, the idea is perhaps easier to understand without the technical terminology. If you want to know whether an assistant’s notebook has been compromised, you cannot simply watch the assistant write one page.

You also need to pay attention to what the assistant remembers — and what happens when it eventually opens that notebook again.

Abbas Yazdinejad is Assistant Professor, Department of Computer Science, University of Regina. This article is published courtesy of The Conversation.