Make review a gate
Review and ship with Codex
Shipping Codex-written code safely means layering checks between the diff and production: /review before commit and codex exec review before push, @codex review on the pull request, openai/codex-action in CI, and deployment with a tested rollback. Codex’s review is one input; the merge decision rests on the evidence all the gates produce together.
This hub is for developers and tech leads whose Codex sessions now produce more pull requests than the team can read line by line. The diffs look tidy, the style is uniform, and the mistakes hide in the places you stopped checking: a missing authorisation check, a skipped test, a migration without a backfill. The pages below replace line-by-line reading with gates you can measure. Commands were checked against Codex CLI 0.157.1.
Which Codex ship page answers your question?
Section titled “Which Codex ship page answers your question?”| Your question | Page |
|---|---|
| How do I make Codex review a team gate, and know it catches real bugs? | Code review with Codex |
| How deep should a human look at each change, and which approval mode fits? | Reviewing agent work without becoming the bottleneck |
| How do I run Codex in GitHub Actions without exposing secrets? | Run Codex in CI/CD with the GitHub Action |
| How does a pull request get from worktree to merge with Codex’s help? | Pull request automation with Codex |
| How do I deploy what Codex built, and roll it back? | Deployment automation with Codex |
If you have never reviewed a Codex change, start with review Codex’s changes before you commit. A gate is only as strong as the tests behind it; see testing and debugging with Codex.
In what order should a Codex change go out?
Section titled “In what order should a Codex change go out?”Cheap, private checks run first, so the public review stays worth reading.
-
Before commit. Run
/reviewin the session, orcodex review --uncommittedfrom the terminal, and fix every P0 and P1 finding (Codex tags each finding P0–P3, P0 most severe). -
Before push. A pre-push hook runs the review as a script and fails on P0 or P1 findings. In a terminal:
Terminal window codex exec review --base origin/main --ephemeral -o .codex-review.mdThe hook itself, and how to check its output format, is on the code review page.
-
On the pull request. Comment
@codex review, and@codex security reviewon authentication, input handling and secrets. Turn on automatic reviews only after yourAGENTS.mdreview rules are tuned. -
In CI. Tests, types and lint run on the pushed branch. Run
openai/codex-action@v1withpermission-profile: ":read-only"and a review prompt, then have a separate step fail the job when the output contains a P0. CI blocks only on P0, looser than the pre-push hook, because P1 findings still reach the pull request and the human owner decides on them there; the CI/CD page builds this gate. Read-only means Codex cannot edit code or tests to make the checks pass. -
At merge. A named human signs off on the escalation paths in
CODEOWNERS: migrations, auth, money, public API contracts, and changes to tests or CI. -
At deploy. Ship behind a flag or a canary with a rollback you have run at least once.
How do you know a Codex change is safe to ship without reading every line?
Section titled “How do you know a Codex change is safe to ship without reading every line?”Each gate produces evidence someone owns. Read the evidence; open the diff where it points.
| Evidence | What it proves | Owner |
|---|---|---|
| Seeded-bug catch rate of the Codex reviewer | The review finds the defect classes you care about | Tech lead |
| CI green on the pushed branch: tests, types, lint | Existing behaviour still holds | CI |
| Codex findings gate with no P0 (P1 goes to the human owner) | No blocking issue by your own AGENTS.md rules | Owner of the CI review prompt and workflow (under CODEOWNERS) |
Approval on CODEOWNERS escalation paths | A person accepted the risk where a miss is expensive | Named code owner |
| Canary metrics and a rehearsed rollback | Production confirms it, or you can undo it quickly | On-call engineer |
What an agent’s pull request should carry is defined in the evidence bundle, and the triage that uses it in reviewing an agent’s pull request without reading every line.
What breaks between an approved diff and a running deployment?
Section titled “What breaks between an approved diff and a running deployment?”| Symptom | Cause | Recovery |
|---|---|---|
| The team ignores Codex comments | Too many P2 and P3 findings | Report only P0 and P1 on pull requests; add a “Do not flag” line per noise category to AGENTS.md |
codex exec review --base main "focus on auth" fails | In 0.157.1, --base, --commit and --uncommitted each reject a custom prompt | Drop the prompt and put the focus in AGENTS.md |
| A pull request weakens its own CI review | Prompts and workflows load from the pull request’s merge commit | Put .github/ under CODEOWNERS |
| A secret leaks from a PR-triggered job | Untrusted code ran with secrets in the environment | Follow agent identity and secrets before enabling the trigger |
| The reviewer approves the code it wrote | Same model, same session | Set review_model to another model and review in a fresh process |
| Rollback fails in production | A migration dropped data the old code needs | Split it with expand and contract; never ship a destructive migration with the code that needs it |
Where to go next with shipping Codex changes
Section titled “Where to go next with shipping Codex changes”Harden CI
Operate what shipped
Across all tools
Using another agent as well? The same stage is covered in review and ship with Claude Code and review and ship with Cursor.