Codex and GitHub: reviews, mentions, and the Action

Searching "codex github" lands on three unrelated things. One is the source repository, one is a bot that reviews your pull requests, and one is a GitHub Action for CI. This page separates them, then covers all three.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

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.

What you need to know
  • The repository is github.com/openai/codex, Rust, Apache 2.0.
  • Review is enabled per repository at chatgpt.com/codex/settings/code-review.
  • @codex review on a pull request triggers a review; issues are flagged P0 or P1.
  • @codex fix the P1 issue makes it act on its own findings.
  • Review standards go in AGENTS.md under a ## Code Review Rules heading.
  • CI is openai/codex-action@v1, which needs an API key, not your ChatGPT plan.

Which of the three do you want

You meanIt isWhere
The source codeThe Codex CLI repositorygithub.com/openai/codex
A bot reviewing my PRsCodex code reviewchatgpt.com/codex/settings/code-review
Codex inside CIThe Codex GitHub Actionopenai/codex-action@v1
Starting tasks from issuesCodex cloud, GitHub connectedchatgpt.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.

Building it yourself, from the repository's own instructions.
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.

01

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.

02

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.

03

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.

04

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.

CommentWhat it does
@codex reviewReview the diff, flag P0 and P1 issues
@codex security reviewDeeper security-focused pass
@codex fix the P1 issueAct 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.

AGENTS.md, at the repository root or beside a 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 cloudCodex CLI locally
Pushed codeYesYes
Your uncommitted workNoYes
A local database or serviceNoYes
Your environment variablesConfigured secrets onlyYes
Runs with your laptop closedYesNo

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.

.github/workflows/codex-review.yml
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.

InputValuesNotes
openai-api-keyA secretRequired
prompt / prompt-fileText or a pathOne or the other, not both
sandboxread-only, workspace-write, danger-full-accessUse read-only for review
safety-strategydrop-sudo (default), unsafeunsafe is required on Windows runners
output-fileA pathLets 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.

  1. Codex documentation: GitHub integration
  2. Codex documentation: GitHub Action
  3. Codex documentation: cloud
  4. openai/codex on GitHub
Try it

The PR,
next to the diff.

Continuum shows the pull request each agent session opened, with state, checks and review status beside the change it made.

free app · your subscriptions · local-first