AGENTS.md examples
Repository guidance
AGENTS.md gives a coding agent project instructions. Use it for facts that should apply repeatedly, such as the test command, the source folders and rules for handling generated files. A task-specific bug report belongs in the task brief so it does not become a permanent instruction.
For a fictional shipping application, a short entry could say: “Order logic lives in src/orders. Run the order tests after changing it. Preserve the public response fields. Never copy customer records into a prompt.” Each sentence describes a decision the agent would otherwise have to guess.
Scope and enforcement
Codex discovers instruction files along the path from the repository root to its working directory, with overrides and size limits described in the official AGENTS.md guide. These conventions were checked on November 14, 2026. Other tools can load the same file differently, so check the tool’s documentation.
Written instructions do not prevent a process from reading a secret or reaching the network. Pair the guidance with access controls. Practice permission boundaries and compare the separate CLAUDE.md example.