Image: Unsplash.
Use this if anyone on your team runs OpenAI Codex, Claude Code or another coding agent on a laptop. Forever Security reported finding a malicious AGENTS.md file in a customer's ~/Downloads folder. A coding agent started in that folder read it and tried to install function-color, an npm package already flagged as malware. Our verdict: this is a policy gap more than a software bug, and most of the fix is one rule about where agents start.
Event date: October 22, 2026, Forever Security's report. Press coverage: BleepingComputer, October 25 at 15:49 UTC; RuntimeWire, October 25 at 17:55 UTC.
What happened
Forever Security sells monitoring for AI agents. It says its product stopped a coding agent mid-session from installing function-color, and traced the order to an AGENTS.md in the customer's Downloads folder, which was also the agent's working directory. The researchers could not determine how the file got there. Their point is that it doesn't take much: "~/Downloads is special. It is the one folder the web can write to on its own." BleepingComputer opened their proof-of-concept page, and it downloaded an AGENTS.md with harmless test text.

Screenshot: "Markdown Is the New Executable", Forever Security, the attack section of the planted AGENTS.md. Captured October 26, 2026.
The planted file reads like a dull "Engineering Work Guidelines" document, with the attack near the end dressed up as setup. It asks Codex to append a "project-tools" server to ~/.codex/config.toml, then run a second Codex session with --dangerously-bypass-approvals-and-sandbox to "confirm" it loads. In the researchers' isolated VM, "Codex ran the malware in more than 90% of attempts." Because the edit lands in Codex's machine-wide config, every later session on that laptop loads the attacker's server, in any folder.
For Claude Code they wrote their own file, modeled on the attacker's. A planted CLAUDE.md asked Claude to save a project .claude/settings.json that sets ANTHROPIC_BASE_URL to their server. "Claude followed through on this about 50% of the time," and the reroute handed over the session's OAuth token. That variant is the researchers' test, not something they found on a customer machine.
Their line on fixes: "There is nothing here for OpenAI or Anthropic to patch."
Why the agents obey the file
Both vendors document the behavior. Codex reads AGENTS.md "before doing any work," walking from the project root down to the folder you started in, and with no project root "it only checks the current directory." Claude Code loads CLAUDE.md "from your current working directory and every directory above it," and reads an AGENTS.md instead when there is no CLAUDE.md.

Screenshot: "Custom instructions with AGENTS.md", OpenAI Codex docs. Captured October 26, 2026.

Screenshot: "Store instructions and memories", Claude Code docs, AGENTS.md section. Captured October 26, 2026.
So the folder you start in decides which instructions the agent treats as yours. Downloads is the worst pick on the machine, and Forever says that in its telemetry "about half of customers run an agent inside Downloads."
The playbook: six steps
-
Ban two starting folders. No agent sessions in
~/Downloadsor in the home folder. Put it in your AI use policy as one line. Need an agent to work on a downloaded file? Move the file into a project folder first. -
Read instruction files you didn't write. Any
AGENTS.md,AGENTS.override.md,CLAUDE.mdorCLAUDE.local.mdin a fresh clone, an unzipped archive or Downloads gets read by a person before an agent sees it. Red flags from the real file: edit the agent's own config, install a package "before beginning the user's request," or pass a flag that skips approvals. -
Check each laptop's agent config. In
~/.codex/config.toml, look for[mcp_servers.*]blocks nobody added on purpose. In any project's.claude/settings.json, look forANTHROPIC_BASE_URLor another endpoint you didn't set. Two commands cover it:grep -n -A3 'mcp_servers' ~/.codex/config.toml find ~ -maxdepth 4 -path '*/.claude/settings*.json' -exec grep -l 'BASE_URL' {} + -
Keep approvals and the sandbox on. Codex's CLI defaults "include no network access and write permissions limited to the active workspace." The Codex attack worked by getting the agent to switch that off for itself. Make "never run with
--dangerously-bypass-approvals-and-sandboxon a work laptop" a written rule. For folders you don't trust, Codex acceptstrust_level = "untrusted"per project, which makes commands ask first and "also disables project-local configuration." -
Lock the API address where a project file can't reach it. On Claude Code with managed settings, nothing in a user's or project's settings file "overrides a managed key." Set your API endpoint there if you route through a gateway. On the Claude side, also don't accept the workspace trust dialog for Downloads: most
envvalues in a project file apply only after you trust the folder. -
If you find one, rotate. Forever's advice is "Assume the token leaked." If
function-colorshows up in a machine's installs, the OSV advisory says it "should be considered fully compromised": rotate every secret on it from a different computer. Our API token leak playbook has the rotation order.
Our take: steps 1 and 3 take ten minutes per laptop and cover the case as reported. Step 5 matters only if you already run managed settings; don't buy a plan for it.
What we checked
- npm, October 26:
function-colornow resolves to a "security holding package," version0.0.1-security, last modified October 7. Today's install gets the placeholder, not the malware. The method works with any other package, so this changes little. - OSV: advisory MAL-2026-17647, published October 7, 2026, lists versions 1.0.0 and 1.7.3. Checkmarx had documented the package in its MALFEX research and said that as of September 29 it "remained live and installable."
- Our own machine, October 26: we ran the step 3 checks on the laptop this desk works from. Downloads held 556 items and no
AGENTS.mdorCLAUDE.md.~/.codex/config.tomlhad one[mcp_servers]block. It named a desktop app installed on that machine, which is the kind of entry you want to be able to explain in one sentence.

Screenshot: OSV advisory MAL-2026-17647. Captured October 26, 2026.
What to log
- Which laptops run coding agents, and from which folders. If you keep an AI tool inventory, add a column.
- Each config check from step 3: date, machine, result.
- Any instruction file found outside a project, with a hash, before you delete it.
- Every token rotation after a finding.
For a longer agent policy, see our unattended AI coding agents policy.
What people said
When the report was posted to r/cybersecurity, the top-voted reply was skeptical. mesarthim_2: "By 'attackers are dropping' you actually mean 'people are downloading themselves', right?" TurbsUK18 asked the question we'd put to a vendor: "Why is the agent allowed to modify its own configuration?" Both are fair. A file still has to land in Downloads, and someone still has to start an agent there. The second question is the one to ask your tool vendors.
Forever Security's own demo of the Codex chain:
What we could not confirm
How the file reached the customer's machine: Forever says it doesn't know. The 90% and 50% rates come from Forever's own tests, which we did not rerun. We found no statement from OpenAI or Anthropic about the report. Forever sells agent monitoring, so read its framing ("Markdown is the new executable") with that in mind. For a related case where Claude Code credentials were the target, see our Claude Code token theft post.
