Preprint
Article

This version is not peer-reviewed.

Are AI Coding-Agent Instruction Files Being Weaponised? A Census of 1.47 Million Files and a Test of Eight Coding Agents

Submitted:

24 November 2026

Posted:

30 November 2026

You are already at the latest version

Abstract
Coding agents read instruction files (CLAUDE.md, AGENTS.md, Cursor rules, agent skills) from the repository they work in and follow them. A file that hides instructions from the human reader, in invisible Unicode or HTML comments, could steer an agent to leak secrets or run code. Nobody has measured how often this happens in public code or whether current agents act on it. We scanned all 1.07 trillion directory entries in the Software Heritage archive and downloaded 1,468,189 unique agent instruction files from about 20 coding agents, most of those we could date first committed in 2026. Hidden text appears in 6.2% of them, no more often than in README and CONTRIBUTING files (6.6%), and is almost always harmless. On 1,587 sampled files labelled under a pre-registered protocol, only 6.5% (95% CI 3.8–10.8%) of a deterministic scanner's high-severity flags were malicious, none of 500 random unflagged files was (upper bound 0.8%), and every malicious file we confirmed was a test fixture, demo, proof of concept or benchmark sample. We then planted payloads of the kinds we found in a test repository and gave eight coding agents an ordinary task (336 runs). Every agent acted on at least one payload, and Copilot, Claude Code, Codex and Kilo followed visible payloads in 7 to 9 of 12 runs. Planted edits landed without an approval prompt, Copilot and Antigravity never told the user, and Claude Code, Amp and OpenCode usually reported the payloads they declined. Hiding did not help an attacker: Claude Code strips HTML comments, the models behind Copilot and Codex never read text in Unicode tag characters, and Gemini's safety filter blocked most tag-character payloads. No payload command took effect, stopped by approval prompts or a sandbox; a one-sentence warning reduced attempts but did not stop planted edits. Weaponised agent files are rare, but agents follow the ones they meet. We release the scanner and the aggregate data.
Keywords: 
;  ;  ;  ;  ;  
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.