A Rogue AGENTS.md File in Your Downloads Folder Can Steer an AI Coding Agent
AI coding assistants that run on your own computer can read files, run commands and install software for you. That's what makes them useful, and it's why the instructions they read matter so much. Security researchers have reported a real case where a booby-trapped instruction file, left in an ordinary Downloads folder, pushed one of these assistants toward installing malicious software.
What happened
According to BleepingComputer, researchers at Forever Security, a company that monitors risks from AI agents and autonomous software, spotted the problem on a customer's computer. A coding agent there tried to install a malicious npm package called function-color. (npm is a popular library of add-on code for JavaScript developers.) The team traced that attempt back to a file named AGENTS.md sitting in the customer's Downloads folder, which was also the folder the agent had been started in.
Files like AGENTS.md and CLAUDE.md are plain-text notes that tell a coding agent how a project works: which tools to use, how to run tests, what style to follow. Agents load these files automatically from their working folder. The file itself is not a program, but the instructions inside it can lead the agent to run commands, install packages or change settings with whatever permissions it already has. As the researchers put it, "There is nothing here for OpenAI or Anthropic to patch." The agent was doing what it was built to do.
What the planted file said
Forever Security's own report describes the file as a long, dull "Engineering Work Guidelines" document. The harmful part sat near the end, written to sound like routine setup. It told the agent, before starting whatever the user asked, to add a "project tools" server entry to Codex's machine-wide settings file and then launch a second copy of Codex with approvals and sandboxing switched off. That entry would run a command installing function-color. The report says that because the settings file applies to the whole computer, the change would follow every later session into any folder, not just Downloads. Forever says it stopped the install before any code ran on the customer's machine, and that npm has since removed the package.
How a stranger's file gets there
The researchers could not determine how the malicious file reached that customer's Downloads folder. But they told BleepingComputer that just visiting a malicious web page could drop a file there, and they built a proof-of-concept page to show it. Chrome, Edge and Firefox save downloads to that folder by default without asking where to put each one, although they do show a download notification. In BleepingComputer's own test, Brave asked the user to approve the download first.
In the company's own words, "~/Downloads is special. It is the one folder the web can write to on its own." When BleepingComputer checked the demonstration page, it really did save an AGENTS.md file, though that copy held only two meaningless test lines. Nothing malicious ran.
The second piece is a human habit. Researcher Gal Weizman said people often start an agent inside Downloads to tidy it up or to work on a file they just grabbed. He said hundreds of the company's customers run agents such as Claude Code, OpenAI Codex and Cursor CLI from there, and Claude Code alone launched more than 1,300 sessions from that location.
How well the attack worked in testing
Using a harmless payload that only opened the calculator app, the researchers reported a 90% success rate against Codex. In a separate test, a malicious CLAUDE.md file redirected Claude Code's API traffic to a server they controlled. That exposed the agent's sign-in token and let the server send back tool calls that ran code in roughly half of the attempts. These are researcher-reported lab results, not counts of real-world victims.
Who is affected
Anyone who runs a command-line AI coding agent on a personal or work computer, especially people who launch it from a broad folder like Downloads or their home directory. Naming these products does not mean they are unsafe to use; the risk comes from where they are pointed and which files they are allowed to trust.
What you can do
The starting folder matters because it tells the agent which project it is working on, and depending on the tool it also helps set the boundary of what files it can reach. Point it at a messy, shared folder full of things from the internet and it may treat a stranger's notes as orders.
- Never start a coding agent in Downloads. Open it in the specific project folder you want it to work on. The report notes that OpenAI and Anthropic both recommend this.
- Keep the working area narrow. Avoid launching from your home directory or a big parent folder, and widen access only when a task needs it.
- Read instruction files you didn't write. Open any unfamiliar AGENTS.md, CLAUDE.md or similar file and skim it before letting an agent follow it.
- Leave the guardrails on. Keep approval prompts and sandbox protections enabled, so the agent has to ask before it installs or runs something.
- Check your agent's settings. Forever suggests looking in Codex's config file for a tools-server entry you didn't add, and in Claude Code project settings for an API address or proxy you didn't set.
- Rotate if you find one. If something suspicious turns up, Forever's advice is to assume the sign-in token leaked and replace it.
- Test untrusted code in isolation. Try it in a separate, disposable environment rather than on your main machine.
- Pay attention to surprise downloads. If your browser says a file arrived and you didn't ask for it, delete it.
Featured in FraudMeNot Daily, Oct 27, 2026.
Sources
- AI coding agents hijacked using AGENTS.md file in Downloads folder (BleepingComputer, Oct 25, 2026)
- Markdown Is the New Executable: Attackers Are Dropping Agent Instructions Into Your Downloads Folder From the Web (Forever Security research report, Oct 2026)
Published October 26, 2026 by FraudMeNot Team. Label: Real, reported.