The Codex CLI source lives at github.com/openai/codex under Apache 2.0. Separately, Codex integrates with GitHub to review pull requests: connect a repository in Codex cloud, enable review at chatgpt.com/codex/settings/code-review, and then comment @codex review on any pull request. For CI, openai/codex-action@v1 runs codex exec inside a workflow and returns the final message as an output.
- The repository is
github.com/openai/codex, Rust, Apache 2.0. - Review is enabled per repository at
chatgpt.com/codex/settings/code-review. @codex reviewon a pull request triggers a review; issues are flagged P0 or P1.@codex fix the P1 issuemakes it act on its own findings.- Review standards go in
AGENTS.mdunder a## Code Review Rulesheading. - CI is
openai/codex-action@v1, which needs an API key, not your ChatGPT plan.
Which of the three do you want
| You mean | It is | Where |
|---|---|---|
| The source code | The Codex CLI repository | github.com/openai/codex |
| A bot reviewing my PRs | Codex code review | chatgpt.com/codex/settings/code-review |
| Codex inside CI | The Codex GitHub Action | openai/codex-action@v1 |
| Starting tasks from issues | Codex cloud, GitHub connected | chatgpt.com/codex |
The repository
The Codex CLI is open source at github.com/openai/codex, written in Rust, licensed Apache 2.0. Releases are tagged rust-v<version> and each one publishes per-platform archives plus a DotSlash file, which is how you pin a whole team to one version.
git clone https://github.com/openai/codex.git
cd codex/codex-rs
# Rust toolchain if you do not have one
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
cargo build
cargo run --bin codex -- "explain this codebase to me"
Codex reviewing your pull requests
This is the integration most people mean. Codex reads a pull request diff, applies whatever guidance your repository carries, and comments with findings ranked P0 and P1.
Set up Codex cloud for the repository
Sign in at chatgpt.com/codex, connect GitHub, and select the repositories Codex may access. Review runs on the cloud side, so a repository that is not connected cannot be reviewed.
Enable code review
Open chatgpt.com/codex/settings/code-review and turn review on for the repository. You need push or admin permission on it.
Choose manual or automatic
Manual means Codex reviews only when mentioned. Automatic means every new pull request gets a review with no mention at all. Start manual on a busy repository, or the first day is very noisy.
Mention it
@codex review
Comment that on a pull request. Codex replies with its findings on the diff.
The mention commands
Comment these on a pull request or issue.
| Comment | What it does |
|---|---|
@codex review | Review the diff, flag P0 and P1 issues |
@codex security review | Deeper security-focused pass |
@codex fix the P1 issue | Act on its own finding and push a change |
@codex <anything else> | Treats the comment as a task |
Teaching it your standards
Codex reads AGENTS.md for review guidance, under a dedicated heading. Nested files apply too: it uses the AGENTS.md closest to the code a change touches, so a monorepo can hold different rules per service.
## Code Review Rules
- Flag any new database query that is not behind the repository layer.
- Reject `any` in TypeScript unless the line carries a justification comment.
- Public API changes must update `docs/api.md` in the same pull request.
- Do not comment on formatting. The formatter owns that.
Starting work from GitHub
Once GitHub is connected, Codex cloud tasks can start from a pull request or an issue rather than from the web interface. Linear and Slack connect the same way. The task runs in a cloud environment you configure at chatgpt.com/codex/settings/environments, against a clone of the repository.
What the cloud path can and cannot see.
| Codex cloud | Codex CLI locally | |
|---|---|---|
| Pushed code | Yes | Yes |
| Your uncommitted work | No | Yes |
| A local database or service | No | Yes |
| Your environment variables | Configured secrets only | Yes |
| Runs with your laptop closed | Yes | No |
The GitHub Action
Separate from the review bot. openai/codex-action@v1 installs the CLI on a runner and executes codex exec with a prompt, which is how you get Codex into a workflow you control.
name: Codex review
on:
pull_request:
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Run Codex
id: run_codex
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/review.md
sandbox: read-only
output-file: codex-output.md
- name: Comment
run: gh pr comment "$PR" --body-file codex-output.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
The inputs that matter.
| Input | Values | Notes |
|---|---|---|
openai-api-key | A secret | Required |
prompt / prompt-file | Text or a path | One or the other, not both |
sandbox | read-only, workspace-write, danger-full-access | Use read-only for review |
safety-strategy | drop-sudo (default), unsafe | unsafe is required on Windows runners |
output-file | A path | Lets a later step post it |
The action also exposes the agent's final message as the final-message output, so you can branch on it or post it without writing a file. Check out the repository before the action runs, or Codex has nothing to read. Linux and macOS runners work as-is; Windows runners need safety-strategy: unsafe, which is exactly as blunt as it sounds.
Reviewing locally before any of this
The CLI has its own review command, which costs nothing extra on a subscription and catches the embarrassing findings before a reviewer sees them.
# review the working tree against the base branch
codex review
# a focused, non-interactive pass you can pipe
codex exec -s read-only "review the staged diff for security issues, P0 and P1 only"
Questions people ask
github.com/openai/codex. It holds the Codex CLI, written in Rust and licensed Apache 2.0. Releases are tagged rust-v<version> and publish per-platform binaries plus a DotSlash file for pinning a team to one version.
Connect the repository in Codex cloud at chatgpt.com/codex, then enable review at chatgpt.com/codex/settings/code-review. After that, commenting @codex review on a pull request triggers a review, or you can turn on automatic review for every new pull request.
@codex review for a diff review, @codex security review for a deeper security pass, and @codex fix the P1 issue to make it act on its own findings. Any other text after @codex is treated as a task.
Add a "## Code Review Rules" section to AGENTS.md. Codex applies the AGENTS.md closest to the changed code, so a monorepo can carry different rules per service, with repository-wide rules at the root.
Push or admin permission on the repository, plus a connected GitHub account in Codex cloud. Without push access the settings page will not let you enable it.
No. openai/codex-action@v1 authenticates with an OpenAI API key and bills per token on the platform. Your ChatGPT plan covers the CLI, app, IDE extension and cloud, not CI runs.
Yes, if you give it workspace-write and a token with write permission. For review workflows use sandbox: read-only, which structurally prevents it from changing anything on the runner.
Yes, but it needs safety-strategy: unsafe, because the default drop-sudo privilege handling does not apply there. Linux and macOS runners work with the defaults.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.