Back to all posts

Markdown Is the New Executable: What a File in Your Downloads Folder Can Do to Your AI Agent

2026-10-27
luodaInt
Markdown Is the New Executable: What a File in Your Downloads Folder Can Do to Your AI Agent

Markdown Is the New Executable: What a File in Your Downloads Folder Can Do to Your AI Agent

For thirty years, the security rule was simple: a downloaded file cannot hurt you unless you run it. Operating systems closed the door on self-executing downloads, and a file sitting in your Downloads folder became about as dangerous as a text document.

That rule just broke. Not because files learned to run themselves, but because a new kind of software on your machine now does run them. AI coding agents read plain-text instruction files and obey them. And one folder, Downloads, is the only place the web can write to without a click.

Two harmless behaviors, one dangerous combination

Each half of this attack is a feature, working as designed.

First: an AGENTS.md (or CLAUDE.md) file is meant to be obeyed. Coding agents like OpenAI Codex and Claude Code automatically load instruction files from their working directory and follow them: what tools to use, how to run tests, which conventions to honor. That is the whole point of the file, and it only works because the agent trusts it.

Second: a website can save a file to your Downloads folder on its own. No click, no approval, no warning. The site even picks the filename and contents.

Put them together and the gap opens: a web page silently plants an instruction file in the one folder it can reach, and the next agent session opened there treats it as orders. The file never executes, so none of the guardrails built for executables apply. It just sits there, until an agent reads it.

Caught on a real machine, not in a lab

This is not a thought experiment. Researchers at Forever Security found the attack live on a customer's machine, reported in October 2026, where a coding agent was caught mid-session trying to install a known-malicious npm package called function-color. Tracing the order back led not to a dependency or a repository, but to an AGENTS.md file planted in the customer's ~/Downloads folder, a 13 KB document dressed up as routine engineering guidelines, with the payload hidden in a section near the end.

Running the attacker's actual file in an isolated VM, they watched the full chain execute against Codex:

  • The planted file instructed the agent to register a "project tools" MCP server (really the malicious npm package) in Codex's machine-wide config file, not something scoped to the folder.
  • Because that config loads at startup, the file had the agent run a child session to activate it immediately, including a flag the agent wrote itself to bypass the network sandbox.
  • In their testing, the chain succeeded in more than 90% of attempts; the real malicious package was run once, inside an isolated VM. Once written, the poisoned config loaded in every future session on that machine, in any folder.

They also reproduced a variant against Claude Code, which was harder to fool but fell to a different trick: the planted file convinced the agent to point its own API traffic at an attacker-controlled server. That single change both leaked the agent's OAuth login token (account takeover with no code executed) and let the attacker's server impersonate the model, feeding back tool calls the agent then ran. It worked about 50% of the time in their testing. Bleeping Computer covered the findings on 25 October 2026.

Why there is nothing to patch

The uncomfortable part is that neither vendor can ship a fix. An agent that follows the AGENTS.md in its folder is doing exactly what it was built to do, the same way a browser that renders a phishing page is working as designed. The tool is not broken. The circumstances are: a folder the web can write to, treated as a folder the user filled.

That is why this matters as a category, not as two CVEs. As the researchers put it, this is one early example of a bigger pattern: defenses built around a human break when an agent takes the human's place. Every guardrail that assumed "someone at the keyboard would have noticed" is now standing in front of software that reads and obeys whatever text it finds.

The exposure is ordinary behavior

If your team thinks this requires unusual carelessness, the telemetry says otherwise. In Forever Security's data, about half of their customers had employees running a coding agent inside their Downloads folder, and roughly a quarter of agent sessions opened a real browser.

That second number is the quieter risk. Agents are increasingly sent to browse on their own (research a vendor, fill a form, check a listing) while nobody watches the screen. One of the sites it visits can drop the file, and no one sees it arrive. The employee did everything right, and it made no difference.

What to do this week

None of this needs new tooling to start. It needs one rule applied consistently: an instruction file in an untrusted location is untrusted input.

  1. Stop running agents in Downloads. Pick a project folder per task. If a session's working directory is Downloads, that is a process failure, not a convenience.
  2. Audit the folder now. Look for AGENTS.md, CLAUDE.md, or similar files you did not put there, including in subfolders of downloads.
  3. Treat unexpected instruction files like unexpected executables. Nobody opens a random .exe from Downloads. The same reflex should apply to a 13 KB "engineering guidelines" document nobody remembers writing.
  4. Watch agent config files. The Codex attack worked by writing to the machine-wide config; the Claude Code attack worked by writing a settings file that rerouted API traffic. Unexpected changes to either are an incident, not a quirk.
  5. Keep approval gates on for irreversible actions. Package installs, config edits, and credential handling should not run hands-free, because the planted file succeeded partly by dressing its payload up as routine setup.
  6. Isolate sessions that browse. If an agent opens a browser unsupervised, run it in a sandbox with no access to your working directories or credentials.

None of these close the vector completely; the researchers are right that it cannot simply be patched away. They shrink the blast radius while vendors and harness builders work out the real answer.

The takeaway for businesses deploying agents

The agent did nothing wrong in this story. It read a file, believed it, and used the tools it was given, competently, from beginning to end. The failure was letting an attacker choose what the file said.

That is the correct mental model for every agent you deploy: the agent is a diligent new hire who follows written instructions to the letter, and anyone who can write to the desk you put it on can write the instructions. Location, trust, and review are no longer office hygiene. They are the security boundary.

If you are putting agents to work on real systems and want the guardrails (scoped access, isolation, and human approval where it counts), talk to us.

Sources