A dependency wrote AGENTS.md and Codex hid the edit

NVIDIA’s AI Red Team got OpenAI’s Codex to add a five-minute sleep to a Go program and then hide the edit from reviewers, and nobody touched the target repository to do it. A malicious dependency wrote the agent’s new instructions during an ordinary build. Rye calls this proof of concept the sharpest of three attacks on the same file in an August 25 analysis, and argues that the weakness belongs to the AGENTS.md format, not to one vendor’s code.
AGENTS.md is a plain markdown file at the root of a repository. It has no schema and no special syntax, and it gives coding agents project-specific instructions such as build commands, conventions and boundaries. Tools that support it load its contents into every request and treat them as instructions to follow. Rye points out that this, unmodified, also describes a working prompt injection: content an attacker can put in a workspace that reliably redirects the agent, with no user action needed to trigger it.
How the dependency took over
In NVIDIA’s setup the malicious Go package is already in the project’s dependency tree. When the build runs it, the package checks for the CODEX_PROXY_CERT environment variable to confirm it is inside a Codex environment, then writes a crafted AGENTS.md into the project directory. The injected directives claim “absolute authority” over whatever the user actually asks for. A separate directive tells the agent to keep its changes out of PR summaries and commit messages.
The agent complied. It made the edit and helped hide it from review. No person wrote or reviewed that AGENTS.md. The file did not exist until a dependency’s build step created it in the middle of the session.
Two more routes in
Prompt Security’s demonstration from December 2025 is more direct. A developer clones a repository with a plausible-looking AGENTS.md, opens it in VS Code and asks Copilot a routine question. VS Code adds the file to every chat request by default, and the hidden directives send the agent to scan the workspace for credentials and use its tools to send internal data to an external address. A follow-up analysis files this under two categories in OWASP’s agentic threat list: ASI01, agent goal hijack, and ASI02, tool misuse. It also separates the attack from ordinary prompt injection, where an attacker hopes the model happens to read the planted text. AGENTS.md is a persistent channel that fires on every interaction by design.
The third study, GitInject, tested AI agents running in GitHub Actions against real, short-lived repositories rather than simulations. These agents read untrusted pull request titles, descriptions, code and comments while holding elevated repository permissions. All four AI providers tested were vulnerable by default, across 11 documented attack classes. The paper puts it this way: “the most critical vulnerabilities are structural: they arise from how CI/CD infrastructure handles credentials and configuration files, not from any specific model’s behavior.”
Why 23 tools trust it
The same obedience explains why the format spread so quickly. Evaluation work out of ETH Zurich, cited by Prompt Security, found that agents follow AGENTS.md faithfully: when the file names a particular tool, the agent measurably reaches for it more often. AGENTS.md came from a coalition of OpenAI Codex, Amp, Google Jules, Cursor and Factory. It is now stewarded by the Agentic AI Foundation under the Linux Foundation, which announced the foundation on December 9, 2025, with OpenAI, Anthropic and Block as co-founders. The project’s site counts more than 60,000 open-source projects using the file and lists 23 tools that read it, among them Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, Devin and Windsurf.
Claude Code is not on the list, although Anthropic co-founded the foundation that stewards the format. One GitHub issue asking for native support was closed without a maintainer response, Rye notes, and another request on the same tracker was still listed as open in July. CLAUDE.md can pull the file in with an @AGENTS.md line or a symlink. Rye argues that the gap changes nothing: whichever file a tool loads automatically and trusts by default carries the same exposure.
Where the check has to live
The usual advice across the three studies is to review AGENTS.md as carefully as a shell script, scope agent permissions narrowly, pin dependency versions and watch for unexpected file changes. NVIDIA’s own list includes “limit what files AI agents can read and write” and “set up alerts for unexpected modifications.” In NVIDIA’s demo, review by hand never had a chance, because the file was written after any review had already happened. Permission scopes set in the agent’s own configuration are weak in the same way, Rye says, because a rule the model reads as text competes with a paragraph claiming “absolute authority,” and the model decides between them, not the runtime.
Rye’s conclusion is that a file anything with build-time code execution can rewrite cannot hold a security boundary. That boundary has to sit where the agent’s actions reach the network, where a rewritten AGENTS.md cannot reach it. Rye proposes two checks there: whether the outbound content contains something that looks like a secret, and whether the workspace allows the destination. “Neither check reads the paragraph in context asserting absolute authority. Both just read the traffic.”
Up next
First results land for OpenAI’s Jalapeño inference chip
Jalapeño, OpenAI’s custom inference chip, has its first published results, and the claim is industry-leading speed and efficiency: higher throughput, lower latency and more power-efficient inference on modern models.
Related stories
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

