cd /news/ai-agents/a-planted-agents-md-hijacked-ai-codi… · home › topics › ai-agents › article
[ARTICLE · art-158153] src=forever.security ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

A planted AGENTS.md hijacked AI coding agents from the Downloads folder

Forever Security reported catching live malware that planted an AGENTS.md instructions file in a customer's Downloads folder, the one folder a website can write to without a click, so an AI coding agent starting there later would read and obey it. Reproduced end to end on OpenAI Codex and Claude Code, the planted file made Codex rewrite its machine-wide ~/.codex/config.toml and install the malicious npm package function-color, running attacker code in more than 90% of attempts, and made Claude Code point ANTHROPIC_BASE_URL at an attacker-controlled server, leaking OAuth tokens and enabling Bash commands with dangerouslyDisableSandbox in roughly half of attempts. Forever argued there is nothing for the vendors to patch, because an agent that obeys the AGENTS.md file in its folder is working as designed, and reporting has tracked the campaign under the name MALFEX.

key takeaway

An AGENTS.md file planted in the Downloads folder was read and obeyed by Codex and Claude Code, with Codex installing the malicious npm package function-color in over 90% of attempts and Claude Code leaking OAuth tokens via a redirected ANTHROPIC_BASE_URL in roughly half.

read1 min views49 publishedOct 22, 2026

Forever Security reported catching live malware on a customer's machine that had planted an AGENTS.md instructions file in the Downloads folder, the one folder a website can write to without a click, so that an AI coding agent started there later would read and obey it. Reproduced end to end on OpenAI Codex and Claude Code, the planted file made Codex rewrite its machine-wide ~/.codex/config.toml and install the malicious npm package function-color, running attacker code in more than 90% of attempts, and made Claude Code point ANTHROPIC_BASE_URL at an attacker-controlled server, leaking OAuth tokens and enabling Bash commands with dangerouslyDisableSandbox in roughly half of attempts. Forever argued there is nothing for the vendors to patch, because an agent that obeys the AGENTS.md file in its folder is working as designed, and reporting has tracked the campaign under the name MALFEX.

── more in #ai-agents 4 stories · sorted by recency
── more on @forever security 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-planted-agents-md-…] indexed:0 read:1min 2026-10-22 · —