How to enable PR security reviews with Codex Security

OpenAI

OpenAI shows Codex Security reviewing GitHub pull requests, from manual request to automatic scans

In a six-minute walkthrough, OpenAI's Dan Shanahan runs a security review on a pull request, has Codex fix a cross-site scripting flaw, then switches on automatic reviews for a whole repository.

Dan Shanahan, from the cyber deployment engineering team at OpenAI, demonstrates how Codex Security can review pull requests for vulnerabilities before the code reaches production. The video follows one change through a full loop: request a review, fix what is found, check the fix, then set the process to run on its own.

Setting up the Codex connector in GitHub

The only prerequisite is the ChatGPT Codex connector app in GitHub. Shanahan checks it under the repository's settings and GitHub apps. If a team does not have it, he says, the workspace administrator and the GitHub repository or organization owner need to install it, which he describes as straightforward.

Requesting a security review and fixing a flaw

With the app in place, Shanahan opens a pull request and leaves a comment tagging Codex to run a security review. A summary comes back in the comment thread, and the findings can be worked with directly inside the pull request.

GitHub pull request page showing a comment from Codex review summarizing the results of a completed security scan.
A Codex security review summary appears in the pull request comments after being requested.

To fix the problem, he copies a link to the pull request into Codex and asks it to repair the finding. Codex examines the codebase, writes a fix for the cross-site scripting issue it found and publishes the commit to the pull request. Shanahan then asks for a second review, which reports that no issues were found.

Automatic reviews and severity thresholds

Manual requests mean someone has to remember to ask. To remove that step, Shanahan opens the Codex app settings and scrolls to the code review section. There he can turn on personal security review preferences, choose whether reviews run when a pull request opens or on every push, and set the severity threshold for alerts, for both manual and automatic reviews.

Codex app settings page on code review, with security review toggles, review cadence and severity threshold options.
Code review settings in the Codex app, where repository-level security reviews and triggers are configured.

A personal setting only covers pull requests he opens himself. Many organizations will want coverage across a repository, so he switches the personal preference off and enables the repository-level review security vulnerabilities toggle. He changes the review cadence to all pull requests, so every new one is scanned whoever creates it, and sets the trigger and thresholds again.

The same settings area lets teams view the agents markdown and security markdown files. These are instruction files added to a repository to help Codex understand its particulars.

Automatic scan on a new pull request

To finish, Shanahan opens a pull request from a branch he prepared with known vulnerabilities. After a short wait, a Codex security review appears on its own and reports the issues it identified. His closing advice is to try it on the next review waiting in your inbox.

Questions and answers

How does Codex Security review pull requests on GitHub?

Codex Security reviews a GitHub pull request when a user comments on it tagging Codex and asking for a security review. A summary of findings comes back in the comment thread, and the findings can be worked on inside the pull request. OpenAI's Dan Shanahan demonstrated this.

What does OpenAI's Codex Security walkthrough show?

OpenAI's six-minute walkthrough, presented by Dan Shanahan of the cyber deployment engineering team, follows one pull request through a full loop. He requests a security review, has Codex fix a cross-site scripting flaw, checks the fix with a second review, then turns on automatic reviews for a whole repository.

What is needed to use Codex Security on a GitHub repository?

The only prerequisite is the ChatGPT Codex connector app in GitHub, which can be checked under the repository's settings and GitHub apps. If a team lacks it, the workspace administrator and the GitHub repository or organization owner need to install it, which Dan Shanahan describes as straightforward.

How does Codex fix a security flaw found in a pull request?

Codex fixes a finding when the user pastes a link to the pull request into Codex and asks it to repair the issue. In OpenAI's demonstration, Codex examined the codebase, wrote a fix for the cross-site scripting flaw and published the commit to the pull request. A second review then reported no issues.

How can a team make Codex Security review every pull request automatically?

A team can enable the repository-level review security vulnerabilities toggle in the Codex app settings, under the code review section, and set the review cadence to all pull requests. Every new pull request is then scanned whoever creates it. Teams also set the trigger, on pull request open or every push, and the severity threshold.

What is the difference between personal and repository-level Codex Security reviews?

A personal Codex Security setting only covers pull requests that the user opens. The repository-level setting covers every new pull request in the repository, whoever creates it. Dan Shanahan of OpenAI switched his personal preference off and enabled the repository toggle for that reason, as many organizations want repository-wide coverage.

From the YouTube description

Bring security reviews into your pull request workflow with Codex Security. Learn how to check your GitHub connection, request a review, work through a fix, and review the change again. Then configure automatic reviews for your repository, including triggers and severity thresholds.

Watch on YouTube

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.