Codex Code Review Rules in AGENTS.md (July 2026)
OpenAI shipped custom repository rules for Codex Code Review. Put the checks your team keeps repeating into AGENTS.md — Codex cites them on pull requests.
In July 2026 OpenAI launched custom Code Review rules for Codex. The useful change is not another style linter — it is a way to encode the judgment that usually lives in a few reviewers’ heads: API contracts you must not break, fields that must stay for older clients, data that must never hit logs.
What changed
- Same AGENTS.md, new job — the file that already steers coding tasks can now steer GitHub reviews.
- ## Code Review Rules — add a dedicated section; Codex applies rules that cover the changed files and cites them in findings.
- Root + nested files — repo-wide rules at the root; service-specific rules next to the code they govern.
- Trigger — comment
@codex reviewon a PR, or turn on automatic reviews in Codex settings.
A minimal rule that pays for itself
Start with one check reviewers keep repeating. OpenAI’s own Codex repo protects experimental wire names that Cloud consumers still depend on. Your version might look like:
- State the invariant (what must stay true).
- Name the safe path (keep the name, or add a backward-compatible event).
- Keep it short — broad rules create noise; scoped rules recover findings without spamming clean diffs.
How to try it this week
- Enable Codex cloud + Code Review for the repository.
- Add two or three rules under
## Code Review Rulesin the nearest AGENTS.md. - Open a PR that should trip a rule, one safe counterexample, and one unrelated change.
- Request
@codex review— refine any noisy wording, then keep the rules that fire cleanly.
How this fits the rest of Codex
Rules sit beside Skills and MCP. Skills encode how to do a recurring job; AGENTS.md encodes what must never break. For free-tier stretch tips see Try Codex; for installable playbooks see our updated Skills directory. Official write-up: Custom Code Review rules for Codex.
If review is the bottleneck while agents ship more PRs, start with one repeated explanation — write it once in AGENTS.md and let Codex cite it on every pull request.