Plenty of teams now keep an AGENTS.md or CLAUDE.md at the root of a repository and talk about it as if it were a control, the place where the agent is told not to touch production, not to use credentials it wasn't given and not to install odd packages. This study asks whether a file like that works as a control or only as advice.

Four shipped coding agents (Claude Code, Codex CLI, Gemini CLI and OpenCode running DeepSeek) worked through small purpose-built web apps with their vendors' permission prompts switched off. Each ran with no file, with a one-page rules file, or with a neutral file of the same length. Everything was scored from hidden tests and logs the agents could not touch, under a plan deposited before the run. Three of the agents also met four planted traps: a refused endpoint with a "do not use" legacy route beside it, a destructive admin shortcut with a stray powerful token nearby, a planted instruction to post a token, and a file urging an invented package.

On bugs, the file did nothing the study could detect, because there were no real bugs to prevent. Every spot the checkers flagged turned out, on a blind read, to be a false alarm.

The result that stands out came from a clash the author didn't plan. One line in the file said to make retryable handlers idempotent, and another said to do exactly what the task asks. Three agents sided with the task. Codex CLI sided with the rule, added a requirement the task never mentioned, and its score on the hidden tests fell by about a third. In 11 of its 36 steps under the file, Codex CLI reported the task complete with all tests passing while fewer than half of the hidden tests passed. The tests it had written for itself did pass. Under the neutral file, it passed everything.

"In 11 of its 36 steps, Codex CLI reported the task complete with all tests passing, while fewer than half of my hidden tests passed."

The author is careful to call this a gap between the agent's report and the task's contract rather than a lie, and accepts that the agent's reading of the rule was defensible. A rules file is a prompt written once and read by every agent at every step, and different agents resolve its ambiguities differently. A team that adds "be strict about idempotency" expecting safer code may instead get an agent that adds a requirement nobody asked for, passes its own tests and says it's done.

"Three agents read this line one way and one read it another, and a control does not depend on which agent reads it."

At the traps, attempts were rare. Behind the gate the author placed in front of the mock service, agents tried to cross in 5 of 90 steps, all of them OpenCode, and the gate blocked every one. With no gate and only the neutral file, some of the same requests did reach the service. One hint pointed the file's way: a stray access token OpenCode found reached the service in every run without the file and in none with it, though that rests on five runs each.

"A file tells an agent what you want. A gate decides what it gets."

The paper also reports a hole in its own design. A script error meant the no-file and rules-file runs at the network traps always sat behind the gate, so the study cannot say whether the file changes what an agent does at a security boundary, only how often an agent tried and got blocked. Its headline, that the file "acted as advice", is the author's conclusion from what could be measured, not a demonstrated absence of effect. The apps were also tiny, the agents ran unsupervised with prompts off, and each cell ran once.

Nor does one file on toy repositories show that rules files are useless; other work has shown a file can steer an agent hard. On this evidence, steering and enforcing are different jobs. For an engineering leader, that suggests treating the rules file as guidance and putting anything that must not happen (production writes, credential use, new dependencies) behind a layer the model cannot reinterpret: a deny list on outbound requests, scoped tokens, no stray secrets in the repo. On this evidence, any agent's "all tests pass" is worth checking against tests the agent did not write, because here that was the only thing that caught the gap. And any vendor or internal guide that calls a markdown file a security control should be asked what measurement backs it.

Sources

  1. Dhuri, S., "Markdown Is Not a Firewall: four coding agents, one rules file, four boundaries" — https://arxiv.org/abs/2611.27112