AI
Review GitHub Pull Requests with Codex
How to turn on Codex review for pull requests, request it with @codex review, and write review rules in AGENTS.md.
Last reviewed:
What it is
Codex reviews the pull request diff, follows your repository guidance and posts a standard GitHub code review focused on serious issues. Security Review is an additional, deeper review for security risks and is described as a research preview.
Set up
- Connect your GitHub repository to Codex. You need GitHub push or admin permission to configure automatic reviews.
- Go to Codex settings.
- Choose the repository and turn on Automatic review under Review code.
- For a manual review, comment @codex review on the pull request, wait for the 👀 reaction and then the review.
Review rules in AGENTS.md
- Codex searches for AGENTS.md files and applies the ## Code Review Rules section in the file closest to the code.
- Put repository-wide rules in the root file and service rules in a nested file inside that service.
- Start with two or three concise rules, and state the impact, why it matters and the safe path.
- Leave mechanical checks such as formatting and lint to CI.
- For a one-off focus: @codex review for issues in the database migration
Automatic reviews
Turn on Automatic review under Personal preferences in Codex settings and pick when it runs with Review trigger. It applies to repositories with code review enabled and needs no @codex review comment.
Common mistakes
- Writing long, generic rules that create noise. (Our tip; the guide says to narrow or remove guidance that produces noise.)
- Relying on the review instead of tests and required approvals.
Next steps
- To write AGENTS.md: the AGENTS.md guide.
- For the security product: Codex Security overview.
Latest updates
No dated update on this topic was found on the official page read on 2026-11-30. We add updates when they appear.
Similar tools
Standalone pages for similar items are added after their official sources are read. We name nothing without a full page.
Related pages
Sources
Wording is ours, from the official source. Images and video belong to their owners and are credited with a link to the official page.