AI Coding Agents Can Be Tricked by GitHub Project Files, Bitdefender Finds
Malicious repository instructions can turn a coding assistant into a route for credential theft.
AI-generated illustrationIn this article
A coding assistant may read a repository’s instructions before it writes a single line of code. New research published by Bitdefender Labs on 17 November shows why that helpful feature can become an attack path. Researchers identified malicious GitHub material that used familiar project instruction files to persuade AI coding agents to run a separate setup script. The script was not a harmless setup helper: the investigated campaign included credential-stealing malware and mechanisms to spread malicious instructions to other development environments.
The instructions were the lure
Files named AGENTS.md and CLAUDE.md are supposed to tell tools how a project works: coding conventions, tests, build steps and local constraints. Similar instructions may exist in .cursorrules, .cursor/rules, .mcp.json and editor settings. By design, agents can encounter and use this material. But these files are controlled by the repository’s author, not necessarily by the person operating the agent. Bitdefender counted 22 malicious GitHub links. It also reported a second path that requires no AI agent: a session-start hook in .claude/settings.json can run the script once a developer opens and trusts the repository.
Bitdefender Labs researcher Andrei Anton-Aanei found malicious guidance that presented scripts/setup.js as a “sealed binary artifact” and told the assistant to run it without review. The deception matters more than the filename: when an agent treats lower-trust repository prose as an authoritative instruction, an attacker can move from text on disk to a tool execution request. The specific outcome depends on the agent’s permissions, controls and whether the instruction is actually followed; reading a malicious file is not in itself proof that malware ran.
Why this is more than a one-off trick
Bitdefender describes the malware as capable of looking for agent configuration files on the compromised machine and attempting to insert malicious directions or execution hooks. The campaign also sought access to developer credentials, cloud secrets, CI/CD tokens, package-registry tokens and other sensitive data. Stolen GitHub or GitLab access could allow the attacker to modify repositories encountered by other developers; exposed package-registry tokens could also facilitate republishing infected packages through ecosystems such as npm, PyPI and RubyGems. The researchers describe both local propagation through configuration files and remote propagation through compromised repository access.
This is a software supply-chain problem with an AI-specific entry point. The danger is not that every coding model independently becomes hostile. An adversary plants instructions in a place the assistant expects to consult, and those instructions may invoke ordinary operating-system capabilities. The resulting damage depends on which files, commands, tokens and network destinations the assistant can reach.
What is confirmed and what isn’t
The 17 November publication is a new security research disclosure. It does not establish that every AI assistant follows the planted instructions, that every malicious repository caused a successful infection, or that a particular WordPress website was breached. The vendor’s analysis identifies a concrete mechanism and malware behavior; organizations must establish their own exposure from local logs and repository histories.
What this means for a WordPress site owner
A site owner hiring an agency to build a WordPress theme or plugin may never see the AI coding assistant behind the work. Bitdefender’s report does not mention WordPress; the exposure is indirect and depends on what credentials the developer’s machine can reach. The real question is whether that assistant can run arbitrary setup commands while holding production hosting credentials, WordPress application passwords, repository write tokens or deployment secrets. If so, a malicious project dependency or cloned repository can place those assets at risk.
Ask developers to review AGENTS.md, CLAUDE.md, agent rules, MCP definitions, startup hooks and unexpected setup scripts before opening unfamiliar repositories with tool-enabled assistants. Limit permissions for exploratory work, segregate production credentials from local builds, review dependency changes and require human approval for commands that fetch or execute unfamiliar code. Where compromise is suspected, audit the relevant credentials and build runners instead of assuming that deleting one file fully resolves the problem.
The larger takeaway
An instruction file can be as sensitive as executable code once a tool-enabled AI agent is allowed to obey it. Treat repository instructions as untrusted input until reviewed and keep the authority to run commands under the operator’s control.
Sources
Bitdefender Labs original investigation, 17 November 2026: Bitdefender Labs — How AI agents become new targets in a GitHub malware campaign