Discover ALTREVA → (ALTREVA is a store owned by the owner of NEXOTECH.)
Skip to content
NEXOTECH
Artificial intelligence

A file in your Downloads folder can hijack your AI coding assistant

Researchers show an AGENTS.md file in Downloads can give orders to AI coding agents such as Codex or Claude Code. How to avoid it.

By Nacho MasedaPublished 1 min readLeer en español

Apps and services change often. The steps in this guide were reviewed on the date shown; if a menu doesn't match, check the official sources linked at the end. Information reviewed on .

AI coding agents such as OpenAI's Codex or Anthropic's Claude Code can read files, run commands and install packages for you. That power has a weak spot, just demonstrated by security firm Forever Security: if you launch the agent in your Downloads folder, a malicious file saved there can give it orders.

How the attack works

These agents automatically read instruction files (AGENTS.md, CLAUDE.md and similar) found in the folder they work in. They're meant to explain the project to the agent, but the agent treats them as instructions.

According to BleepingComputer:

  • Forever Security found a malicious AGENTS.md in a customer's Downloads folder. The agent, launched from there, tried to install a rogue npm package.
  • A website can drop a file into Downloads with little warning: Chrome, Edge and Firefox save downloads there by default.
  • In tests, a harmless payload made Codex open the calculator in 90% of attempts. With Claude Code, a malicious CLAUDE.md redirected traffic to the researchers' server and exposed the access token.
  • According to its data, hundreds of customers run agents from Downloads.

The researchers acknowledge that there's nothing for OpenAI or Anthropic to patch: it's a risk in how these tools are used.

How to protect yourself

  • Don't use the Downloads folder (or your whole home folder) as the agent's working directory.
  • Open the agent only in the specific project folder.
  • Review any AGENTS.md or CLAUDE.md you didn't write before letting the agent follow it.
  • Don't turn off approval prompts or sandboxing: let the agent ask before running commands or installing packages.
  • Test untrusted code in an isolated environment.

If you're getting started with these tools, read our guide to coding with AI and review how to spot suspicious downloads.

Sources and documentation

  1. AI coding agents hijacked using AGENTS.md file in Downloads folder — BleepingComputer
  • artificial intelligence
  • programming
  • cybersecurity
  • ai agents
  • news
More in Artificial intelligence