English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

OpenAI's Codex Security CLI Brings AI Security Review Before Commit

Forum topic · 小凯 · 2026-07-29

Summary

On July 29, OpenAI released Codex Security, a CLI and TypeScript SDK hosted at the openai/codex-security repository. The tool scans entire codebases, single paths, diffs between Git revisions, or uncommitted working-tree changes, and produces structured outputs: findings.json (severity, confidence, location, remediation), coverage.json (explicit complete/partial/unknown coverage states, deferred areas, open questions), report.md, and optional SARIF export for CI integration. It supports pre-commit hooks via install-hook, deep mode, architecture docs and threat models as knowledge bases, batch GitHub repo scanning, historical rescans, and finding match/compare across scans. The article positions Codex Security as a semantic review layer complementing traditional rule-based SAST rather than replacing it, noting tradeoffs such as inference cost (with --max-cost budgeting), result variance, access requirements (Codex Security access, Node.js 22+, Python 3.10, Trusted Access for Cyber), and sensitivity of scan outputs. The broader significance: security review is being folded into the daily AI coding loop as a default gate in agent pipelines.

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. The repository name is straightforward: openai/codex-security. It can scan an entire codebase, or just a single path, a diff, or uncommitted changes in the working tree — and the output isn't a vague "risk found," but a set of structured artifacts that can be persisted, compared, and wired into CI.

At first glance it looks like yet another security scanner. Look closer, and the flavor is different.

Scan Results Split into Three Ledgers

A standard scan generates:

  • findings.json: severity, confidence, location, evidence, and remediation suggestions;
  • coverage.json: which code was reviewed, what was excluded, and where the gaps remain;
  • report.md: a human-readable report;
  • Optionally SARIF export, plugging directly into code hosting platforms and CI.
  • What I care about most is coverage.json. Traditional SAST often dresses "no alerts" up as "secure," when no alerts may simply mean nothing was scanned. Codex Security explicitly splits coverage status into complete, partial, and unknown, and asks readers to check deferred areas and open questions. That's a restrained design choice: it admits that security review has blind spots.

    Targeting the Dev Loop, Not the Quarterly Audit

    The tool supports three very specific entry points:

    1. --diff to inspect 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, historical rescans, and finding match/compare between two scans. New, persistent, recurring, resolved, and unknown findings can be viewed separately.

    This means security review gets compressed from "a big meeting before release" into the daily coding loop. The coding agent finishes writing; the security agent reviews next; once a root cause is found, the next scan keeps tracking it. A lot of back-and-forth gets short-circuited.

    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 and stable. Model-based review excels at reading cross-file data flows, architecture documentation, permission boundaries, and the current diff together. The costs are on the table too: inference cost, result variance, access permissions, and neither false positives nor false negatives disappear. The CLI even provides --max-cost; when the budget is exhausted, new requests stop, though in-flight requests can still push the bill slightly over the limit.

    It's still in beta and requires Codex Security access. Node.js 22+ is required, plus Python 3.10 for scanning or export; full-repo scans sometimes 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. The official guidance is to place the output directory in a private location outside the repository and configure a retention policy. Security reports are themselves sensitive assets.

    Why It's Worth Watching

    Just days ago, the AI coding world turned Harnesses and multi-agent parallelism into official methodology; now OpenAI adds a "security harness" on top. Going forward, a mature coding agent's pipeline probably won't end at code generation, but rather:

    > Plan → modify → test → security review → coverage confirmation → compare with history → only then allow merge.

    Models still matter. But the products that actually make it into enterprises will be decided by who turns these gates into defaults.

    Original sources

  • 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

Tags

#openai#codex-security#ai-coding#appsec#sast#cli#devsecops#ci-cd

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178503767