Forever Security has shown that a planted AGENTS.md or CLAUDE.md instruction file in a folder that a terminal-based AI coding agent uses as its working directory, such as Downloads, can steer OpenAI Codex CLI and Anthropic Claude Code into actions the user never asked for, subject to each tool’s approval and sandbox settings. That’s according to BleepingComputer’s report, published October 25, 2026. Cursor CLI is named in the report as one of the assistants the firm’s customers run, but the sourcing doesn’t describe a test or result for it.
The short answer: yes, a file sitting in Downloads can hijack an AI coding agent, but only if you launch the agent from that folder and let it act on what it reads.
This is the AI coding agent AGENTS.md hijack in one sentence. It’s a trust-boundary problem, broader than any single software bug, that comes from where you start the agent and how much you let it do without asking.
What Happened
Here’s what BleepingComputer reported about the Forever Security findings.
What AGENTS.md and CLAUDE.md files are
Codex and Claude Code automatically read project-level instruction files in their working directory. Those files are usually named AGENTS.md (or CLAUDE.md for Claude Code). The goal is legitimate. A repo can tell the agent “use tabs, run these tests, don’t touch this folder” without you repeating it every session.
The catch, in the scenarios the researchers tested, is that the agent reads these files as trusted guidance. It has no reliable way to tell a teammate’s style rules from attacker-written instructions, so whoever can write a file into the agent’s working directory gets a voice in what the agent does.
Other agents’ discovery rules vary, so check each tool’s documentation rather than assuming identical behavior.
The demonstrated attack chain
According to the reporting, the attack depends on one common habit: opening a terminal in ~/Downloads and launching an agent there, often to “quickly check a file.” If an attacker-controlled AGENTS.md or CLAUDE.md is already in that folder, the agent picks it up and can act on it.
We’re not going to describe how to write such a file. The mechanics matter less than the precondition. The agent’s working directory was a folder that outside content can land in.
Reported test results
Per BleepingComputer’s summary of the Forever Security tests:
- Codex opened a harmless calculator app (the test payload) in roughly 90% of trials when launched from Downloads.
- Claude Code: in a researcher-created demonstration, a malicious
CLAUDE.mdredirected the agent’s API traffic to a researcher-controlled server, exposing its OAuth token and letting that server return tool calls that executed code in roughly half of tests. The reporting gives one figure for that chain rather than separate rates for each step, and this demonstration is distinct from the customer incident described below. - Cursor CLI is mentioned in the report as one of the assistants customers run, but the sourcing doesn’t describe a test or success rate for it.
These numbers come from the researchers, as relayed by BleepingComputer. We haven’t seen them independently replicated.
The real-world incident
The research reportedly started with a customer incident. An agent tried to install a rogue npm package called function-color after reading a malicious AGENTS.md. BleepingComputer describes an attempted installation, not a confirmed compromise. How that file got onto the machine was not established: the researchers say they couldn’t determine it. Treat any claim about the delivery method as speculation until someone publishes evidence.
What the researchers recommend
The researchers’ advice comes down to three controls:
- Keep sandbox protections on. How much a sandbox stops depends on the tool, its configuration and the action being attempted, so it’s a layer of defense rather than a universal block.
- Keep interactive approval prompts on. A prompt gives you the chance to decline an unexpected install or command. It only helps if you read it and say no; it isn’t a guarantee that every malicious instruction chain gets stopped.
- Scoping the agent to a specific project directory instead of Downloads or a home folder avoids this Downloads-folder scenario when the agent is scoped as documented by the vendor. Agent file-discovery rules vary by product, and some agents may also read instruction files outside the immediate working directory, so this isn’t a complete fix for prompt-injection risk in general.
Turning off those safety controls, or using “yes-to-all” style automatic modes, removes the checkpoints that give you a chance to catch planted instructions.
Vendor response
Forever Security argues there’s nothing for OpenAI or Anthropic to patch, because an agent that follows the instruction file in its folder is doing exactly what it was built to do. Check each vendor’s security documentation for any guidance issued after this report.
The mitigations above come from the researchers’ recommendations, not vendor guidance. Check each vendor’s own documentation for current sandbox and approval settings before you change policy.
How It Stacks Up
There’s no sourced data comparing this to other platforms or tools outside the three agents named. So the useful comparison is between the agents themselves, plus what each mitigation costs you in admin time.
| Agent | Reported result | Mitigation cited | Source |
|---|---|---|---|
| OpenAI Codex CLI | Ran test payload (opened calculator) in ~90% of trials | Sandbox protections (configuration-dependent) | BleepingComputer |
| Anthropic Claude Code | Redirect, OAuth token exposure and code-executing tool calls in ~50% of tests (researcher demonstration; one figure for the chain) | Interactive approval prompts | BleepingComputer |
| Cursor CLI | Mentioned in the report; testing details and results not confirmed | Not reported | BleepingComputer |
Don’t read this as “Codex is worse than Claude Code.” The tests weren’t apples-to-apples: they used different payloads, files and success criteria, and Claude Code’s roughly 50% figure covers a multi-step chain as one number.
The takeaway is about settings, not brands. The tested agents—Codex and Claude Code—became dangerous when run unattended in an untrusted folder. Whether the same holds for Cursor CLI or other agents wasn’t established in this research.
Admin cost and migration effort
The good news is that nothing here requires a migration. You don’t need to switch tools. The mitigations are mostly process changes; some come from the researchers, and others are our own policy suggestions:
- Launch from the project root. Near-zero cost. It takes a habit change and maybe a shell alias or wrapper script.
- Keep approval prompts on. Low cost in setup, real cost in developer patience. Approving every install and shell command slows people down, and that friction is why teams turn it off.
- Sandbox or isolate agent sessions. Moderate cost. A read-only sandbox mode is cheap where the tool offers it. A dedicated VM, container, or a spare mini PC as an “agent box” takes more setup but gives stronger isolation.
- Restrict network egress and rotate tokens. Moderate to high cost, depending on your firewall tooling, and egress controls may not be available for every agent. Token rotation is incident response if you find a suspicious file, not a routine step.
Checking for stray instruction files
These checks are our own general precautions, not part of the researchers’ testing, and they don’t validate how any agent behaves. Before you launch an agent anywhere other than a known repo, check the folder for instruction files. These commands only list files. They don’t open or run anything.
Linux
Tested pattern for Ubuntu/Debian with GNU find. It searches Downloads and one level of subfolders.
# -maxdepth 2 checks Downloads and its immediate subfolders only
# \( ... -o ... \) matches either filename
find ~/Downloads -maxdepth 2 \( -name "AGENTS.md" -o -name "CLAUDE.md" \)
If nothing is found, the command prints nothing. If it finds a file, you’ll see paths like this:
/home/your-username/Downloads/sample-bundle/AGENTS.md
Then confirm where you are before starting an agent:
pwd
Expected output should be your project folder, not Downloads or your home folder:
/home/your-username/projects/my-app
Windows
Windows PowerShell 5.1 or PowerShell 7. To keep the command simple and portable, it searches all of Downloads, including every subfolder, so it may list more matches than the Linux version. Same idea: list, don’t open.
# -Recurse searches Downloads and all subfolders; -Force includes hidden files
Get-ChildItem -Path "$env:USERPROFILE\Downloads" -Recurse -Include AGENTS.md,CLAUDE.md -Force -ErrorAction SilentlyContinue
No output means no matches. A match looks like this:
Directory: C:\Users\your-username\Downloads\sample-bundle
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/24/2026 9:12 AM 812 AGENTS.md
Confirm your working directory:
Get-Location
If you do find one you didn’t put there, don’t launch an agent in that folder. Keep a copy for your security team before deleting anything, and read it in a plain text editor, not a Markdown previewer or any tool that renders links or embedded content. If it looks like it’s trying to install packages or change endpoints, treat it as a possible incident and rotate any tokens for agent tools you’ve used recently.
The Reaction
Reaction on X largely lands where the evidence does. Most posts sharing the story, including BleepingComputer’s own post, treat it as a launch-hygiene problem. The common advice is to never start agents from Downloads, scope them to project roots, and keep auto-approval off.
The sharper point in the discussion is worth taking seriously. Some posters argue that the loader is the real problem, not the file. The idea is that agents collect instructions from any instruction file they find and treat that text as authoritative. Others say AGENTS.md should be reviewed like a dependency, not ignored like a README. That framing is right. Instruction files are configuration that changes what software does, and they deserve the same scrutiny as a package.json change.
We’d push back on one strand of the chatter. Some posts describe zero-click drive-by downloads as the delivery method. Forever Security points out that web pages can write to Downloads, but the researchers say they couldn’t determine how the file reached the customer’s machine. It’s a plausible scenario, not an established one.
Our Take
Verdict: Adopt the mitigations now. Hold on unattended or auto-approve agent use outside isolated environments.
This doesn’t call for pulling AI coding agents from your shop. The researchers’ own advice is to keep the safety controls these tools already ship with switched on: approval prompts and sandboxing. The risky pattern is stepping outside those guardrails: wrong folder, auto-approve, sandbox off.
So the policy writes itself:
- Adopt a rule that agents launch only from a named project root. Never from Downloads, home, or a parent folder that holds many projects. Bake it into onboarding docs and wrapper scripts.
- Adopt approval prompts for package installs, config edits, and network endpoint changes as the default. Make turning them off a deliberate, documented exception.
- Pilot auto-approve or “yes-to-all” modes only inside a disposable VM, container, or dedicated box with restricted network egress. A spare mini PC or a homelab hypervisor host works well for this.
- Hold on auto-approve modes on daily-driver workstations that hold real credentials, SSH keys, or cloud tokens.
What it costs an IT shop: mostly time, not licenses. You’ll spend a few hours writing a launch policy and wrapper scripts. You’ll spend some ongoing developer friction from approval prompts. If you build isolated agent environments, add a modest hardware or VM budget. Compare that to the cost of a leaked OAuth token and the cleanup after a rogue npm install. It’s an easy trade.
The open questions are real, though. The researchers don’t expect a patch. Nobody has explained how the customer’s malicious file arrived. And there’s no apples-to-apples data on Cursor CLI. Revisit your policy when any of those land.
Wrapping Up
Yes, a stray AGENTS.md or CLAUDE.md in Downloads can steer an AI coding agent into doing things you didn’t ask for. But only if you start the agent there and let it act without asking. Launch from the project root, keep approvals on, and sandbox anything that runs unattended. That closes off the Downloads scenario the researchers demonstrated, though it doesn’t remove prompt-injection risk in general.
Our honest read: this is less a flaw in any one tool and more a reminder that instruction files are code-adjacent config. Treat them that way and these agents stay useful without becoming a liability.
| Step | Action | Applies To |
|---|---|---|
| 1 | Launch agents only from a specific project root | The tested scenario for Codex and Claude Code; a reasonable precaution for other agents |
| 2 | Check unfamiliar folders for AGENTS.md / CLAUDE.md before launching | General precaution; exact behavior may vary by agent and OS |
| 3 | Keep approval prompts on for installs, config, and endpoint changes | Recommended by the researchers; check each agent’s equivalent settings |
| 4 | Use read-only sandbox or an isolated VM for unattended runs | Recommended by the researchers; a VM or container adds isolation for any agent |
| 5 | Restrict egress and rotate tokens if you find a suspicious file | Relevant for teams using agents with cloud or API credentials |