Skip to content
Align your AI

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
Memory 9/15Prompt injection 5/15The whole map

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.

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

  1. 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

  2. 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