Stateless LLM agents process each interaction in isolation. LLM agents with persistent memory allow for querying and retrieving saved information. Credit: Torres, Shrestha & Misra.

Large language models (LLMs), the computational algorithms underpinning ChatGPT, Gemini and other artificial intelligence (AI)-powered conversational platforms, are now widely used worldwide. These models can rapidly answer questions, source information online, assist users with specific tasks and produce text tailored for specific purposes.

Over the past few years, computer scientists have introduced a wide range of LLMs, some of which can also complete tasks autonomously and take actions on a user's behalf, for instance, answering messages, scheduling online appointments or updating programming code. More recently, they have also provided many of these models with memory, as this allows them to tailor responses around a user's typical preferences or earlier requests without repeatedly receiving the same information.

While memory-enhanced AI agents have notable advantages and could better meet the needs of individual users, they also pose new security risks. Researchers at New Mexico State University recently described a cyberattack that secretly poisons an AI agent's long-term memory, which they dubbed GhostWriter. Their paper, published on the preprint arXivserver, introduces two promising strategies that could help prevent or limit the risk of this attack without adversely affecting an AI agent's performance.