← Back to all projects

codex-security

CLI and TypeScript SDK that scans a codebase to find, validate and fix security vulnerabilities.

OfficialApache-2.0
Stars
11.3k
Forks
898
Open issues
173
Last commit
30 Oct 2026

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; --model and --effort high tune the run. The TypeScript equivalent is new CodexSecurity() plus await security.run("."), which returns result.reportPath.
  • Deep scans with an explicit stop condition — --mode deep takes --workers and --subagents for parallelism and --stop-after-no-new 3, --max-discovery-runs 10 and --max-time-hours 1.5 as 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_ID reuses saved matches and matches the rest by root cause; findings stay unknown where 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 fireworks and --provider amazon-bedrock pair with a matching --model such as anthropic/claude-sonnet-4.5. Bedrock accepts AWS_BEARER_TOKEN_BEDROCK as 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 PATH shares security documents with every repository, --scan-prompt-file PATH carries the scan instructions common to all of them, and a prompt CSV column holds the instructions for one repository.

Star history

16 Aug to 30 Oct · +1.4k

9.9k11.3k

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.

codex-security
Ask AI
GitHub