Site icon Panda Security Mediacenter

Hackers turn AI agents and Downloads folders against users

ai-agents-downloads-folders-against-users

Agentic AI is a useful way to harness AI to perform basic tasks on your behalf. But that power creates new security risks. Researchers recently found that a malicious instruction file in a Downloads folder could trick AI coding assistants into installing malware, changing their settings or exposing login tokens. 

This article explains how the attack works and how to reduce the risk of becoming a victim of a similar attack. It also highlights an important warning for anyone using AI tools. An assistant can follow instructions that you never intended to give.

Key takeaways

What is the AI agent Downloads folder attack?

This particular attack abuses the way AI coding assistants read local instruction files. Tools such as OpenAI Codex and Anthropic Claude Code can read files, edit documents, run commands and install software when users grant them permission. Developers often place files called “AGENTS.md” or “CLAUDE.md” in project folders to provide instructions to the AI agents as they work.

The problem begins when an attacker places a similar file in a folder that an AI agent later opens. A website may be able to save a file into the Downloads folder without requiring you to grant specific approval. If you then start an AI assistant in that folder, the assistant may treat the malicious file as trusted – and then execute the instructions inside it.

The file can contain instructions that appear harmless. For example, it might tell the assistant to configure a development tool or install a specific package that extend functionality or connect to another system to complete a task. 

But in the hands of a hacker, those instructions could lead to malware being downloaded and run. Researchers reported that one malicious file told an assistant to install “function-color”, a package linked to the MALFEX malware campaign.

How does the exploit work?

The attack depends on three conditions:

  1. A malicious instruction file is saved to your computer.
  2. The AI agent opens the folder containing that file.
  3. The agent has enough permission to run commands, change settings or access credentials.

Once the assistant reads the file, it may follow the attacker’s instructions as if they came from you. In testing, researchers found that a file could persuade Codex to alter its configuration so that malicious tooling would be loaded in later sessions. A separate test redirected Claude Code’s traffic to an attacker-controlled server, creating a risk of stolen login tokens and further commands being sent to the assistant.

This new attack does not rely on traditional executable malware. The dangerous content can be hidden in an ordinary Markdown file (a way of formatting text using a plain text editor like Windows Notepad). The file becomes harmful when an AI agent interprets its text as instructions and carries out those embedded instructions.

That is why a Downloads folder deserves special attention. It contains files from the internet, email attachments and other sources that may not have been checked. It should not be treated as a trusted workspace for an AI agent.

Why agentic AI creates extra risks

Traditional software usually waits for a person to open a file or approve an action. Agentic AI is designed to take several steps, usually without any further user input. It may inspect files, decide what to do next and use connected tools without confirming every individual action.

That can be useful for experienced developers. It can also create unintended consequences for people who do not understand what the assistant is doing.

A user may ask an agent to “set up this project” without realizing that the task could involve:

The assistant may sound confident while following instructions hidden in a file. It does not automatically know that the file is malicious. You should always treat AI agents as powerful software with access to your accounts and files, not as passive chatbots.

How to protect yourself when working with an AI agent

  1. Do not start an AI coding agent in the Downloads folder. Use a dedicated project folder containing files you have reviewed.
  2. Check instruction files first. Be cautious with unfamiliar “AGENTS.md”, “CLAUDE.md” or similar files, especially in downloaded or recently cloned projects.
  3. Keep approval prompts enabled. Do not allow an assistant to run commands automatically unless you understand exactly what the command will do.
  4. Keep sandboxes enabled. A sandbox can limit the files, network connections and commands available to the agent.
  5. Question requests to bypass safeguards. Instructions that mention disabling approvals, leaving a sandbox or changing an API endpoint should be treated as warning signs that something may be wrong.
  6. Limit access. Give the agent only the project directory and permissions it needs. Avoid granting access to your whole home folder.
  7. Check settings after suspicious activity. Look for unfamiliar servers, proxy addresses, packages or configuration changes.

If you believe an agent followed malicious instructions, disconnect the affected device from the internet if appropriate, remove suspicious software and revoke potentially exposed tokens. Deleting the original file may not undo changes already made.

Stay cautious with AI agents

Agentic AI can save time, but convenience should not replace basic security checks. Before allowing an assistant to act, check where it is working, what files it can read and what permissions it has.

Check out the Panda Security Mediacenter for more practical advice about using AI safely.

Exit mobile version