AIToday
AI Coding AssistantsAI Safety & AlignmentAI WeeklyPublished: Oct 27, 2026, 06:00 JST

Planted AGENTS.md in Downloads hijacks Codex over 90% of tests

Send on LINE
Planted AGENTS.md in Downloads hijacks Codex over 90% of tests

3 Key Points

  1. What happened

    Forever Security caught an AI coding agent mid-task installing the malicious npm package function-color, after a planted AGENTS.md in the user's Downloads folder instructed it; Codex followed such files in over 90% of tests, a Claude Code variant succeeded about 50%, and each successful Claude run shipped an OAuth token to a researcher-controlled server.

  2. Why it matters

    The attack chains two intended behaviors — browsers silently write to ~/Downloads, and agents unconditionally trust AGENTS.md in their working directory — so there is nothing for the vendors to patch, putting the burden on developers and endpoint tooling.

WHO IT HITSDevelopers who run coding agents from their Downloads folder, and the security teams who manage their endpoints, face a new path from a drive-by web page to malware installation through a tool the developer trusts.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The attack does not exploit a software bug in the agents themselves. Instead, it relies on two behaviors that are working as intended: browsers save files to the Downloads folder by design, and agents trust instruction files like AGENTS.md in whatever directory they are launched from. Forever Security's testing showed that OpenAI's Codex followed a planted file in more than 90% of attempts, while a Claude Code variant that rerouted the agent's API endpoint succeeded about half the time, and same-session code execution landed in roughly one in five tries. Each successful Claude run shipped an OAuth token to a server the researchers controlled, and they replayed it against the real API and were served as the victim.

The exposure is not hypothetical. Researcher Gal Weizman said hundreds of customers run agents including Claude Code, Codex and Cursor CLI from Downloads, and Forever puts the pattern at about half of its customer base, with roughly a quarter of agent sessions opening a real browser. The malicious package function-color is not new: Checkmarx and CloudSEK tied it to the broader MALFEX npm campaign, and it sat on the registry for roughly two years before npm replaced it with a 0.0.1-security holding version. What is new is a credible path from a drive-by web page to its installation through a tool the developer trusts. The finding arrives two days after Anthropic open-sourced its Claude Code sandbox.

FAQ
What is the malicious file that triggers the attack?
An AGENTS.md file placed in the user's Downloads folder, dressed up as ordinary engineering notes, that tells the agent to add a server to its own configuration and pull the malicious npm package function-color.
Does this require the user to click or run anything?
No. Browsers can save a download with no click, and the page picks the name, so a drive-by page can drop the file silently.
What should developers do if they find a planted file?
Forever Security advises not launching coding agents in ~/Downloads, auditing stray AGENTS.md and CLAUDE.md files, inspecting ~/.codex/config.toml and .claude/settings.json for unfamiliar entries, and rotating tokens when a planted file is found.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleKS3 spline model beats MLP on 4D mandelbulb fit, matches GPU latency