Coding agents are helping rewrite the repository instructions that govern their behavior, raising concerns about how developers review and enforce those rules.
New research from University of Washington PhD student Reshabh K. Sharma finds that the number of AGENTS.md files on GitHub has grown 70-fold since August 2025.
Of GitHub’s 100 most-starred repositories, 52 contain agent instruction files, and 33 of those repositories have at least one commit modifying the instructions attributed to AI.
“The biggest risk is the weakening of the rules by the AI to make its work easier.”
“The biggest risk is the weakening of the rules by the AI to make its work easier,” Sharma tells The New Stack. “These changes can include subtle word changes that weaken the rules and are easy to miss during code reviews.”
Instruction files are exploding
Sharma finds AGENTS.md files at the root of roughly 719,000 repositories, excluding forks, and archived projects. Between September and November, the number of CLAUDE.md files grew from 700,000 to 1.1 million, outpacing AGENTS.md growth by 11 percentage points.
“Other than the growth, I’m surprised that about half of these files are not at the root level of the repos,” Sharma tells The New Stack. “This implies that developers are actually writing different agent instruction files for different parts of the project.”
He sees an opportunity for further research into how developers can maintain consistency between instructions at different levels of a repository and enforce them collectively.
When AI rewrites the rules
Of the 2,573 commits to instruction files in the 52 repositories studied, 393 name AI as an author or co-author. Even after removing garrytan/gstack, which accounts for 101 of those commits, the percentage attributed to AI climbs from 6% in the final quarter of 2025 to 22% between October 1 and November 27, 2026.
The commit data does not account for undisclosed AI contributions or indicate whether humans reviewed the changes.
Instruction compliance varies by model and harness
Among the studies Sharma cites is a November preprint from Rikuto Tsuchida and colleagues, who tested four ways of wording a repository policy across 86 benchmark tasks and four model-harness combinations. Agents followed conditional instructions less often than prescriptive or explanatory instructions, though the most effective wording varied by model and harness.
A November 10 preprint finds that aggregate compliance rates can mask individual instructions that agents routinely ignore.
Compliance slips as code grows
A May 2026 study of 1,650 Claude Code CLI sessions across two TypeScript codebases finds that each additional function generated reduces the estimated odds of instruction compliance by 5.6%. Researchers find no statistically significant effect from instruction placement or file size after correcting for multiple comparisons.
“Ideally, we would want these files to be as precise as possible, and even then, different models can decide to interpret them differently.”
“Ideally, we would want these files to be as precise as possible, and even then, different models can decide to interpret them differently,” Sharma says.
This complicates verifying agent-generated implementations because an agent can pass a repository’s test suite while introducing a prohibited dependency or violating an architectural boundary.
Turning instructions into executable checks
Sharma is developing InstructGuard, formerly known as ContextCov, an open-source framework that converts natural-language repository instructions into executable checks.
The earlier version of the research won the best paper award at the Agentic Software Engineering Workshop at ACM CAIS 2026, Sharma says. The revised paper, “InstructGuard: Specifying and Enforcing Agent Behavior from Instruction Files,” was accepted without revision at the 2027 International Conference on Software Engineering, he says.
InstructGuard uses regular expressions and Tree-sitter for source code checks, dependency graphs to detect architectural violations, and PATH shims to intercept prohibited shell commands, including restrictions on package manager usage and Git operations.
Teams can run static and deterministic architectural checks offline in CI or pre-commit hooks. LLM-based semantic checks issue warnings rather than block execution and can be disabled with the –no-semantic flag.
In tests across 300 SWE-bench Lite tasks, ContextCov achieves 88.3% constraint compliance, compared with 67% for prompt-only guidance and 50.3% for LLM reflection. Sharma reports a 3.4-fold reduction in feedback costs without compromising functional correctness.
The research assumes a non-adversarial repository and checks that execute without write permissions. However, the project’s documentation warns that InstructGuard executes LLM-generated Python code with the privileges of the running process. Sharma recommends using the framework only with trusted repositories and instruction files and reviewing generated checks before enforcement.
Sharma says developers could use other deterministic mechanisms to enforce repository instructions, including formal specifications.
“Any deterministic layer like code or a formal specification can act as a precise artifact of what the agent instruction files mean.”
“Any deterministic layer like code or a formal specification can act as a precise artifact of what the agent instruction files mean,” Sharma tells The New Stack. “They can be used for reviewing the changes in the agent instruction files themselves or act as an artifact for catching regression.”
Testing changes to agent instructions
InstructGuard hashes each Markdown section’s header path and content, so regenerating checks after an edit requires no additional LLM calls for unchanged sections.
Sharma recommends running checks generated from both versions of an instruction file against the same codebase to determine whether a proposed edit weakens an existing constraint.
He also suggests testing different versions of instruction files to assess agent compliance, though reliable evaluation methods remain elusive.
“Right now, there is no good way to test how good these files are, as each one is written for a specific project,” Sharma says.
AI Engineer Step by step guide to becoming an AI Engineer in 2026 Introduction Working With LLMs Context Engineering AI Models Embeddings & Vector Databases Embedding Models RAGs AI Agents AI Safety and Ethics Evaluation & Observabiity
YOUTUBE.COM/THENEWSTACK
Tech moves fast, don’t miss an episode. Subscribe to our YouTube channel to stream all our podcasts, interviews, demos, and more.