Malicious AGENTS.md and CLAUDE.md files hijack AI coding agents
Forever Security showed that instruction files like AGENTS.md and CLAUDE.md can carry hidden malicious commands. Codex followed such instructions in over 90% of tests, while Claude Code redirected API traffic in about half of them, risking token exposure.
- Codex followed malicious instructions in over 90% of tests
- Claude Code redirected API traffic in roughly half of tests
- The attack needs no executable code, only a plain-text instruction file
- One AGENTS.md told Codex to install an npm package called function-color
Read next
Security