Practical guide

AGENTS.md for Codex

The objective is to document project rules close to code with clear hierarchy. The review baseline covers scope, commands, tests, protection boundaries and definition of done.

WERKVERSTAND / CONNECTING INTELLIGENCE

The essential answer

AGENTS.md documents working rules for Codex. Global and project guidance is combined in a documented order. The file is not a technical access barrier: required tests, protected destinations and approvals also need appropriate tools and enforceable controls.

01 / FIT

A good fit when

  • A concrete assignment and an accountable domain owner are defined.
  • A new example assignment finds the applicable rules and leads to the correct test commands and a reviewable acceptance decision. Parent and local instructions are consistent within the affected scope.

02 / LIMITS

Not the first choice when

  • AGENTS.md is guidance, not a security boundary. Critical permissions and mandatory checks need additional technical or organisational enforcement.

Know which guidance is actually loaded

Codex first reads global guidance, then project instructions along the path to the current working directory. AGENTS.override.md takes precedence over AGENTS.md at each location. Closer rules can refine or override earlier ones. In nested projects, check the starting directory and discovered instruction chain rather than only the repository-root file.

Write concise rules with verifiable outcomes

A useful project file lists valid build and test commands, important directories and acceptance criteria. Explain how to reproduce a form error or which language variants must be checked. Remove obsolete commands. Long generic warnings add little when the next step and meaningful evidence are unclear.

Combine guidance and enforcement

Text alone does not enforce write protection, network limits or merge rules. Combine guidance with sandboxing, repository protection and appropriate automated checks. Use a fresh test task to find the applicable rule and run the intended test. Evidence is not that AGENTS.md exists, but that rules, tools and observed behaviour agree.

Decision matrix

Decision pointProceed whenStop when
Assignment and inputsDocumented: scope, commands, tests, protection boundaries and definition of done.Scope, data or accountability remains unresolved.
RepeatabilityA new example assignment finds the applicable rules and leads to the correct test commands and a reviewable acceptance decision. Parent and local instructions are consistent within the affected scope.There is only an unevaluated demo without acceptance evidence.
Maintenance and boundariesOwner, approval, fallback and next review date are defined.AGENTS.md is guidance, not a security boundary. Critical permissions and mandatory checks need additional technical or organisational enforcement.

Keep it verifiable

Primary sources

The next sensible step

Which AI system fits your business?

Eight steps from a general interest in AI to a clearer decision for your business.

Start AI System Check
FreeProvider-neutralNo credentials