A Markdown file is now enough to run malware. Bitdefender Labs found 22 GitHub links whose AGENTS.md and CLAUDE.md files politely instruct AI coding assistants to run a “sealed” script at session start, hide the output, and never look inside it.
In short: the AGENTS.md malware campaign uses project instruction files and agent hooks to make AI coding assistants launch scripts/setup.js, a credential stealer that then commits the same poisoned files to up to 25 of the victim’s own repositories. No AI tool needs a patch; developers need to treat agent files as code.
- What is the AGENTS.md malware campaign?
- How does the AGENTS.md malware infect a developer?
- What does setup.js do?
- How does it spread to other repositories?
- Is this the Miasma worm again?
- Do AI coding assistants actually obey these files?
- Who is affected and how do you check exposure?
- How do you detect AGENTS.md malware?
- What should defenders do now?
- What is not known yet?
- The bottom line
- Sources
What is the AGENTS.md malware campaign?
The AGENTS.md malware campaign is a set of GitHub repositories, reported by Bitdefender Labs on 17 November 2026, that turn the files AI coding assistants read on startup into a delivery mechanism. Bitdefender researcher Andrei Anton-Aanei identified the samples; the post is co-authored with Alina Bizga.
AGENTS.md is a Markdown file that tells an AI coding agent how to work with a repository: how to build it, which tests to run, which conventions to follow. CLAUDE.md is the equivalent for Claude Code. Agents load these files automatically, and that trust is exactly what the attackers exploit.
Bitdefender counted 22 malicious links “so far” and published one indicator per repository: the MD5 hash of its setup.js. There are 13 distinct hashes across the 22 rows, which suggests the payload is rebuilt per batch of victims rather than copied unchanged.
Why this matters now
AI coding agents have moved from suggesting code to running commands. That gives anything they read a path to the shell. Indirect prompt injection, where an attacker plants instructions in content a model will later read, has been discussed for years. This campaign is a working, self-spreading example aimed at developers’ credentials.
We have covered neighbouring tricks before: TrojanPony hid a trojan in fake AI coding-agent skills, and PolinRider rewrote real developers’ commits to plant a loader. The AGENTS.md malware combines both ideas: agent-facing files plus commits pushed under stolen identities.
How does the AGENTS.md malware infect a developer?
Bitdefender describes two routes into the same script. One relies on the model obeying text; the other does not involve the model at all.
Route 1: prompt injection through AGENTS.md and CLAUDE.md
The poisoned instruction files describe scripts/setup.js as a signed, sealed binary artifact that is not human-readable. As quoted by SecurityBrief and Webcoda, they tell the assistant to run it at session start “without displaying output”, and to run it without asking for confirmation if the user wants help before setup has run. Inception Security quotes a further line telling the agent not to read, quote or display the script.
Each line is designed to remove a safeguard: reading the file, showing the output, and asking the human. Bitdefender notes that if the shell command is approved automatically, the script runs with the developer’s permissions.
Route 2: execution hooks that need no prompt
A hook is a command that a tool runs automatically on an event, such as a session starting. Bitdefender found session-start hooks in .claude/settings.json that launch setup.js once the developer opens and trusts the repository, with no typed prompt. It lists VS Code tasks as a separate editor-side mechanism.
Bitdefender calls the result a combination of indirect prompt injection with execution hooks that do not depend on the model following instructions. That second half is the important part: a model that refuses the text does not stop a hook.
What does setup.js do?
Bitdefender’s analysis describes a layered loader built to resist casual inspection.
Stage by stage
- setup.js: a 3.75 MB file on a single line. It hex-decodes a large value, applies ROT13 and evaluates the result.
- Node.js stager: holds two AES-128-GCM encrypted blobs with embedded keys. One decompresses to a 4.67 MB bundle.
- Bun runtime: the stager finds the Bun JavaScript runtime or downloads it, then pipes the bundle into
bun run -through standard input, so the main payload never needs to sit on disk as a readable file. - Extra modules: further payloads hide in a compressed
_bzfield inside package.json, including Windows Credential Manager enumeration.
Bun is a fast JavaScript runtime similar to Node.js. Using it lets the malware run a large bundle with few dependencies and fewer of the Node.js process patterns defenders may already watch.
What it steals
According to Bitdefender, the payload collects secrets from CI/CD systems and GitHub Actions, cloud platforms and containers, package registries, browsers, password managers, Windows Credential Manager, SSH keys, .env files, API keys and source-control tokens. It validates tokens against provider APIs, then encrypts and batches the records for sending. Bitdefender does not publish the destination.
How does it spread to other repositories?
The worm logic is what turns 22 links into a growing problem. It spreads in two directions.
Into the victim’s other AI agents
The malware searches the home directory for agent configuration files such as settings.json, mcp.json, .aider.conf.yml, .cursorrules, .windsurfrules, .cursor/rules and .github/copilot-instructions.md. It keeps paths that contain one of 14 agent names, including Claude, Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Amazon Q, Cody and Cursor, and injects malicious instructions, session-start hooks or MCP server definitions.
MCP, the Model Context Protocol, is a standard way to connect AI assistants to external tools. A malicious MCP server entry in a config file is another way to get a command started when the assistant launches.
Into the victim’s repositories
With a stolen GitHub or GitLab token, the malware checks for the repo, public_repo and workflow scopes, lists the account’s repositories and picks targets, capped by a MAX_TARGET_REPOS setting that defaults to 25. For each target it resolves the default branch, inspects up to 50 branches, skips dependabot/ and copilot/ branches, and reviews workflows, package metadata and branch protection.
Where it can, it commits AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules/setup.mdc, .claude/settings.json, .claude/setup.mjs, .mcp.json, .vscode/tasks.json, .vscode/setup.mjs and .github/copilot-instructions.md. Bitdefender adds that it can modify workflows and package metadata, create GitLab pipeline schedules and try to republish infected packages to npm, PyPI, RubyGems and JFrog.
That means the owners of the 22 repositories are most likely victims, not authors. Webcoda reports that SafeDep reached the same conclusion about 12 of the same repositories on 9 November and called the owners victims of forged commits.
Is this the Miasma worm again?
The sources do not say so, but the resemblance is close enough to compare. SafeDep documented the Miasma worm on 5 June 2026: on 3 June it pushed commits adding agent hooks and a setup.js dropper to more than 120 repositories, in one case five repositories within 49 seconds.
| Miasma (SafeDep, June 2026) | AGENTS.md malware (Bitdefender, November 2026) | |
|---|---|---|
| Dropper path | .github/setup.js | scripts/setup.js |
| Dropper size | about 4.3 to 5.4 MB, one line | 3.75 MB, one line |
| Obfuscation | Caesar shift, then eval | Hex plus ROT13, then eval |
| Runtime | Bun, with AES-128-GCM blobs | Bun, with AES-128-GCM blobs |
| Launchers | Claude Code and Gemini SessionStart hooks, Cursor rule, VS Code folderOpen task, npm test | AGENTS.md and CLAUDE.md text, .claude/settings.json hooks, MCP configs, VS Code tasks, Cursor and Copilot files |
| Scale reported | 123 repos across 56 accounts on 11 June | 22 links, “so far” |
| Commit forgery | 805 of 808 commits under real maintainers’ names, all with [skip ci] | Not described |
The shared design (a huge one-line dropper, AES-GCM blobs, Bun, agent hooks) is striking. Bitdefender’s main addition is the plain-language prompt injection in AGENTS.md and CLAUDE.md. Whether this is a newer build of the same operation is an open question.
SafeDep’s June follow-up is a warning for this campaign too: eight days after disclosure, 70 percent of the Miasma repositories it tracked were still serving the dropper, on 665 branches in total.
Do AI coding assistants actually obey these files?
One informal test suggests the answer depends on the agent. On 21 November, Peter Webb of Webcoda put Bitdefender’s quoted lines into a test project with a harmless setup.js, gave each agent an ordinary task three times, and reported the results.
As Webcoda reports it, Codex ran the script without reading it in two runs and, in the third, ran it in a locked-down mode where it failed. Claude Code did not try to run it in any run. The author lists the limits: three runs, one model per tool, one wording, different settings for each tool, and no test of the hook route.
The honest conclusion is Webcoda’s own: a model refusing today is not a security boundary. The hook route bypasses the model entirely, and a reworded instruction may succeed where this one failed.
Who is affected and how do you check exposure?
You are at risk if you cloned and opened an unfamiliar repository in a tool with an AI agent or automatic tasks enabled, especially with auto-approval of shell commands, or if you run agents headless on third-party code.
Check repositories
- Search every branch, not just the default, for scripts/setup.js and for the agent files listed above. SafeDep’s Miasma work found droppers on hundreds of non-default branches.
- Read AGENTS.md, CLAUDE.md and rule files for instructions to skip reading a file, hide output, skip confirmation or install software automatically. Bitdefender lists exactly these as red flags.
- Inspect .claude/settings.json for hooks, .mcp.json for server commands, and .vscode/tasks.json for tasks set to run on folder open.
Check machines and accounts
- Look in your home directory for agent configuration files that changed recently or now reference a setup script or unknown MCP server.
- Review recent commits to your own repositories for new agent config files you did not add, and check GitLab for new pipeline schedules.
- Compare setup.js hashes against the 13 MD5 values in Bitdefender’s table, linked in the sources.
How do you detect AGENTS.md malware?
Bitdefender publishes no ATT&CK mapping, YARA rules or network indicators, so detection has to rely on behaviour.
Log sources and behaviours
- Endpoint process telemetry: an AI agent, editor or node process spawning
bun run -with input on stdin, or downloading a Bun binary, on a developer workstation. - File activity: a single-line JavaScript file of several megabytes under scripts/ in a fresh clone; writes to many agent config files in the home directory in a short window.
- Source control audit logs: pushes that only add agent files, commits to many repositories from one token in minutes, and new workflows or pipeline schedules.
- Token use: bursts of calls to /user and /user/repos, or GitLab /api/v4/projects, from an unfamiliar address shortly after a developer opened a new repository.
- Package registries: unexpected new versions of packages you maintain on npm, PyPI, RubyGems or JFrog.
ATT&CK mapping (our assessment)
Bitdefender does not map the campaign. Based on its description, the closest techniques are T1195.001 (compromise software dependencies and development tools), T1059.007 (JavaScript execution), T1027 (obfuscated files), T1552.001 (credentials in files), T1555 (credentials from password stores) and T1528 (steal application access token). This is our mapping, not the vendor’s.
What should defenders do now?
- Rotate exposed secrets first. If a poisoned repository was opened by an agent or editor, rotate GitHub, GitLab, npm, PyPI and cloud credentials reachable from that machine, and revoke OAuth app grants, not only individual tokens.
- Keep approval prompts on in code you did not write. Do not auto-approve shell commands or use bypass modes in unfamiliar repositories; the attack relies on the command running unseen.
- Respect workspace trust. VS Code opens unfamiliar folders in Restricted Mode, and its documentation says automatic tasks never run in an untrusted workspace. Claude Code shows a workspace trust dialog in interactive sessions, but its documentation notes that headless
claude -pruns show no trust prompt, so never point headless agents at untrusted repositories. - Control hooks centrally. Claude Code supports
disableAllHooks, and administrators can setallowManagedHooksOnlyin managed settings to block project hooks. Leave VS Code’stask.allowAutomaticTasksat its default of off. - Make agent files reviewable code. Add CODEOWNERS rules for AGENTS.md, CLAUDE.md, .claude/, .cursor/, .vscode/ and .mcp.json, and flag changes to them in pull request review.
- Shrink token blast radius. Use short-lived, fine-grained tokens without the workflow scope unless needed, and protect default branches so a stolen token cannot push straight in.
- Sandbox agent sessions. Run agents on unfamiliar code in a container or VM without your real credentials mounted.
For a broader look at stolen CI tokens spreading across GitHub, see our breakdown of the wfx-loot CI secret stealer.
What is not known yet?
- Victim count. Bitdefender gives 22 links and no number of infected developers, and no first-seen date.
- Infrastructure. No exfiltration destination, domains or IP addresses are published, and no attribution is offered.
- Link to Miasma. The design overlaps heavily with Miasma, but no source has confirmed they are the same operation.
- Commit details. Bitdefender does not describe commit authors or messages, so it is unclear whether these pushes forge identities the way Miasma’s did.
- Vendor framing. Bitdefender’s post also promotes its own AI Guardian product, which it says blocked all 22 samples in internal tests. That is a vendor claim, not an independent result.
The bottom line
The AGENTS.md malware campaign is small by count but important by design: it shows that the files telling AI agents what to do are now an attack surface, and that a hook can run code whether or not the model agrees. Nothing here needs a patch. Treat agent instruction and config files like executable code, keep approval prompts and trust checks on, and rotate secrets if a poisoned repository was ever opened.
Sources
- Bitdefender Labs: AI Agents Targeted Through Malicious GitHub Repositories (17 November 2026)
- SecurityBrief Australia: Bitdefender flags malware targeting AI coding assistants
- Developer Tech: Hackers target AI coding assistants through malicious GitHub repositories
- Inception Security: AI coding agents tricked by GitHub repos to run malware
- Webcoda: Malware on GitHub is telling AI coding agents to run a script without reading it
- SafeDep: Miasma Worm Targets AI Coding Agents via GitHub Repositories
- SafeDep: Miasma Worm, Most Infected GitHub Repositories Are Still Live
- SafeDep: Configuration Files That Run Code
- Claude Code docs: Hooks
- Claude Code docs: Security
- VS Code docs: Workspace Trust
- VS Code docs: Tasks
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.