· via dev.to (home feed)
AI coding agent instruction files flagged as malware vector by Bitdefender and Swiss NCSC
Bitdefender reported a malware campaign that turns AI coding assistants' instruction files into an execution route, while Switzerland's NCSC confirmed the country's first attacks carried out with AI agent assistance.

On November 18, Bitdefender reported a malware campaign that turns the instruction files used by AI coding assistants into a route for executing malicious code. Six days later, on November 24, Switzerland's National Cyber Security Centre (NCSC) confirmed the country's first cyberattacks carried out with the assistance of AI agents, hitting organisations in at least two sectors, including critical infrastructure. An analysis published on dev.to argues that the two reports, read together, describe one design flaw rather than two unrelated incidents — and that it is not the flaw most of the industry is arguing about.
Instruction files as an attack channel
Coding assistants are built to read project files that tell them how to behave: coding conventions, build steps, preferred tools, restrictions. According to the Bitdefender findings as summarised in the dev.to analysis, that useful feature is also a channel. Anything the agent reads from a repository it has been told to trust becomes part of the context it acts on, and the agent has no built-in way to establish who wrote that text or when it last changed. Classic phishing needs a person to click a link; this technique only needs an attacker to place text where the agent already looks, after which the agent acts on it using the permissions of the developer's session. The instruction file ends up playing the role the phishing link once played: routine-looking content, delivered over a trusted path, that triggers a privileged action when followed.
What the Swiss attacks actually did
The detail the dev.to analysis singles out in the NCSC confirmation is what the agents did not do. They did not use new exploits. The attacks relied on weak, easily guessed passwords and vulnerabilities that had been public for years, but executed faster and with less human effort, because an agent can attempt, fail, retry and combine small steps without fatigue. Every attack known to the agency ended in a successful compromise. There was no zero-day to patch and no new malware family to write a signature for.
The confused deputy problem
The dev.to author traces the underlying structure to the "confused deputy", described by Norm Hardy in 1988: a program that holds authority its caller does not, and can be tricked into exercising that authority on the caller's behalf. Hardy's example was a compiler that was neither malicious nor broken; it simply could not distinguish acting on its own behalf from acting on someone else's. The modern deputy is an agent holding the developer's credentials, files and shell, plus a persistent instruction to be helpful. Hardy's proposed remedy was capability-based security: authority travels with unforgeable, purpose-specific tokens instead of floating as ambient context that any request can borrow.
Three layers of defence
The post and its comment thread converge on a layered response, with each layer covering a failure the others leave open.
The first is least privilege applied to a non-human principal: one credential for one task, short-lived task-scoped tokens, read-only access by default, no standing access to production secrets in any session that reads untrusted files, and a clear separation between the environment where the agent reads and the environment where it acts. If an instruction file is compromised, the damage is capped at whatever that single credential can reach.
The second layer, raised by commenters, is provenance. An instruction file whose authorship is tracked and whose modification is detectable is a different object from text that merely reads like instructions, even if the contents match exactly. Authorship becomes a structural property rather than something inferred from content.
The third layer targets the gap in provenance itself. A signature proves who wrote a file; it does not prove that the author may cause a particular effect right now. A signed instruction can still be stale, out of scope for the current task, or issued from a compromised maintainer account. The design sketched in the thread binds together the instruction manifest's hash, the signer, the current task's grant, the requested effects and an expiry time, and permits only the overlap between what an instruction requests and what the user's running task has already authorised. The proposed test is blunt: sign an exfiltration instruction with the legitimate project key and place it in the expected file. If the signature alone is enough to make it execute, the system is still handing out ambient authority and the underlying problem remains.
Why it matters
Both reports point at the same shift: the attacker's target has moved from the human to the tooling the human already trusts. Agents act with developer-level permissions, which makes ordinary repository content — instruction files, READMEs, configuration comments, tool descriptions — a potential execution vector. The dev.to analysis dismisses the tempting response, a smarter model that can spot malicious instructions by reading them carefully, as a losing bet: the attacker writes the text the model reads and can iterate until it reads as legitimate. The Swiss cases make the same point from the other direction, since the weaknesses were old and the agents simply exploited them at machine speed. The practical implication for teams running coding agents is to treat repository content as untrusted input, and to rely on structural controls: scoped, short-lived credentials, verifiable provenance for instruction files, and an authorisation check at execution time that compares what an instruction wants to do against what the current task was actually granted.
- #security
- #ai-agents
- #malware
- #coding-assistants
- #devtools