AI Tools7 min read

OpenAI Codex Security vs GitHub Copilot Autofix

OpenAI Codex Security and GitHub Copilot Autofix both use AI to fix security bugs. How they differ: workflow, where fixes appear, access, cost and limits.

By AI Agents DirectoryLast checked
Side of a building covered in rows of lights

OpenAI’s Codex Security and GitHub’s Copilot Autofix both use language models to repair security bugs. They start from different places, though. OpenAI’s tool hunts for vulnerabilities itself and then proposes patches. GitHub’s Autofix waits for CodeQL code scanning to raise an alert and then suggests a fix for that alert. This post explains how each one works today, where the fixes show up, who can use them and what both vendors say can go wrong. Every fact comes from OpenAI’s and GitHub’s own documentation.

A note on Aardvark

Earlier versions of this page compared GitHub’s tools with OpenAI’s Aardvark. The only Aardvark reference we could confirm in OpenAI’s documentation is in the Codex Security CLI reference, which lists the default cloud API root as https://chatgpt.com/backend-api/aardvark. We could not load OpenAI’s original Aardvark announcement, so this post describes Codex Security as it is documented now and makes no other claims about Aardvark.

At a glance

OpenAI Codex SecurityGitHub Copilot AutofixGitHub agentic autofix
What triggers itA scan you start, commit monitoring, or a pull request reviewA CodeQL code scanning alertYou assign one or more alerts to Copilot
What it producesFindings with evidence, then patches you generate and verifyOne suggested change plus an explanationA draft pull request after Copilot validates the fix
Where you see itCodex desktop app, ChatGPT web, CLI reports, pull request commentsInline on the pull request or the alert pageA draft pull request
SetupInstall a plugin or the @openai/codex-security npm packageNone beyond enabling CodeQLAn owner or security manager turns it on
RepositoriesLocal checkouts, plus GitHub for the cloud serviceGitHub onlyGitHub only

How Codex Security finds and fixes issues

OpenAI ships Codex Security in four forms. The plugin scans a local repository inside Codex. Codex Security Cloud scans connected GitHub repositories in Codex cloud and can watch new commits; OpenAI labels it a research preview. The CLI and SDK come from the public @openai/codex-security package, released under Apache-2.0, for terminal runs, CI jobs and custom tooling.

A cloud scan works like this. You install the Codex Security Cloud plugin, link your own GitHub account, pick a repository and run a one-time scan. Each finding lists the affected code, a likely attack path and whatever validation evidence the scan gathered. From there, two fix routes exist:

  • Fix with Codex opens a Codex conversation that re-checks the finding against current code, writes a fix and runs relevant tests.
  • Findings from continuous scanning of the default branch may carry a suggested patch, which you review before choosing Create draft pull request.

The local plugin is stricter about separating stages. Generating a patch leaves your checkout untouched. Applying it changes the working tree. A separate Verify fix step reruns the original reproducer or exploit check and, where it can, confirms a regression test fails before the change and passes after. Verification still does not close the finding; you decide that.

From a terminal, OpenAI’s quick start is two commands after the npm install:

npm install --global @openai/codex-security
cs login
cs scan .

The CLI reference also covers patching straight from a scan, including opening a pull request:

codex-security patch --scan SCAN_ID --assess-patch-risk --create-pr

There is also Codex Security Review for pull requests. Once switched on in Codex settings, it reviews a PR’s diff when it opens, on every push, or alongside Codex Code Review. You can also ask for one by commenting @codex security review. Findings that meet your severity threshold go onto the pull request, and the full report stays in Codex. One detail to plan for: those posted findings are visible to anyone who can see the PR, which matters on public repositories.

How GitHub Copilot Autofix works

GitHub Copilot has two separate autofix features for code scanning alerts.

Copilot Autofix does not look for bugs. CodeQL does that, and Autofix turns a CodeQL alert into a proposed code change with a plain-language explanation. GitHub builds the prompt from the alert data, code snippets around the source and sink locations and the query help text. The suggestion then appears inline on the pull request or on the alert’s detail page. It is switched on by default wherever CodeQL runs, and repository, organization or enterprise admins can turn it off. It covers part of the default and security-extended CodeQL query suites in nine language groups: Python, JavaScript/TypeScript, Java/Kotlin, C#, C/C++, Go, Ruby, Swift and Rust.

Agentic autofix is the heavier option. You hand one or more alerts to Copilot, either from a security campaign or from the repository’s alert backlog. Every assignment kicks off an agent session that looks beyond the affected file, writes a fix, checks it by running CodeQL again and opens a draft pull request. That check has gaps: GitHub says it can’t confirm fixes for alerts raised by your own custom queries, by the security-extended suite, or by non-GitHub scanners.

The broader Copilot cloud agent can also take code scanning alerts from security campaigns. On GitHub Actions, each session has a hard 59-minute limit, works on one branch and opens one pull request per task.

Access and cost

Who can use itCost model
Codex Security ReviewChatGPT Enterprise, Business, Edu and Pro; not PlusUses included Codex allowance or ChatGPT credits
Codex Security Cloud scansWorkspaces with Codex Security Cloud accessBilled on token usage at your plan’s rates, outside the plan’s included allowance; eligible accounts get free scanning credits first
Codex Security CLIScans on OpenAI models need Codex Security accessSign in with cs login, or set an API key for CI; Amazon Bedrock, OpenRouter and Fireworks AI are also supported
Copilot AutofixAll public repositories on GitHub.com, plus private and internal repositories under a GitHub Code Security licence; no Copilot subscription neededDoes not consume AI credits
Agentic autofixEnabled by an organization owner or security manager (or a repository admin for an eligible personal public repository); no Copilot licence needed; not available for Enterprise Managed Users repositoriesUses Code Security AI credits and GitHub Actions minutes

Limits both vendors admit

GitHub’s application card for these features is unusually blunt. Copilot Autofix is non-deterministic, so the same alert can produce different suggestions or none. It may propose code that does not compile, edits in the wrong place, changes that alter program behaviour, or fixes that leave the vulnerability in place or add a new one. Suggested dependency changes deserve extra care, because the model can name packages that are not real. Very large files may cut the context short, and in that case Autofix skips the alert. GitHub states plainly that you must review every suggestion.

OpenAI’s documentation is similar in spirit. A scan that reports nothing does not prove the repository is clean. Language coverage depends on how well the model reasons about each language and framework, so check the report for what was actually reviewed. A generated or applied patch is not a verified fix until verification has run, and if verification is incomplete, OpenAI suggests leaving the finding open. Finished fixes still go through your normal code review.

Which one fits

  • You already run CodeQL on GitHub and want quick fixes for the alerts it raises: Copilot Autofix costs nothing extra and needs no setup. Move to agentic autofix when you want Copilot to handle a backlog and hand you draft pull requests.
  • You want an agent to find issues a rule-based scanner might miss, keep a threat model, and show evidence for each finding: Codex Security is built for that, and its CLI works outside GitHub.
  • You want both: they do not conflict. Codex Security can export SARIF, and Copilot Autofix keeps working on CodeQL alerts in the same repository.

For more tools in this space, browse the security and privacy hub, the pull request agents hub and our developer tools list.

#Codex Security#GitHub Copilot Autofix#Code scanning#Application security#AI coding agents
AI

Written by AI Agents Directory

Editorial team

Facts in this guide are checked against official documentation and repositories, which are linked in the article.