90% Hijack Rate Turns AI Coding Agents Into Attack Tools via Download Folder
What happened
Security researchers at Forever Security published findings showing that a file named AGENTS.md can redirect AI coding agents such as OpenAI Codex and Claude Code. Attackers place the file in a user's Downloads folder to execute commands of their choosing. The technique, described in AI coding agents hijacked using AGENTS.md file in Downloads folder, works because these agents read instruction files from accessible directories. The Downloads folder is typically within that range. The attack achieved a 90% success rate across tests. The behavior is a feature of how coding agents read and follow instructions, not a software defect. Because no defect exists, both OpenAI and Anthropic have indicated there is no patch forthcoming. Defense responsibility falls entirely on the organizations and developers running these tools. This follows a broader pattern of coding agent vulnerabilities covered previously, including the Claude Code flaw that let malicious files steal developer credentials without a click and the Plugin4Shell flaw that broke approved-plugin controls across four major AI coding agents.
Why it matters
- ·AI coding agents are production tools in software development pipelines at most large enterprises. A 90% success rate means an attacker who can place a file in a developer's Downloads folder can reliably redirect that agent to run harmful commands. That access can come through phishing, a malicious download, or a supply chain compromise.
- ·Because no vendor patch is coming, this is an operator control problem, not a vendor remediation problem. Compliance and risk teams cannot wait for OpenAI or Anthropic to close the gap. They must impose working directory restrictions and file review requirements on their own developer populations now.
- ·This attack vector intersects with existing regulatory expectations around agentic AI security. Guidance from the Five Eyes Guidance on the Careful Adoption of Agentic AI Services already calls on enterprises to restrict what directories and resources agents can access. Organizations that have not acted on that guidance face compounding exposure.
Stay ahead of stories like this
Get every Global AI governance development like this one, plus the rest of the week's developments. Every Thursday.
Recent issues
- Frontier AI systems are proving harder to contain and easier to misuse than enterprise risk models assumed, while regulators are beginning to demand accountability for exactly those gaps.3 Dec
- Three separate enforcement and operational crises landed this week, each adding urgent new tasks for compliance teams across patching governance, state-level AI liability, and export control disclosure.26 Nov
Free every Thursday. Unsubscribe anytime.
What to do now
- ☐Ask your engineering team which AI coding agents (such as OpenAI Codex, Claude Code, or similar tools) are in use, and confirm whether their working directories are restricted to specific project folders or left open to broader paths like the Downloads folder.
- ☐Require that AI coding agents be configured to read instruction files only from explicitly approved project directories, and prohibit them from reading instructions from user download or temporary folders.
- ☐Issue interim guidance to all developers using AI coding agents telling them not to open or run agents in sessions where unexpected files may have been downloaded, and to review any unfamiliar instruction files before allowing agent execution.
- ☐Confirm with your security team that AI coding agent environments run in isolated containers or restricted execution environments that limit what commands the agent can actually carry out, even if it is hijacked.
- ☐Add AGENTS.md and similar agent instruction file types to your data loss prevention and file integrity monitoring policies so unexpected files of this type trigger an alert.
Related guidance: How do we govern agentic coding assistants and AI developer tools? · What AI agent security controls do we need as agent autonomy expands? · How do we govern AI agents that take autonomous actions?
Related controls: Agent Permission Boundaries · Agent Environment Isolation · Agent Scope and Task Boundaries · Prompt Injection Prevention · AI Tool and Plugin Supply Chain Risk Assessment
What to watch next
Enterprises should monitor whether OpenAI, Anthropic, or other coding agent vendors introduce optional controls such as allowlists for instruction file paths. Such controls would make this a configurable rather than purely operator-managed risk. Regulatory pressure on agentic AI security is also intensifying. The Five Eyes Guidance on the Careful Adoption of Agentic AI Services is already in circulation. Further guidance from NIST and sector regulators on agent containment is expected in the coming months. Organizations subject to model risk management expectations, particularly in financial services, should treat this finding as evidence that their current coding agent controls require a documented re-assessment.
