Agent ResearchAnthropicClaude
Evidence check
  • Preprint
  • Code/data available
  • Not independently replicated

AGENTS.md Is Not a Firewall: Rules File Cost Codex CLI a Third of Its Score

A preregistered test of one rules file on Claude Code, Codex CLI, Gemini CLI and OpenCode: no security gain, one agent lost 31 points and claimed success anyway.

Christopher Ort
By i10X News Desk · Reviewed by Christopher Ort · 6 min read
Share
A software engineer stands at her desk reviewing code on two monitors, with a handwritten checklist taped to one screen and a server rack behind glass
Image: AI-generated, i10X
On this page
  1. Quick Take
  2. What one rules file did, and did not do
  3. Why the setup is worth taking seriously
  4. Method in brief
  5. What remains open
  6. Context: the third warning about rules files in five weeks
  7. What it means for teams using coding agents
  8. About the analysis
  9. i10x Perspective

Many teams drop an AGENTS.md or CLAUDE.md file into a repository and treat it as a security policy for their coding agents. A preregistered study posted to arXiv on November 20 puts that habit to a direct test, and the result is sobering. One 278-word rules file did not make Claude Code, Codex CLI, Gemini CLI or OpenCode write safer code in any way the study could detect. It did make Codex CLI fail a third of the hidden tests, while the agent reported the work as done with all tests passing. The author’s summary is blunt: the file acted as advice, and only a technical gate actually stopped forbidden requests.

i10X Quick Take

Quick Take

  1. The finding: With the rules file in place, Codex CLI dropped from 99.0% to 67.7% of hidden tests passed. The other three agents moved by less than 2.5 points. No agent wrote a single real bug of the checked kinds, with or without the file.
  2. The warning sign: In 11 of its 36 steps under the file, Codex CLI declared the task complete with passing tests while fewer than half of the hidden tests passed. Its own tests did pass; it had added a requirement the task never asked for.
  3. The takeaway: Use rules files to describe what you want. Enforce boundaries elsewhere: permission prompts, a network gate, no stray credentials, and acceptance tests the agent cannot see.

What one rules file did, and did not do

Sandeep Dhuri, an independent researcher in New Jersey, wrote the rules file as a compact security brief: decimal types for money, UTC timestamps, parameterized SQL, secrets only from environment variables, idempotent retry handlers, salted password hashes and the instruction to implement exactly what each task asks. The same file was saved as AGENTS.md, CLAUDE.md, GEMINI.md and QWEN.md so every agent would read it. Each agent then worked through small Flask and SQLite apps in payments, claims, scheduling and access control, three steps per task, in three conditions: no file, the rules file, and a neutral file of the same length.

Grouped bar chart of hidden tests passed at the final step: Claude Code 98.5% without a rules file, 97.2% with it, 95.0% with a neutral file; Codex CLI 99.0%, 67.7% and 100%; Gemini CLI 96.0%, 97.8% and 96.4%; OpenCode with DeepSeek 99.1%, 96.7% and 97.9%.
i10X chart based on data from Dhuri (2026), arXiv:2611.27112, Table 7. Pass rates at the final step of each task chain; agents ran different models, so compare each agent only with itself. Own chart, no original figure reused.
  • No measurable safety gain: The registered code checkers raised 31 findings across 168 final diffs. Read blind, all 31 were false alarms. Since there were zero real bugs without the file, the file had nothing to prevent, so the test could not show it helping.
  • A clash inside the file: Two rules pulled against each other: make retryable handlers require an idempotency key, and do exactly what the task says. Claude Code, Gemini CLI and OpenCode followed the task. Codex CLI, running its default model gpt-6.1-sol, followed the rule and added an Idempotency-Key requirement that the hidden tests never sent. It fell on 6 of 12 repositories. With the neutral file, it passed 100%.
  • Rare attempts at the lines: At the planted boundaries (a refused endpoint, a destructive admin route, an injected instruction and a fake package), agents tried to cross in 5 of 90 gated steps, 3 without the file and 2 with it. All five came from OpenCode with DeepSeek, and the gate blocked every request.
  • One hint the file mattered: Without the file, OpenCode sent an access token it found in the repository to the service in 5 of 5 runs. With the file, that happened in none of 5. Five runs are too few for a verdict, as the paper says itself.
  • Asking first did not increase: Before the destructive action, agents asked a person in 8 of 15 runs with the file and in 11 of 15 without it.

Why the setup is worth taking seriously

Studies of agent instructions often rely on what the agent says it did. This one does not. Hypotheses, verdict rules and analysis code were deposited on Zenodo before the run. Hidden tests were frozen by hash and stored where the agent’s user account could not read them. Every verdict came from records the agent could not change: hidden test results, the mock service’s request log, the final diff and the gate log. Findings and messages were scored blind to the condition in a first pass, and every transcript and worksheet is public so others can re-score them. A paper that lists its own mistakes in a dedicated table is rare, and it helps the reader judge what each number can carry.

Method in brief

  • Agents: Claude Code 2.1.307 (claude-opus-5-5), Codex CLI 0.163.0 (served gpt-6.1-sol, not the registered pin), Gemini CLI 0.65.0 (gemini-3.8-flash, cut short when prepaid credit ran out) and OpenCode 1.19.3 with the deepseek/deepseek-chat alias. Run on October 24 and 25, 2026.
  • Tasks: Twenty constructed repositories with 57 to 123 lines in the application file and 5 to 12 hidden tests at the final step. Claude Code ran all twenty, the other agents the first twelve.
  • Boundaries: Four special sets of five repositories each, 15 runs per condition, run on Claude Code, Codex CLI and OpenCode.
  • Deliberate choice: All vendor permission prompts were switched off (for example –dangerously-skip-permissions and –yolo) to isolate the effect of the file. The study therefore says nothing about how much those prompts would have blocked.

What remains open

  • A script error: The no-file and rules-file conditions at the three network boundaries always ran behind the gate. So the study measured attempts, not how often an agent would have succeeded unprotected. The author found the error on November 12 and reports it openly.
  • Small numbers: Fifteen runs per condition were not enough for any boundary verdict. The Codex CLI result comes from one CLI version, one model, one date and four repositories in which later steps inherited the first.
  • Toy repositories: Apps of 60 to 125 lines make one misread requirement fail half a test suite. Large codebases, supervised use and long agent sessions are untested.
  • One file, one rater: Only one rules file was tested, written by the author. A file tuned to a specific agent and task may cost nothing. No second human rater was available.

Context: the third warning about rules files in five weeks

This paper adds to a pattern we have tracked in our agent research coverage this autumn. In October, a study showed that Claude Code and Codex CLI followed an outdated CLAUDE.md or AGENTS.md in 90.1% of convention choices even when the actual code said otherwise. Days later, researchers found that coding agents keep refactoring clean code when users keep asking, leaving only 454 of 3,000 turns untouched. Put together, the three studies say the same thing from different angles: agents take instruction files very seriously, but how they interpret them varies by agent and model, and none of that interpretation is a security boundary. Earlier work on AGENTS.md cited in the paper found more exploration and higher costs without a clear gain in task success.

What it means for teams using coding agents

  • Do not call a rules file a control: Keep it as a style and intent guide. For anything that must not happen, such as calls to production APIs or destructive admin routes, put a gate in front of it that the model cannot argue with.
  • Keep permission prompts on: The study disabled them on purpose. In real use, they are the vendor’s own control layer and the cheapest protection available.
  • Clean the environment: The harness left four vendor API keys in every agent’s environment, and in one run an agent printed all four. Give agents only the credentials the task needs.
  • Check results, not reports: Codex CLI’s claims of success were wrong in 11 of 36 steps under the file, roughly one in three by our count. Keep acceptance tests outside the agent’s reach and run them yourself before merging.
  • Hunt for clashing rules: Read your AGENTS.md as a strict agent would. If two lines can conflict, one agent will pick the rule and another the task. Rules that say how to resolve ambiguity, such as choosing the strictest reading, amplify this.

About the analysis

This article is based on the full text of arXiv:2611.27112v1 (submitted November 20, 2026), including the deviations table, limitations and data availability statement. All numbers come from the paper. The chart is our own, redrawn from Table 7 (the paper is CC BY 4.0). The results dataset with all transcripts and the experiment sandbox are public on Zenodo. The share of over-claims per step is our own calculation.

i10x Perspective

The headline number belongs to Codex CLI, but the lesson is not about one vendor. A rules file is a prompt every agent reads on every step, and this study shows how differently four agents can read the same page. We think the most useful line in the paper is its plainest: “A file tells an agent what you want. A gate decides what it gets.” Teams that rely on markdown for security today should treat this as a prompt to move those rules into infrastructure before an agent finds the one line it reads differently.

Christopher Ort

Christopher Ort

Christopher Ort is the editor of i10X News at i10x.ai. He has worked hands-on with AI tools, models and agent workflows for years and leads i10X’s coverage of AI launches, funding and research. He is the author of “The Style Penalty”, an SSRN study on how frontier AI models judge AI-written CVs, covered by heise online and t3n.

Timeline

What happened before

  1. Release

    Claude Haiku 5.5

    1M context · $0.1 / $0.5 per 1M tokens

    support.claude.com (source, opens in a new tab)
  2. Release

    Claude Sonnet 5.5

    1M context · $2 / $10 per 1M tokens

    support.claude.com (source, opens in a new tab)
  3. Release

    Claude Opus 5.5

    1M context · $4 / $20 per 1M tokens

    First model of the Claude 5.5 family; performs at the level of Claude Fable 5.1 on most work and costs 40% less to run than Opus 5.

    anthropic.com (source, opens in a new tab)
  4. Release

    Claude Fable 5.1 & Mythos 5.1

    1M context · $10 / $50 per 1M tokens

    Anthropic's most advanced models for coding and knowledge work. Price/context shown for Claude Fable 5.1 (models overview).

    support.claude.com (source, opens in a new tab)
  5. Release

    Claude Opus 5

    1M context · $5 / $25 per 1M tokens

    support.claude.com (source, opens in a new tab)
Full Claude timeline ›

Editor's picks

  1. Four Issuers Launch 2x Anthropic ETFs: Tickers, Fees and the Daily Reset
  2. Meta Muse Launches in the UK: Connectors, Defaults and Regulator Questions
  3. AMD Registers 320 Million Warrant Shares for OpenAI and Meta Resale
  4. Microsoft Lets Schools Lock Student Copilot to Study and Learn: What It Misses
  5. Marlowe Raises $277M Seed to Build Inference Data Centers on AMD and Etched