A new AI security risk shows how trusted automation can become an attacker’s entry point
AI coding assistants are changing how developers build software by automating tasks such as cloning repositories, installing dependencies, debugging errors, and configuring projects. However, researchers have uncovered a new attack technique showing that these capabilities can also introduce a serious security risk.
Researchers from Mozilla Zero Day Investigative Network (0DIN) demonstrated a scenario where an AI coding agent could execute malware from a seemingly harmless GitHub repository without detecting obvious malicious code.
The attack does not rely on traditional exploits, suspicious files, or direct user approval. Instead, it abuses the way AI agents interpret errors and automatically attempt to fix development issues.
The attack chain begins with a clean-looking repository containing normal setup instructions. A developer or AI agent may clone the project and attempt to install dependencies. The repository appears safe because it does not contain visible malware or suspicious commands.
However, the hidden risk appears during the setup process.
The malicious package is designed to fail during execution and display an error message suggesting that the user needs to run an initialization command. Since AI coding agents are trained to resolve common development problems, the agent may automatically follow the suggested command without recognizing the security implications.
That command then triggers another hidden step. It retrieves attacker-controlled instructions through a DNS TXT record and executes the returned command, allowing the attacker to establish a shell connection on the developer’s machine.
The most concerning part is the indirect nature of the attack.
The AI agent does not intentionally choose to run malware. Instead, it believes it is fixing a configuration problem. The malicious behavior is hidden several steps away through a chain of trusted actions:
- A repository setup instruction
- An error message suggesting a fix
- A script fetching external data
- A DNS record delivering the final command
As a result, attackers could potentially gain access to developer environments, API keys, credentials, environment variables, source code, and local configuration files.
Although researchers describe this as a proof-of-concept attack, the technique highlights a growing challenge in AI-powered development environments. Threat actors could distribute similar repositories through fake coding tutorials, job assignments, developer communities, or direct messages.
Organizations adopting AI coding tools should treat AI agents as powerful automation systems that require security controls. Developers should review automated commands carefully, restrict unnecessary permissions, and monitor tools that execute external scripts or modify local environments.
Additionally, AI coding platforms need stronger transparency features that explain the complete execution path of commands, including hidden scripts, downloaded content, and external resources accessed during setup.
The future of software development will rely heavily on AI assistants. However, as these tools gain more autonomy, security teams must ensure that convenience does not become an overlooked attack surface.