codex-security
CLI and TypeScript SDK that scans a codebase to find, validate and fix security vulnerabilities.
What is codex-security?
`npx @openai/codex-security scan .` walks a checkout and leaves JSON results on stdout, while `--mode deep` spreads discovery across workers and subagents until it stops turning up anything new. Across runs, `scans compare BEFORE_SCAN_ID AFTER_SCAN_ID` matches findings by root cause and labels them new, persisting, reopened, resolved or unknown, so a second scan reports movement instead of restating the whole report. It is a poor fit as a pre-commit gate: deep discovery runs until `--max-time-hours`, which defaults to 96. Access is also gated — the CLI needs access to Codex Security, and some cybersecurity requests and protected findings require Trusted Access for Cyber approval, so cloning the repo on its own scans nothing.
What can you do with codex-security?
- One command, or one SDK call —
npx @openai/codex-security scan .is the whole entry point;--modeland--effort hightune the run. The TypeScript equivalent isnew CodexSecurity()plusawait security.run("."), which returnsresult.reportPath. - Deep scans with an explicit stop condition —
--mode deeptakes--workersand--subagentsfor parallelism and--stop-after-no-new 3,--max-discovery-runs 10and--max-time-hours 1.5as budgets. Discovery otherwise halts at 96 hours, and findings completed before the limit are still returned. - Findings tracked across scans —
scans compare BEFORE_SCAN_ID AFTER_SCAN_IDreuses saved matches and matches the rest by root cause; findings stayunknownwhere coverage was incomplete or the original location was never reviewed.findings list [repository]surfaces open findings not confirmed by the latest scan. - Swap in another inference provider —
--provider openrouter,--provider fireworksand--provider amazon-bedrockpair with a matching--modelsuch asanthropic/claude-sonnet-4.5. Bedrock acceptsAWS_BEARER_TOKEN_BEDROCKas well as standard access keys, profiles, web identity and the default AWS credential chain. - Containerized bulk scanning — The official image and its Docker Compose config run noninteractive, resumable scans of repositories pinned to immutable Git revisions.
--knowledge-base PATHshares security documents with every repository,--scan-prompt-file PATHcarries the scan instructions common to all of them, and apromptCSV column holds the instructions for one repository.
Star history
16 Aug to 30 Oct · +1.4k
Frequently asked questions
Is codex-security free for commercial use?
codex-security is released under the Apache-2.0 licence — OSI-approved open source, which permits commercial use.
How can codex-security be deployed?
codex-security is available as Runs locally / Self-hosted.