Hackers Can Hijack AI Agents Just by Planting Malicious Files in the Downloads Folder
Hackers can hijack AI coding assistants by planting malicious files in the Downloads folder, as these tools automatically read and obey any instructions file they find.
Overview
AI coding assistants like Claude Code and OpenAI Codex automatically read and obey instruction files found in the folder they open. Researchers discovered that attackers can plant a malicious file named AGENTS.md in a user's Downloads folder to hijack these tools. Websites can silently save this text file into Downloads, bypassing operating system blocks that usually stop executable files. Once the agent reads the file, it acts like an executable and follows the attacker's commands. In testing, Codex executed the malwareSoftware built to steal data, spy on users, lock files, or take control of a computer in more than 90 percent of attempts, while Claude succeeded in about 50 percent.
Terms in this story
- malware
- Software built to steal data, spy on users, lock files, or take control of a computer. News reports use malware as the umbrella term for viruses, ransomware, spyware, and trojans that criminals install on phones, laptops, or servers without permission. Security+ objective 2.4 lists the term
- Hackers
- A person who explores and manipulates computer systems, either as a criminal intruder or a security researcher. In news headlines, the word hacker usually means an unauthorized intruder, though the security community also uses it for researchers who find and fix flaws.
- AI Agents
- Artificial intelligence software that can plan steps, call tools, and take actions on its own. Many stories cover agentic AI when companies connect language models to email, browsers, and databases, creating new risks if a hidden prompt tricks the agent into leaking data.
- session
- An active logged-in period of communication between a user or device and a server. Once you log in to a website, the server tracks your session so you can click from page to page without retyping your password on every screen.
- npm package
- A reusable web code library published to the public npm registry for developers to install. Web developers pull in dozens of npm packages when building a site, and attackers frequently publish malicious packages with lookalike names to steal developer credentials during installation. Security+ objective 2.2 lists the term
- Operating systems
- The core software on a computer or phone that manages hardware, files, memory, and running apps. Because every application relies on the operating system, a security flaw in the operating system itself affects millions of devices until users install a system update.
- executables
- A compiled program file that an operating system can load into memory and run directly. Most mail servers block attached executable files by default because double-clicking a compiled program lets it run whatever instructions the author wrote.
- guardrails
- Safety rules and filters built around an AI model to block harmful, private, or off-limits outputs. Security stories test whether an AI assistant's guardrails hold up when a user or attacker crafts tricky prompts to ask for malware code or private company records.
- virtual machine
- A software-emulated computer that runs its own operating system inside a shared physical server. Cloud providers run dozens of customer virtual machines on one physical server, and security researchers run malware samples inside a disposable virtual machine that they can reset afterward. Security+ objective 3.1 lists the term
- configuration
- A text file that stores settings, network addresses, and options for how a program or server runs. Attackers who gain read access to a server look for its configuration file first because it often contains database passwords, API keys, and internal server paths.
- server
- A computer or program on a network that stores data and responds to requests from client devices. Online stores, email systems, and multiplayer games all run on servers in data centers or the cloud, making unpatched servers a primary target for intruders.
- exploit
- A piece of code or technique that uses a software flaw to break into or crash a system. Finding a vulnerability is only the discovery of a weakness, whereas an exploit is the working code or sequence of inputs that triggers that weakness in practice. Security+ objective 2.4 lists the term
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the GBHackers website. Cite the article, not this page.
Read the full article on GBHackers (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Research and reports
"Researchers ran the real attacker file..." Found by reading the article; these exact words are in it - Who is affected: "...a customers downloads folder..."
Copied word for word from the article - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"Hackers Can Hijack AI Agents Just by Planting Malicious Files in..." Found in the headline
How a story is connected to the course, and every objective, week and job role
Same story at other outlets
- Hackers Can Hijack OpenAI Codex and Claude Code Using Malicious Files in Downloads Folder
- AI coding agents fall for malicious instructions planted in the Downloads folder
- Malicious downloads can trick AI coding agents into compromising themselves
- Malicious File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware
- AI coding agents hijacked using AGENTS.md file in Downloads folder