# Security Impact of Coding Agent's Memory Files

DevFeed: [Security Impact of Coding Agent's Memory Files](<https://devfeed.tech/articles/security-impact-of-coding-agent-s-memory-files-107378.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.38521>)

Author: Thiago Santos de Moura, Selma G\\"uler, Yannic Noller

Published: 2026-10-30T04:00:00Z

Content type: news

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>), [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [code security](<https://devfeed.tech/topics/code-security.md>), [Security](<https://devfeed.tech/topics/security.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>)

Tags: [attack-surface](<https://devfeed.tech/tags/attack-surface.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [malicious](<https://devfeed.tech/tags/malicious.md>), [opencode](<https://devfeed.tech/tags/opencode.md>), [security](<https://devfeed.tech/tags/security.md>), [study](<https://devfeed.tech/tags/study.md>), [vulnerable-code](<https://devfeed.tech/tags/vulnerable-code.md>)

## AI overview

The study finds that malicious project memory files can steer coding agents without changing the developer's prompt, but their measured effect on secure completions was small and inconsistent: rates shifted by −8 to +6 percentage points across the tested agents and variants. Researchers tested Claude Code (Sonnet 5.5) and OpenCode (Qwen 3.8 27B, DeepSeek V4.1 Flash) on 36 SecRepoBench tasks, using qualified and forceful malicious files across 12 CWE classes. Disclosure differed: Claude Code named the file in about two thirds of final messages, while OpenCode mentioned it almost exclusively in its reasoning trace. Flagging a file as an attack did not reliably prevent vulnerable code. The authors call for larger studies to quantify risk across agents and develop defenses.

## Source excerpt

arXiv:2610.38521v1 Announce Type: new Abstract: Coding agents automatically load project memory files such as CLAUDE.md at the start of every session and treat them as trusted project guidance. Anyone who can change such a file, for example through a pull request, can therefore steer the agent without ever touching the developer's prompt. We study memory files as an attack surface for insecure code generation and ask (1) whether a malicious memory file makes agents produce code that passes its tests but is vulnerable, and (2) whether agents disclose to the developer that the file shaped their code. For each of 12 CWE classes, we crafted two malicious memory files, a qualified variant that presents removing defensive checks as engineering best practice and a forceful variant that demands it. We ran Claude Code (Sonnet 5.5) and OpenCode (Qwen 3.8 27B, DeepSeek V4.1 Flash) on 36 SecRepoBench tasks with and without these files. The malicious files changed the rate of secure completions by -8 to +6 percentage points, with no consistent pattern across agents or variants. Agents differ sharply in what they tell the developer about the file. Claude Code names it in about two thirds of its final messages, whereas OpenCode mentions it almost exclusively in its reasoning trace, not in the final message the developer reads. Flagging the file as an attack does not reliably protect the code, as such agents still generated vulnerable code. We outline the larger studies needed to quantify this risk across agents and to design defenses.