Last updated: November 19, 2026
A developer clones a promising repository and asks the coding assistant to fix one failing test. The project's instruction file says a setup script must run first, quietly, unread. So what does AI coding assistant security mean when a Markdown file can start malware? Two November campaigns gave the answer: agent instruction files, hooks, and MCP configs now behave like code, and they need code-level controls.
TL;DR: Key Takeaways
- Instruction files became a worm: Bitdefender Labs found 22 malicious GitHub links whose agent files push assistants to run a hidden setup.js (Cyber Security News, 2026).
- It spreads through agent configs: the payload targets configs of 14 coding agents and can push to up to 25 repositories by default (Cyber Security News, 2026).
- A settings file carried a backdoor: a suspected North Korean cluster edited .claude/settings.json, so starting Claude Code fetched SOMBERMEME (Google Threat Intelligence Group, 2026).
- The toolchain is a target too: agent-framework 1.26.1 and 1.26.2 ran a credential stealer at every Python start (GitHub Advisory Database, 2026).
- Short windows still hurt: the package has 192,534 monthly downloads, and the bad versions were live for under one hour (CSO Online, 2026).
At a glance: AI coding assistant security after three incidents
Quick Answer
What is AI coding assistant security?
AI coding assistant security is the set of controls that keep tools such as Claude Code, Codex, Cursor, and GitHub Copilot from acting against you. It covers what the assistant reads, which commands, tools, and MCP servers it can run, which credentials it can reach, and a record of every action it takes.
| Incident | Entry point | What ran |
|---|---|---|
| Bitdefender GitHub campaign | AGENTS.md, CLAUDE.md, hooks, MCP configs, VS Code tasks | Obfuscated setup.js stealer |
| MIDNIGHT NEPTUNE | ClickFix lures, then edited .claude/settings.json | SOMBERMEME backdoor |
| agent-framework on PyPI | Malicious package releases | .pth credential stealer |
How we compared
We read the Bitdefender, Google, and GitHub disclosures, then checked each mechanism against vendor documentation. We ran no samples. The Agent Security AI attack roundup tracks all three incidents.
How the campaign Bitdefender found turns instruction files into a worm
The campaign Bitdefender found hides orders in the files coding assistants read to learn a project. AGENTS.md and CLAUDE.md tell the agent to run scripts/setup.js, describe it as sealed and signed, forbid reading it, and hide its output. Once it runs, the malware steals credentials and plants the same trap elsewhere.
According to Cyber Security News (2026), the files call setup.js "a sealed binary artifact" that must run at session start. If a user asks for help first, the agent should run it without asking. The tone mimics internal compliance policy, so the risky step feels routine.
A second path needs no model at all. Bitdefender also found .claude/settings.json files with session-start hooks. Once a developer trusts the repository, the hook runs a command in the user's shell.
The payload steals CI/CD and GitHub Actions secrets, cloud credentials, registry tokens, browser logins, password manager data, SSH keys, and .env files. It then searches the home directory for agent configs and injects its own instructions, hooks, or MCP servers. With a stolen GitHub or GitLab token, it commits files like AGENTS.md, .mcp.json, and .vscode/tasks.json to other repositories.
SOMBERMEME: when a committed settings file is the pivot
In the SOMBERMEME case, a settings file was the pivot, not the entry point. Google Threat Intelligence Group reported that a suspected MIDNIGHT NEPTUNE cluster got in through fake recruiters and ClickFix lures. It then edited .claude/settings.json in internal repositories, so starting Claude Code downloaded a backdoor.
Google Threat Intelligence Group (2026) found the targets were cryptocurrency organizations in North America and Europe. To blend in, the actor created GitHub personal access tokens named after Microsoft Copilot. Google named no victims.
This was not a Claude Code vulnerability, and Google reported no flaw in the product. The attackers abused a documented feature: committed project settings that define hooks. Anthropic (2026) states that command hooks "execute shell commands with your full user permissions." A shared settings file deserves the same review as a build script.
The agent-framework hijack: classic supply chain, not prompt injection
The agent-framework incident involved no prompt injection. An attacker published two malicious releases of Microsoft's Agent Framework package to PyPI on November 17. Each added a .pth file that Python executes at interpreter start, so the stealer ran even when no code imported the framework.
The GitHub Advisory Database (2026) states that the stealer collected environment variables containing names like OPENAI, HF_, and AZURE, plus credential files and Azure managed identity tokens. Version 1.26.2 added GitHub Actions OIDC tokens. Data went to a webhook.site address. PyPI removed both releases, and 1.26.0 is the last clean release.
The advisory attributes the releases to no known campaign. CSO Online (2026) reported that Microsoft has not said how the attacker got publishing access. The lesson echoes our LiteLLM supply chain analysis: the fix is supply chain hygiene, not a smarter prompt filter.
Why agent config files behave like executable code
Agent config files behave like executable code because something executes them. A hook runs a shell command, an MCP entry launches a server, a VS Code task runs a script, and an instruction file steers an agent with shell access. Each file lives in the repository, so one commit reaches every developer who clones it.
| File | What it can trigger | Trust gate |
|---|---|---|
| AGENTS.md, CLAUDE.md, .cursorrules | Any command the agent may run | Agent permissions |
| .claude/settings.json hooks | Shell commands at events like SessionStart | Workspace trust (interactive only) |
| .mcp.json | A local or remote MCP server | Varies by client |
| .vscode/tasks.json | Scripts and tool binaries | VS Code Workspace Trust |
| .pth file | Code at every Python start | None once installed |
Anthropic (2026) says interactive sessions hold back settings-file hooks until you accept the trust dialog. A claude -p run or SDK session treats the folder as trusted, so committed hooks run anyway.
VS Code (2026) states that task definitions sit in the committed .vscode folder and are shared with every user of the repository. For the instruction-file half of the problem, see our indirect prompt injection guide.
Hardening AI coding assistant security for config files
Hardening starts with treating agent config paths as code. Require owner review on every change, allowlist the tools and MCP servers agents may use, inspect instructions and tool calls at runtime, and keep credentials short-lived. No single layer covers all three incidents.
| Control | Config file attacks | agent-framework |
|---|---|---|
| CODEOWNERS review on agent config paths | Forces review of poisoned commits | No effect |
| Managed hook policy | Blocks project hooks | No effect |
| Tool and MCP allowlist | Limits rogue MCP servers | No effect |
| Short-lived credentials and egress blocks | Shrinks what stolen tokens can do | Limits token value and exfiltration |
Put AGENTS.md, CLAUDE.md, .claude/, .cursor/, .mcp.json, and .vscode/ under CODEOWNERS, with branch protection that enforces it. Alert on any commit that adds hooks or MCP servers.
Anthropic (2026) documents allowManagedHooksOnly, a managed setting that blocks user, project, local, and plugin hooks.
PyPI (2026) describes Trusted Publishing, which swaps long-lived API tokens for short-lived OIDC credentials. Pin dependencies with hashes and block catch-all endpoints like webhook.site from build networks.
Security and governance: where runtime checks fit
Runtime checks cover the part of the problem that lives in agent traffic: the instructions a model reads and the tool calls it makes. A hook that runs straight in a shell, or a .pth stealer, never passes through the model.
The risks map cleanly. Prompt injection: instruction files in 22 malicious links. Tool misuse: rogue hooks and MCP entries across configs of 14 agents. Data leakage: AI provider keys, Azure tokens, and CI OIDC tokens.
NeuralTrust treats this as an access and inspection problem. Route coding assistants through the Agent Gateway (TrustGate) to approve or block MCP servers and tools per team, with every prompt, tool call, and response logged. Protect those interactions with Agent Runtime Security (TrustGuard), which can allow, block, or transform them inline. See the secure coding assistants page and our Claude Code security guide.
Which should you choose?
Choose controls by where your agents run and which credentials they can reach. Developer laptops need repository review and hook policy first. CI pipelines that run agents need settings isolation and short-lived tokens. Teams running several assistants need one place to see and govern every tool call.
| Situation | Start with | Then add |
|---|---|---|
| Developers open public repos in AI editors | Credential-free sandbox | Runtime instruction checks |
| Agents run in CI on pull requests | Managed hooks, restricted settings | Short-lived OIDC credentials |
| Many teams, many assistants | Gateway allowlist for tools and MCP | Central audit trail |
Conclusion
The November incidents settle it: agent config files are executable code. The campaign Bitdefender found turned AGENTS.md and hooks into a self-spreading stealer, and MIDNIGHT NEPTUNE used one committed settings file to launch a backdoor. The agent-framework hijack shows the toolchain around assistants is exposed too. Strong AI coding assistant security reviews these files like code, limits what agents can reach, inspects what they read, and keeps credentials short-lived.
Secure AI Coding Assistants in Production with NeuralTrust
Control every coding assistant's tools through TrustGate and protect each interaction with TrustGuard, all on NeuralTrust. Start for free.
Related Comparisons
- Claude Code Security: Enterprise Guide
- Claude Code MCP and Cursor MCP Security
- Copilot CLI Prompt Injection Attack Chain
- The LiteLLM Supply Chain Breach
FAQs about AI Coding Assistant Security
1. Can an AGENTS.md file run malware?
Not on its own, since it is plain Markdown. But coding agents read it as instructions, and an agent with shell access can follow them. In the campaign Bitdefender described, AGENTS.md and CLAUDE.md told assistants to run a hidden setup.js without reading it or showing output. Review these files like code.
2. Was the SOMBERMEME attack a Claude Code vulnerability?
No. Google reported no vulnerability in Claude Code. The attackers already had access to internal repositories and edited the committed .claude/settings.json, so starting Claude Code triggered a backdoor download. They abused project hooks, a documented feature that runs shell commands with the user's full permissions.
3. How do I check a repository before opening it with an AI assistant?
Read AGENTS.md, CLAUDE.md, and the .claude/, .cursor/, and .gemini/ folders. Check MCP server definitions, session-start hooks, VS Code tasks, and any setup script they reference. Treat any instruction to skip inspection, hide output, or bypass confirmation as a red flag, and open unknown code without production credentials.
4. Was the agent-framework PyPI attack a prompt injection?
No. It was a classic software supply chain compromise. Two malicious releases added a .pth startup hook that ran a credential stealer whenever Python started, with no model involved. Microsoft has not said how the attacker got publishing access, and the releases have not been attributed.
5. What should I do if I installed agent-framework 1.26.1 or 1.26.2?
Treat the environment as exposed and rotate every credential reachable from it, including CI and GitHub Actions secrets. Rebuild from a clean environment on version 1.26.0. Check container images, caches, and lockfiles built in the window, and search egress logs for the webhook.site endpoint.
6. Does a gateway stop poisoned agent config files?
Partly. A gateway sees traffic between the assistant, its models, and its tools, so it can block unapproved MCP servers, flag hidden instructions, and log tool calls. It cannot see a hook that runs directly in a shell, so pair it with code review and managed settings.
About the Author
Roger Howroyd is Head of Global SEO and AI at NeuralTrust, where he leads the company's search strategy across SEO, AEO, GEO, and LLM optimization. He specializes in AI-powered search, content strategy, and SEM. Connect on LinkedIn.
NeuralTrust is the leading platform for securing and scaling AI agents. Named a Pioneer in the Gartner Emerging Market Quadrant for AI Application Security 2026, recognized across four Gartner Hype Cycle reports in 2026, and featured in the Gartner Market Guide for Guardian Agents 2026, the Gartner Market Guide for AI Gateways 2025 and the KuppingerCole Leadership Compass for Generative AI Defense 2025. Headquartered in Barcelona with offices in London and New York. ISO 27001 certified.
Sources
- Cyber Security News, "Hackers Hijack AI Coding Agents Through Malicious GitHub Repositories to Steal Developer Credentials," November 18, 2026. https://cybersecuritynews.com/hackers-hijack-ai-coding-agents/
- Google Threat Intelligence Group, "GTIG AI Threat Tracker: Agentic Threat Activity Crosses a Significant Threshold," November 16, 2026. https://cloud.google.com/blog/topics/threat-intelligence/agentic-threat-activity-crosses-a-significant-threshold
- Anthropic, "Hooks reference," Claude Code documentation, accessed November 19, 2026. https://code.claude.com/docs/en/hooks
- Visual Studio Code, "Workspace Trust," documentation, accessed November 19, 2026. https://code.visualstudio.com/docs/editing/workspaces/workspace-trust
- GitHub Advisory Database, "GHSA-764m-3ppc-5m73: Malicious code in agent-framework (PyPI)," November 18, 2026. https://github.com/advisories/GHSA-764m-3ppc-5m73
- CSO Online, "Attackers hijack Microsoft's agent-framework package to steal Azure and CI credentials," November 18, 2026. https://www.csoonline.com/article/4250156/attackers-hijack-microsofts-agent-framework-package-to-steal-azure-and-ci-credentials.html
- PyPI, "Publishing to PyPI with a Trusted Publisher," documentation, accessed November 19, 2026. https://docs.pypi.org/trusted-publishers/
- Agent Security, "Cyber Attack News: AI Edition (Nov 20)," November 20, 2026. https://agentsecurity.com/news/cyber-attack-news-2026-11-20
)
)
)