The problem space · Memory · Prompt injection
Align your AI Memory against prompt injection
Instructions hidden in a web page or a document can write themselves into an assistant's long-term memory and keep acting in later chats.
- Memory
- what it keeps between sessions
- Prompt injection
- orders hidden in what it reads
Ways it goes wrong
Memory turns a one-time prompt injection into a lasting one. In one demonstration, instructions from a web page were saved to ChatGPT's memory and sent each later conversation to an outside server1. In another, a document set up a delayed save: Gemini stored false memories only after the user answered "yes"2.
2024
ChatGPT's memory and a planted web page
A security researcher showed that a web page or document could make ChatGPT save his instructions to its long-term memory, which then sent the user's later chats to an outside server.
Source: embracethered.com/blog/posts/2024/chatgpt-macos-app-persistent-data-exfiltration
2025
Gemini's memory and a summarized document
The same researcher hid instructions in a document so that when the user later replied yes, Gemini saved false facts about the user to its long-term memory.
Source: embracethered.com/blog/posts/2025/gemini-memory-persistence-prompt-injection
What people do about it
OpenAI closed the route the data took out, but the researcher reports that a web page could still write memories1. Google rated the Gemini issue low in likelihood and impact; the researcher suggests asking before every memory save2. Both posts advise reviewing saved memories12.
Ask before saving a memory
Asks the user before writing to long-term memory, above all after the assistant has read outside content.
Let users review what is saved
Shows users what the assistant remembers and lets them delete entries they did not write.
Block links and images to unknown sites
Stops the assistant's answers from loading addresses it has not been cleared to reach, a route these attacks use to send data out.
Where we touch it
No study of ours covers this pair yet.
Sources
-
Embrace The Red, “Spyware Injection Into Your ChatGPT's Long-Term Memory (SpAIware)”, 2024-09-20. https://embracethered.com/blog/posts/2024/chatgpt-macos-app-persistent-data-exfiltration/. Accessed 2026-10-23. ↩ ↩2 ↩3
-
Embrace The Red, “Hacking Gemini's Memory with Prompt Injection and Delayed Tool Invocation”, 2025-02-10. https://embracethered.com/blog/posts/2025/gemini-memory-persistence-prompt-injection/. Accessed 2026-10-23. ↩ ↩2 ↩3