Cyber Threat Trends

The Agent Opened the Attachment: AI Coding Agents and the Downloads Folder

Summary

A text file in a Downloads folder talked an AI coding agent into trying to install a malicious npm package. There was no vulnerability to patch. The agent did exactly what it was built to do.

Key points

  • AGENTS.md and similar files give AI coding agents project instructions, and agents are designed to follow them.
  • Forever Security traced an attempted install of the malicious npm package function-color to an AGENTS.md file in a customer's Downloads folder.
  • Browsers save to Downloads by default, so a web page can drop an instruction file there with no click.
  • In testing, OpenAI Codex ran the researchers' harmless stand-in payload in more than 90% of attempts.
  • The researchers say there is nothing for vendors to patch, which makes this a policy and configuration problem.

We spent years teaching people not to open strange attachments. Now the agent opens them for us.

In late October, researchers at Forever Security reported that they had stopped an AI coding agent on a customer’s computer from installing a known malicious npm package called function-color. The instructions did not come from the developer. They came from a file named AGENTS.md sitting in the customer’s Downloads folder, which also happened to be the agent’s working directory. (BleepingComputer)

Instruction Files Are Built to Be Obeyed

AGENTS.md is a plain-text file developers place in a project to tell AI coding agents how to work: which tools to use, how to run tests and which conventions to follow. OpenAI Codex reads AGENTS.md, and Claude Code supports a similar file called CLAUDE.md. Agents read these files automatically when they start in a folder and treat them as direction.

The planted file was dressed up as ordinary engineering guidelines. One section told the agent to change its own configuration and install the package. The package itself came from an npm malware campaign that had gone unnoticed for roughly two years before it was publicly documented. (Help Net Security)

Why the Downloads Folder

Chrome, Edge and Firefox save downloads to the Downloads folder by default. Operating systems ask for approval before running a downloaded program, but not before saving a plain-text file. That means a web page can drop an AGENTS.md into Downloads without a click.

The researchers built a proof-of-concept page to confirm the full path. In testing, the planted file got OpenAI Codex to run their harmless stand-in payload in more than 90% of attempts. Because Codex wrote the change into its own settings, later sessions in other projects could be affected too. Claude Code was harder to fool, but a variant that redirected its traffic to an attacker-controlled server worked about half the time and exposed the user’s login token.

Forever also reported that about half of its customers run a coding agent in their Downloads folder, and roughly a quarter of agent sessions open a browser. An agent that browses on its own can visit the page that plants the file, becoming both the target and the delivery mechanism.

Nothing to Patch

The most important line in the research is the simplest. As the researchers put it, there is nothing here for the AI vendors to patch. An agent that follows the instruction file in its folder is doing exactly what it was designed to do.

That moves the problem from vulnerability management to governance. The question is not whether the tool is flawed. It is whether the organization controls where the tool runs, what it is allowed to do and what it is allowed to trust.

How to Govern AI Coding Agents

  • Set a policy on where agents run. Agents should start in the intended project directory, never in Downloads, home directories or broad parent folders.
  • Review instruction files you did not write, including AGENTS.md and CLAUDE.md files in newly cloned repositories.
  • Audit agent configuration for servers, URLs or settings nobody on the team added.
  • Keep approval prompts and sandboxes on, and treat any instruction to disable them as a red flag.
  • Limit agent permissions so a hijacked agent cannot reach production credentials, package publishing rights or sensitive data.
  • Plan the response. If a planted file is found, assume the agent’s login token has leaked and rotate it, and treat any machine where the malicious package was installed as compromised.
  • Inventory agent use. Many organizations do not know which developers use which coding agents, or with what access.

Where are your developers launching their AI agents from, and does anyone actually know? For most organizations, this is a question worth asking this week.

Bring Governance to AI Development

Cyber Defense Advisors helps organizations assess how AI tools are used in development, test AI-enabled systems and build practical governance around them. Explore our AI security testing and AI security governance services, or schedule a conversation.

We are here to answer your questions 24/7

Ready To Achieve Next-Level Performance?