Home › Intelligence › Brief
BREACH BRIEF🟠 High ThreatIntel

Malicious AGENTS.md Files Hijack AI Coding Agents, Enabling Rogue npm Installs and Token Theft

Security researchers demonstrated that a plain‑text AGENTS.md file dropped into a user's Downloads folder can cause AI coding assistants like OpenAI Codex and Anthropic Claude Code to execute malicious commands, install rogue npm packages, and exfiltrate OAuth tokens. The finding underscores the need for AI governance controls and user‑focused security awareness.

LiveThreat™ Intelligence · 📅 November 18, 2026· 📰 bleepingcomputer.com
🟠
Severity
High
TI
Type
ThreatIntel
🎯
Confidence
High
🏢
Affected
3 sector(s)
✅
Actions
5 recommended
📰
Source
bleepingcomputer.com

Malicious AGENTS.md Files Hijack AI Coding Agents, Enabling Rogue npm Installs and Token Theft

What Happened – Researchers at Forever Security discovered a new attack vector that abuses the plain‑text AGENTS.md instruction file used by AI coding assistants such as OpenAI Codex and Anthropic Claude Code. By placing a malicious AGENTS.md in a user’s ~/Downloads folder, an attacker can cause the AI agent to automatically execute the instructions it contains. In a controlled proof‑of‑concept the team showed the agent installing a rogue npm package (named function‑color) and, in a separate test, redirecting Claude Code’s API traffic to a server under the attacker’s control, exposing the model’s OAuth token. The attack succeeds without any user interaction beyond the browser silently downloading the file; the AI agent must simply be launched from the same directory where the malicious file resides.

Why It Matters for Trust & Control Assurance – The technique highlights a gap in AI governance: without explicit policies and user awareness, AI agents will obey untrusted instruction files, breaking the boundary between intended project context and arbitrary filesystem locations.

Who Is Affected – Software developers and data‑science teams that run AI coding assistants locally; vendors of AI coding tools (OpenAI, Anthropic, Cursor CLI, etc.); enterprises that embed AI agents into internal development pipelines.

Recommended Actions –

  • Restrict the working directory of AI coding agents to the specific project folder rather than a broad home or Downloads directory.
  • Enforce a review process for any AGENTS.md, CLAUDE.md, or similar instruction files before the agent is allowed to load them.
  • Enable browser download prompts or use extensions that require explicit user consent for files saved to ~/Downloads.
  • Apply sandboxing or containerization for AI agent execution to limit filesystem access.
  • Update security awareness training to cover AI‑agent workspace hygiene and the risks of auto‑loaded instruction files.

Source: BleepingComputer article

Technical Notes –

  • Attack vector: Malicious AGENTS.md file placed silently in ~/Downloads by a web page; AI agent automatically reads the file when launched from that folder.
  • Tools leveraged: npm package installation, OAuth token extraction via redirected API calls.
  • Success rates: 90 % for a harmless calculator payload on Codex; ~50 % for token theft on Claude Code.
  • Browser behavior: Chrome, Edge, and Firefox save downloads to ~/Downloads without prompting; Brave prompts the user.
  • Mitigations from vendors: OpenAI and Anthropic recommend launching agents from the project root and keeping the working directory narrowly scoped.
📰 Original Source
https://www.bleepingcomputer.com/news/security/ai-coding-agents-hijacked-using-agentsmd-file-in-downloads-folder/ ↗

This LiveThreat Intelligence Brief is an independent analysis. Read the original reporting at the link above.

From the Verisq platform · Security Awareness

Awareness is a control you can evidence too.

Verisq AI Trust Operations records training completion and policy adoption as audit evidence — turning 'we train our staff' into something you can actually prove.

See how Verisq AI Trust Operations covers awareness →