Agent Rules is a community standard for unifying guidelines for AI coding agents via standard
configuration files, promoting interoperability across tools, initially a standard AGENTS.md
file.
AI coding agents often rely on project-specific rules to guide their behavior. However, each tool uses its own configuration files, leading to redundancy and complexity. Agent Rules addresses this by proposing a unified configuration file. This allows developers to define rules once, while agents can incorporate them into their context alongside any proprietary formats. The specification is deliberately lightweight, focusing on natural language in Markdown, to encourage broad support and interoperability.
Initially the standard specifies a single AGENTS.md
file; a simple
specification for minimum
interoperability.
This project is inspired by similar projects such as Editor Config, Semantic Versioning, and Conventional Commits. Rather than have fragmented configuration systems, let's start early to have some common standards
Enhancements to the standards, such as folders, hierarchical files, and structured metadata (such as applicable file globs), to be discussed by the community.
The Agent Rules specification defines the minimal requirements for compatibility, with key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” interpreted as described in RFC 2119:
AGENTS.md
in the project root. If present, its contents SHOULD be included
in the agent's
context scope (e.g., prepended or appended to prompts or system instructions).
AGENTS.md
file in the current
working directory,
incorporating its contents into the context scope alongside the project root AGENTS.md
if
present.AGENTS.md
as default coding conventions in the .aider.conf.yml
file.
read: AGENTS.md
AGENTS.md
in both
the project root and current directory.
AGENTS.md
in the settings.json
file.
{
"contextFileName": "AGENTS.md"
}
AGENTS.md
by default in both the current directory and parent directories.
You may also be able to configure other tools by linking the file they use to AGENTS.md
, for example to configure Claude Code:
On Linux:
ln -s AGENTS.md CLAUDE.md
On Windows:
mklink CLAUDE.md AGENTS.md
While the specification allows flexible natural language, users of 'AGENTS.md' should follow these recommendations for clarity and effectiveness:
AGENTS.md
file- An agent MUST NOT (write code to) injure a human being or, through inaction,
allow a human being to come to harm.
- An agent MUST obey the orders given it by human beings except where such
orders would conflict with the First Law.
- An agent MUST protect its own existence as long as such protection does not
conflict with the First or Second Law.
Suitable additional examples, focussed on software development, are available in several agent projects:
© Sly Gryphon 2025. This work is licensed under a Creative Commons
Attribution 4.0 International
License.