Building a SaaS tool or MCP server? Get listed or sponsor AgentStackList →
ChatGPT Industry News By Emily Carter

A planted AGENTS.md in your Downloads folder hijacked Codex in over 90% of tests. Don't start agents there

Security firm Forever Security says it found a hostile AGENTS.md file in the Downloads folder of a real customer's computer. A malicious web page can drop a file into Downloads, and coding agents read AGENTS.md (or CLAUDE.md) in the folder they start in as instructions. In Forever's tests, Codex started in that folder added an attacker's MCP server to its machine-wide config and installed a hostile npm package in more than 90% of runs. A similar CLAUDE.md got Claude Code to send its API traffic to the researchers' server about half the time, which exposed its login token.

Why it matters

This is one of the first documented in-the-wild attacks aimed at coding agents rather than people. Nothing needs patching, the researchers say: the agent is doing what it was built to do, so the fix is how you run it.

Who it's for

Anyone who runs Codex, Claude Code or another coding agent on their own computer, and security teams looking after developers.

What it means for you

  1. Never start Codex, Claude Code or any coding agent inside ~/Downloads; open it in the project folder you mean to work on.
  2. Before letting an agent loose in a folder you didn't create (including a freshly cloned repo), open any AGENTS.md or CLAUDE.md and read it yourself.
  3. Check ~/.codex/config.toml for MCP server blocks or a changed base URL you didn't add, and check a project's .claude/settings.json for an ANTHROPIC_BASE_URL you didn't set.
  4. Keep approval prompts and sandboxes on. If you find a planted file, sign out and back in so the agent's token is replaced.

Applies to: Research published October 22, 2026 by Forever Security and covered by BleepingComputer. It's about how agents read instruction files, not one plan or version, so the advice below applies on every plan. The hostile npm package from the real attack has been removed from npm.

Share on X

Source: Forever Security on forever.security

Written by Emily Carter from the original post. Checked Oct 27, 2026. Features, plans and availability can change, so confirm on the source before you rely on it.

securityagents-mdcodexclaude-codeprompt-injection

More ChatGPT tricks

All ChatGPT tricks →