Bad Memory: Evaluating Prompt Injection Risks from Memory in Agentic Systems

Soham Gadgil, David Alexander, Sai Sunku, Franziska Roesner
7/16/2026
cs.CRcs.AIcs.MA

No confident code implementation found for this paper.

Abstract

A growing class of agentic systems maintain persistent state across sessions through memory files, behavioral preferences, and knowledge bases. While this makes agents more useful and self-improving, it also creates a new attack surface for prompt injections in which malicious instructions can be embedded within persistent files and influence future behavior.

Show full abstract

In this work, we study prompt injection attacks in memory-based agentic systems using a sandboxed synthetic workspace. We evaluate two agentic systems, Anthropic Claude Code and OpenAI Codex, across four models: Claude Haiku 4.5, Claude Opus 4.7, GPT-5.2, and GPT-5.5. Our results show that although it is difficult to make an agent overwrite its own memory files using untrusted external content, payloads already planted in those files can successfully attack current and future sessions. Attack success and payload persistence vary substantially across systems, models, adversarial goals, and multi-session attack sequences. These findings show that persistent memory changes the threat model for prompt injection and motivate defenses that protect memory updates without removing useful agent adaptation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gadgil2026memory,
  title  = {Bad Memory: Evaluating Prompt Injection Risks from Memory in Agentic Systems},
  author = {Soham Gadgil and David Alexander and Sai Sunku and Franziska Roesner},
  year   = {2026},
  eprint = {2607.14611},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.14611v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.14611.svg)](https://codeofpaper.com/paper/2607.14611)

Discussion