Article

Malicious AGENTS.md File in Downloads Folder Hijacked an AI Coding Agent

Researchers at Forever Security found a malicious AGENTS.md file sitting in a customer’s Downloads folder that pushed an AI coding agent to try installing a rogue npm package called function-color. AGENTS.md and similar markdown files hold plain-text instructions that coding agents read automatically from their working folder, and in this case the agent had been launched from Downloads.

The researchers point out that a web page can silently save a file into Downloads in browsers such as Chrome, Edge and Firefox. In their tests, a reconstructed attack against OpenAI Codex succeeded about 90% of the time using a harmless payload. A related trick using a CLAUDE.md file redirected Claude Code’s API traffic and exposed its OAuth token, leading to code execution in roughly half of tests.

According to the researchers, there is nothing for the AI vendors to patch, because the agent is doing what it was designed to do. Their advice is to never use Downloads as an agent’s working folder. OpenAI and Anthropic recommend running their agents only from the specific project folder they should work on.

Why it matters for your business

If your developers use AI coding agents, set a simple rule: run them only inside trusted project folders, and treat instruction files like code that needs review.

Source: BleepingComputer

Book a Free Consultation

Want to talk this through?

Book a short free consultation and we can look at your situation together.