A useful AGENTS.md records commands and constraints that are true today—not a generic coding manifesto.
The decision behind the technique
Codex can draft the file from the repository, but it cannot know undocumented team conventions or hidden deployment risks. Treat the generated file as a first inventory that a maintainer must review.
A useful AGENTS.md records commands and constraints that are true today—not a generic coding manifesto.
A practical step-by-step workflow
Use this sequence as a default, then tighten or expand it only when the evidence changes.
- Generate a draft from the repository root
- Replace guessed commands with commands you have run
- Add safety boundaries and the definition of done
- Test it on one fresh task and remove ambiguity
Failure boundary and finish line
Never put tokens, private endpoints or copied environment-variable values in AGENTS.md.
Finish when the configuration is smaller, reproducible and still preserves every required safety boundary.
Frequently asked questions
What should I do first?+
Generate a draft from the repository root
What is the main failure mode?+
Never put tokens, private endpoints or copied environment-variable values in AGENTS.md.
OFFICIAL SOURCES
Verify against the source
OpenAI AGENTS.md guidanceThis guide provides general information, not an OpenAI allowance promise or support decision. Your account and official pages govern actual usage, benefits and recovery times.