News

How to turn on automatic Codex security reviews for GitHub pull requests

Codex Security Review checks pull requests for security issues, on request or automatically. Here is what you need, how to start it, how to cover every pull request and which thresholds decide what gets posted in GitHub.

Theo · FoxAI World5 min read
18
Theo points toward a laptop with the GitHub logo and stylized code, beside a security panel and a robot with the OpenAI logo.Codex PR security

Conceptual cover created with AI.

A pull request can look harmless in review and still carry a cross-site scripting bug into production. Codex Security Review is OpenAI’s attempt to catch that kind of problem while the change is still a pull request. You can start it by hand with one comment, or let it run on every new pull request in a repository. Here is how both routes work, what you need first and which settings decide what your team actually sees.

What you need before the first review

Security Review is a deeper review of a pull request that looks specifically for security issues. OpenAI describes it as a research preview. It is available to ChatGPT Enterprise, Business, Edu and Pro customers, not to Plus. Each review uses your included Codex allowance or ChatGPT credits, so automatic reviews on a busy repository are not free of cost.

Before it works, three things must be in place. Your workspace needs access to Codex Security Review. Codex cloud must be set up with your GitHub repository connected, which in practice means the ChatGPT Codex connector app is installed on that repository. And you need push or admin permission on the repository to change its settings. If the connector is missing, your workspace administrator and the owner of the GitHub organization or repository have to install it. An earlier Codex Security scan of the code is optional.

Theo holds an OpenAI-branded laptop beside a monitor showing stylized code, security symbols and a robot.
AI-generated conceptual illustration.

How to start a manual review

Open the pull request and write a comment: @codex security review. Codex reacts to the comment while it works and then posts the findings that meet your manual reporting threshold. The comment in GitHub is only a short view. The full report sits in the related Codex task under the Security Report tab. It lists the severity, the attack path, the evidence, how the finding was validated and guidance on how to fix it.

One detail is easy to miss. If no finding reaches your threshold, Codex posts nothing. Silence in the pull request does not prove that a review ran and came back clean. Check the task status in Codex before you assume the change is fine.

The remediation guidance is also your next step. You can hand the finding to Codex in a task, let it prepare a fix on the branch and then comment @codex security review again to check that the issue is gone.

How to make every pull request get a review

Manual requests depend on someone remembering to ask. For a team, the automatic route is the more reliable one. In Codex settings, choose the repository and turn on Auto security review. Two settings then define its reach.

The first is Review, which decides which pull requests are covered. Follow personal preferences means only contributors who opted in get reviews. All PRs covers every pull request in the repository, no matter who opens it. Team PRs, where available, covers pull requests from members of your workspace. Note that this means workspace members, not GitHub teams.

The second is Trigger, which decides when a review runs: On PR open, On every push, or Whenever code review runs. The last option requires Codex Code Review to be enabled. Repository settings are shared and apply to every pull request the Review setting selects. Connecting GitHub or turning on personal reviews does not create an extra review per person, and later pushes can start new reviews depending on the trigger.

If you want full coverage, the combination is simple: All PRs, plus On every push if your branches change a lot after opening. On PR open uses fewer reviews but can miss code that arrives in later commits.

Which findings get posted, and why that matters

A reporting threshold is the minimum severity a finding must have before Codex posts it to GitHub. By default, automatic reviews post High and Critical findings. Manual reviews post Medium, High and Critical. You can set each minimum separately and add overrides for specific paths, for example a stricter rule for an authentication folder.

The threshold only controls what appears in GitHub. The full report stays in Codex. That split matters because anything posted to a pull request is visible to everyone who can see that pull request. On a public repository, that includes people outside your workspace.

Which door are we opening? On a private repository, a lower automatic threshold mostly means more comments to read. On a public one, every posted finding describes a weakness in public before the fix is merged. My reading of the defaults is that they are sensible for public projects. I would lower the automatic threshold only on private repositories, and rely on the Codex report for the rest. That is my own assessment from how the settings are documented, not an OpenAI recommendation.

How to tell Codex what matters in your code

Codex reads AGENTS.md files in the repository. These are plain instruction files for coding agents. For code review, you add a section called ## Code Review Rules. Rules for the whole repository go in the root file, rules for one service go in a nested file next to that service. OpenAI suggests starting with two or three short rules and refining them once you see the results.

For security reviews, threat-model context also counts. A threat model is a description of what an attacker might target and how. You can reuse the threat model from an existing Codex Security scan or point to a threat model file in the repository. Without either, Codex builds a new threat model for every review. Keeping one stable file gives your reviews a consistent baseline.

The practical order, then: install the connector, try one manual review on a small pull request, read the full report in Codex, and only then switch the repository to All PRs with thresholds that fit its visibility.

Ask AI about this article

Opens in a new tab with the question filled in.

Sources and research

Written by FoxAI World. The cover and illustrations are AI-generated conceptual artwork.

Your favourites

This list stays in this browser on your device. No account is needed, and other visitors cannot see it.

Use a story’s bookmark button to add your first favourite.