OpenAI's Codex Security CLI scans repositories, validates findings and drafts patches
The Apache-2.0 codex-security package adds a cs command and a TypeScript SDK that scan code, check candidate vulnerabilities, generate fixes and export SARIF for CI.
What it is
Codex Security is OpenAI’s tool for finding, investigating and fixing vulnerabilities in code. The openai/codex-security repository holds the @openai/codex-security npm package, which provides a command-line tool and a TypeScript SDK. The same security workflows can be used inside Codex through the Codex Security plugin.
The repository is licensed under Apache-2.0 and was created on 2026-07-13. As a snapshot at the time of writing, it showed 12308 stars, 663 of them gained in the last day on GitHub trending.
What a scan does
According to the README, the CLI can scan a whole repository, selected paths, or Git changes. Deep scans repeat Standard scans and return their deduplicated findings. Beyond scanning, the tool validates candidate findings, generates patches and verifies existing fixes. It can also draft SECURITY.md policies, save threat models, identify duplicate findings, assess severity against your own rubric, and suggest owners from source and Git history.
A completed scan saves a report and findings. The report holds source evidence and exclusions, and the README points users to it to see what a scan left out. Scans also read existing root and component SECURITY.md files as guidance.
Findings can be tracked in Linear, Jira or GitHub, or exported as SARIF, JSON and CSV. Findings from third-party scanners can be imported as well.
Getting started
The CLI requires Node.js 22.13.0+ within 22.x, or Node.js 24.x or 26.x, plus Python 3.10+; Python 3.10 also requires tomli. Install, sign in and run a first scan from the repository directory:
npm install --global @openai/codex-security
cs login
cs scan .
Other scopes and modes from the README:
cs scan . --path src --path tests
cs scan . --diff origin/main
cs scan . --mode deep
cs and codex-security run the same CLI. If the short name conflicts with another command, the README suggests codex-security, or npx @openai/codex-security to skip the global install. cs scan . --max-time 15 sets an advisory 15-minute allowance for a Standard investigation.
For CI, the scan process needs OPENAI_API_KEY or CODEX_API_KEY in its environment. The README includes a weekly GitHub Actions workflow that uses an estimated $5 limit per scan and reports findings without failing the job; it notes that requests already in progress can exceed the limit. A Docker Compose configuration covers bulk scans of a list of repositories and keeps results and authentication between runs.
Providers and access limits
Besides OpenAI, scans support Amazon Bedrock, OpenRouter, Fireworks AI and Cheaper Inference. Bedrock uses AWS credentials and does not require a separate OpenAI login. Some cybersecurity requests and protected findings require Trusted Access for Cyber.
Codex Security Cloud is an optional connection, and the README says local scans work without it. The local serve command and browser dashboard have been removed; existing databases and scan artifacts remain available.
Source: openai/codex-security on GitHub