Codex GitHub Integration
Codex integrates deeply with GitHub, allowing code review directly in pull requests. This section explains in detail how to configure and use GitHub integration.
Feature Overview
With GitHub integration, you can:

- Request Codex reviews directly in PR comments
- Automatically review every pull request
- Have Codex fix CI failures
- Review code changes and provide suggestions
Without leaving GitHub, Codex replies to review comments just like a teammate.
Setting Up GitHub Integration
Precondition
- Codex Cloud subscription
- GitHub account
Configuration steps
- Settings Codex Cloud
- Go to Codex settings
- Enable for the repository Code review Function
- Authorize Codex to access your repositories
You need to grant Codex permission to read repositories and create pull requests.
Request a code review
Trigger a Review Manually
Mention in a pull request comment @codex review:
Request a review
Enter in a PR comment:
@
codex review
Or specify review focus
@
codex review
for
security regressions
Codex Response
Codex will:
- React to the PR (👀)
- Analyze code changes
- Publish review comments
- Flag issues found (P0 and P1)
Codex posts review comments on the PR just like a human reviewer.
Automatic Review
Enable in settings Automatic reviews:
- Go to Codex settings
- Enable Automatic reviews
- Automatically publish a review when a new PR is opened
Customize Review Content
Set repository review guidelines
In the repository's AGENTS.md add review guidelines:
Add Review Guidelines
Review guidelines
Don't log PII
(
Personally Identifiable Information
)
Verify that authentication middleware wraps every route
Check for SQL injection vulnerabilities
Ensure error messages don't leak sensitive information
Module-specific rules
Place more specific review rules in subdirectories:
Module-specific rules
src/payment/ module review rules
Payment-specific reviews
Verify payment processing follows PCI compliance
Check for proper amount validation
Ensure transaction logging
More specific rules automatically apply to code changes in the corresponding module.
One-time Review Focus
Specify review focus in a comment:
Specify Review Focus
Comment Example
@
codex review
for
security issues
@
codex review
for
performance regressions
@
codex review
for
documentation completeness
Give Codex Other Tasks
Mention in a comment @codex(not review) starts a cloud task:
Other Tasks
Fix CI failures
@
codex fix the CI failures
Add tests
@
codex add tests
for
the new API endpoints
Refactor code
@
codex refactor this
function
to use async
/
await
Using Codex's other features is as simple as @-mentioning it in a comment.
GitHub Actions integration
You can also use Codex in GitHub Actions:
GitHub Actions Workflow
span style="color: green;">
name
:
Codex Review
on
:
[
pull_request
]
jobs
:
codex-review
:
runs-on
:
ubuntu-latest
steps
:
- uses
:
actions/checkout@v4
- name
:
Run Codex Review
run
: |
codex exec "Review code changes in this PR" --output review.md
- name
:
Post Review
uses
:
actions/github-script@v7
with
:
script
: |
const fs = require('fs');
const review = fs.readFileSync('review.md', 'utf8');
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
body: review,
event: 'COMMENT'
});
Integrating Codex into CI/CD pipelines automates code review.
Best Practices
Review Guidelines
- Clearly define review criteria in AGENTS.md
- Set specific rules for different modules
- Specify issue priority (P0/P1)
Automation
- Enable automatic review for regular PRs
- Use manual triggering for large changes
- Use with automated workflows
Good configuration makes Codex's reviews more accurate and efficient.
Common questions
Q: Does Codex review require payment?
GitHub integration requires a Codex Cloud subscription.
Q: Can Codex access private repositories?
You need to authorize Codex to access your private repositories.
Q: Can you limit which repositories Codex reviews?
Yes, you can selectively authorize repositories in settings.
Q: Which severity levels of issues does Codex flag?
By default, it flags P0 (critical) and P1 (important) issues.