Codex Security: OpenAI's New CLI Puts AI Security Review Before the Commit
On July 29, OpenAI released the CLI and TypeScript SDK for Codex Security, in a plainly named repository: openai/codex-security. It can scan an entire codebase, a single path, a diff, or uncommitted working-tree changes — and the output isn't just a vague "risk found" warning, but structured artifacts that can be stored, compared, and wired into CI.
At first glance it looks like yet another security scanner. Look closer, and it smells different.
Scan Results Split into Three Ledgers
A standard scan generates:
findings.json: severity, confidence, location, evidence, and remediation advice;coverage.json: which code was reviewed, what was excluded, and what's still owed;report.md: a human-readable report;- Optionally, SARIF export for direct integration with code hosting platforms and CI.
- OpenAI Codex Security repository: https://github.com/openai/codex-security
- Official CLI quickstart: https://learn.chatgpt.com/docs/security/cli
- Release announcement: https://x.com/thsottiaux/status/2082241164850364555
What I care about most is coverage.json. Traditional SAST often packages "no errors" as "secure," but no errors may simply mean nothing was scanned. Codex Security explicitly categorizes coverage as complete, partial, or unknown, and asks readers to check deferred areas and open questions. It's a restrained design: it admits security review has blind spots.
It Targets the Development Loop, Not Quarterly Audits
The tool supports three very specific entry points:
1. --diff to check changes between two Git revisions;
2. --working-tree to review staged and unstaged code;
3. install-hook to add a pre-commit hook that blocks high-severity findings and scan errors before commit.
There's also deep mode, architecture docs and threat models as a knowledge base, batch scanning of GitHub repositories, re-running historical scans, and finding match/compare between two scans. New, persistent, re-emerging, resolved, and unknown findings can be viewed separately.
This pushes security review from a "pre-release meeting" into the daily coding loop. A coding agent writes the code; a security agent reviews it next; once root causes are found, subsequent scans keep tracking them. It short-circuits a lot of back-and-forth.
Division of Labor with Traditional SAST
Don't rush to call it a replacement. Codex Security is more like a semantic review layer.
Rule-based scanners excel at deterministic patterns — fast, stable results. Model-based review is good at reading cross-file data flows, architecture docs, permission boundaries, and the current diff together. The costs are also on the table: inference expense, result variability, access permissions, and false positives/negatives that won't disappear. The CLI even offers --max-cost to stop new requests when the budget is exhausted, though in-flight requests may still push the bill slightly over the cap.
It's currently in beta and requires Codex Security access. Node.js 22+ is required, with Python 3.10 needed for scanning or export; full repository scans may additionally require Trusted Access for Cyber. In other words, an open-source repo doesn't mean the service capability is fully open.
One more thing that can't be skipped: results may contain source code snippets and vulnerability details. OpenAI requires placing the output directory in a private location outside the repo, with a retention policy configured. Security reports are themselves sensitive assets.
Why It's Worth Watching
Just days ago, the AI coding world turned Harness and multi-agent parallelism into an official methodology; today OpenAI adds a "security harness" layer on top. A mature coding agent pipeline will likely no longer end at code generation, but follow:
> Plan → modify → test → security review → coverage confirmation → compare with history → only then allow merge.
Models still matter. But for products that actually make it into enterprises, the competition is over who turns these gates into defaults.
Original sources