← All reports & posts

What Is the Codex Security CLI? OpenAI's Scanner Explained

2026-09-14

The Codex Security CLI is OpenAI's open-source command-line tool for finding, validating, and fixing security vulnerabilities in your code (GitHub). The code is free under the Apache-2.0 license, but running a scan still requires Codex Security access, which means a ChatGPT login or an OpenAI API key (official quickstart). It is not the same product as the cloud "Codex Security" research preview, and that difference confuses almost everyone. This guide untangles it.

We cover trending repositories in 30-second video reviews. We reviewed Codex Security on 9 September 2026 and we have tracked its stars since (our repo page). Here is everything a normal reader needs to decide whether this tool is for them.

What is the Codex Security CLI?

The Codex Security CLI is a TypeScript command-line tool and SDK that scans your repositories for security issues, validates each finding to cut false positives, and can propose fixes (README). You run it in your terminal or in CI. It scans a path, a pull-request diff, or a whole repository, writes its results to files you can inspect (findings.json, report.md, SARIF for CI systems), and can open a pull request with a suggested patch (quickstart).

The important word in its description is "validating". Traditional static analyzers dump every suspicious pattern they find and leave you to triage the noise. Codex Security spends extra compute confirming each finding before it reports it. OpenAI says false positives dropped by more than 50 percent during its beta (The Hacker News, March 2026). That is OpenAI's own claim about its own product, not an independent measurement. We have not tested it.

The tool ships in three surfaces: a plugin, this CLI with its SDK, and a cloud agent (Trilogy's code-level analysis). They share one scanner.

CLI / SDK Cloud "Codex Security"
What it is npm package you run Web agent on OpenAI's platform
License Apache-2.0, fully open Proprietary service
Install one npm command none, it is a website
Access needed Codex Security access to run scans ChatGPT Pro, Enterprise, Business, or Edu
Best for developers, CI pipelines security teams evaluating the platform

Codex Security cloud vs CLI: the difference that confuses everyone

The cloud Codex Security is a research-preview agent, announced in March 2026, formerly codenamed Aardvark (OpenAI announcement). It scans connected GitHub repositories from OpenAI's platform, it is gated to paid ChatGPT tiers, and it was free for one month at launch (The Hacker News).

The CLI is an Apache-2.0 package on npm that OpenAI published in July 2026 (repo, created 13 July 2026). You install it, you run it, and it drives the same scanner from your terminal (Trilogy analysis).

A rule of thumb: if you are evaluating whether AI security scanning fits your team, look at the cloud preview. If you are a developer who wants it in your terminal and your CI today, start with the CLI. That is the audience split, and almost no coverage of either product states it.

Is the Codex Security CLI actually free and open source?

The CLI's code is fully open. Apache-2.0, source on GitHub, installable in one command (npm).

The scanning it orchestrates is not open. The CLI drives models hosted on OpenAI's servers, and running a scan requires Codex Security access (quickstart). You authenticate with a ChatGPT login, a device flow for headless machines, or an OPENAI_API_KEY for CI. One careful analysis calls this "open orchestration, hosted inference" (Trilogy), which is the clearest phrasing we have found.

There are cost controls. You can cap spend per scan with --max-cost and fail your CI at a chosen severity with --fail-on-severity (quickstart). One caveat worth knowing: the cost cap is an estimate rather than a hard spending guarantee (Trilogy).

The plain verdict: free to read, extend, and automate. Not free to run at scale, and not a self-contained scanner you can air-drop into an offline environment.

How to install the Codex Security CLI and run a first scan

Requirements: Node 22.13 or newer (24 and 26 also supported), and Python 3.10 or newer for scans, bulk scans, and exports (quickstart).

bash npx @openai/codex-security --version npx @openai/codex-security login # ChatGPT login, or use OPENAI_API_KEY npx @openai/codex-security scan "$REPOSITORY" --output-dir "$SCAN_DIR" --dry-run

Dry-run first, then run the same command without --dry-run. The quickstart documents scan variants (path, diff, working tree, deep mode), knowledge bases, pre-commit hooks, and resumable bulk scans across repositories discovered through the GitHub CLI. We point you there instead of duplicating its sixteen sections: learn.chatgpt.com/docs/security/cli.

Is Codex Security maintained? Repo health signals

As of 12 September 2026, the signals say yes, clearly (GitHub API):

  • Created 13 July 2026. It passed 10,000 stars in two months (10,662 on 12 September, 782 forks, 215 open issues).
  • Commits landed the same day we checked (12 September 2026).
  • Releases ship roughly weekly: v0.1.21 on 27 August through v0.1.27 on 11 September (releases, npm).

We have our own data point. When we reviewed the repo on 9 September 2026 it had 7,951 stars. Three days later it had 10,662. That is a 34 percent gain in three days, measured by our daily snapshots (our star-history). Adoption at that speed usually means a company is pushing the tool and developers are pulling it at the same time.

A repo two months old with weekly releases is not yet a mature project. The issue count will grow, the CLI surface will change, and pinning your version is sensible. But nothing here looks like a dump-and-run repository.

Who should use the Codex Security CLI, and who shouldn't

It fits security and engineering teams that want validated findings instead of raw scanner noise, which is OpenAI's own framing (quickstart). In our judgment it fits best when three things are true: your code can legally leave your infrastructure to OpenAI's models, your team is already comfortable with npm-based tooling, and false-positive fatigue from traditional SAST tools hurts you more than per-scan model costs do. PR-time diff scans are the obvious first use: small scope, clear severity gate, SARIF straight into your CI.

It does not fit you if your environment is air-gapped or your data-residency rules forbid sending code to a US model provider. The inference is hosted, full stop (quickstart). It also may not fit a zero budget: the CLI itself is free, but scans ride OpenAI's hosted models. During the preview, Codex Security scanning is included with paid ChatGPT plans (OpenAI pricing docs); API-key runs in CI are billed as ordinary model usage, with the CLI reporting an estimated cost per scan and letting you cap it with --max-cost (quickstart). What scanning will cost once the research preview ends has not been announced.

When would we still reach for the established open-source names? Semgrep and CodeQL are self-contained, free to run everywhere, and battle-tested. If "my code never leaves my machines" is a hard requirement, they remain the correct answer. We have not benchmarked any of these tools against each other and will not pretend to.

What we haven't verified

Our method is selection and framing, not testing. We have not installed or run Codex Security, and nothing above implies otherwise. The "false positives down more than 50 percent" figure is OpenAI's claim about its own beta. What scanning will cost after the research preview ends has not been announced (OpenAI pricing docs). There is no fixed supported-language list: OpenAI describes the scanner as language-agnostic, with detection quality depending on how well the model reasons about your repo's language and framework rather than on parser rules (cloud FAQ). How it behaves on private, proprietary code beyond the caveats in the official docs is something we simply do not know.

The 30-second review

Our video review of Codex Security, published 9 September 2026:

Watch on YouTube (23 seconds)

The repo page in our archive carries the live star count, our star history, and the full narration transcript: githubtrends.app/repos/openai/codex-security/

More open-source security tools we've covered

Codex Security sits in a fast-moving cluster. Our security topic hub tracks eleven open-source security tools we have reviewed, from Anthropic's cybersecurity skills collection to Sherlock, used for hunting usernames across social platforms. Our monthly trend reports show how the whole security cluster is growing, with star deltas measured since the day we covered each repo.