OpenAI has open-sourced a developer-facing CLI (a command-line tool) and TypeScript SDK (a library for embedding the capability in applications) for repository vulnerability finding, validation, and fixing—separate from the product narrative around Codex Security / Patch the Planet.
📑Table of Contents
Artifacts and official docs
- GitHub: openai/codex-security (Apache-2.0)
- npm: @openai/codex-security
- CLI docs: developers.openai.com/codex/security/cli
Why this ops surface matters
The news value is the ops surface: meaning-sensitive findings that classic rule-based SAST (static application security testing) often misses, plus multi-repo history, budgets, and CI gates that an in-editor plugin alone cannot run reliably.
This article covers the following, using official docs plus independent hands-on and implementation write-ups:
- (1) what shipped versus product/plugin surfaces
- (2) official quick start, prerequisites, and artifacts
- (3) CI/SDK wiring and exit semantics
- (4) access, cost, and trust-boundary caveats
You should leave able to choose dry-run + small scans, stay on the plugin, or hold adoption.
What you will learn
What shipped — CLI/SDK versus product and plugin
Public surface and capabilities
The public surface is a CLI plus TypeScript SDK to find, validate, and fix vulnerabilities.
README-level capabilities include:
- repo, path, diff, and working-tree targets
- findings history
- CI checks
- SARIF/CSV/JSON export
Cyber Security News independently reported the Apache-2.0 CLI/SDK release and @openai/codex-security on 2026-07-29.
Product initiative vs OSS ops layer
Patch the Planet remains a maintainer-support / human-reviewed product initiative with a different primary URL. This article focuses on the clone-and-wire OSS ops layer.
Plugin vs CLI/SDK roles
Independent framing (Shoogo Minami on note; Hacker News) treats the surfaces as follows:
- Interactive plugin: single-repo investigation and finding review
- Dedicated CLI/SDK: shell/CI/multi-repo/Docker harness around the same scanner family
Agentic AppSec harness reading
Implementation analyses (wasnotwas; Zenn/catatsuy) read it as an agentic AppSec harness—an execution framework for agent-assisted application security—built around skills, candidate ledgers, validation, attack paths, and artifacts rather than classic parser/taint/signature SAST.

Surface comparison
| Surface | Primary entry | Best fit | Caveat |
|---|---|---|---|
| Editor plugin | Interactive Codex Security | Single-repo investigation and fix dialogue | Weak multi-repo history and budget control |
CLI @openai/codex-security |
shell / CI | path/diff/working-tree, fail-on-severity, export | Outside-repo outputs; access may be beta |
| TypeScript SDK | CodexSecurity.run |
Internal tooling and automation | Pre-1.0 API may change |
| Patch the Planet product context | Maintainer support initiative | Human-reviewed find-to-patch | Different primary URL from this article |
Sources and adjacent topics
Sources:
- openai/codex-security
- CLI docs
- note.com/gtminami
- wasnotwas
- Patch the Planet
- As of: July 2026
For adjacent agent-security context, see the Claude Security plugin and Claude Code / Codex sandbox boundaries.
Install to first scan (official quick start)
Prerequisites
Prerequisites:
- Node.js 22+
- Python 3.10+ for scan/export (tomli on 3.10)
- macOS/Linux/Windows
- Separate Codex Security access may still be required
Follow the official quick start in four stages:
- Install the package
- Sign in
- Validate the target and output directory with
--dry-run - Run the full scan
npm install @openai/codex-security
npx codex-security login
npx codex-security scan "$REPOSITORY" --output-dir "$SCAN_DIR" --dry-run
npx codex-security scan "$REPOSITORY" --output-dir "$SCAN_DIR"
Auth and state directories
Auth options include:
- local ChatGPT sign-in
- headless
login --device-auth - CI
OPENAI_API_KEY/CODEX_API_KEY - stdin
--with-api-key --auth chatgpt|api-key|auto
Environment API keys take priority over stored sign-in by default.
State and output contracts:
- Point workbench state outside the repo with
CODEX_SECURITY_STATE_DIR - Output directories must live outside the target repo/worktree
- On Unix, existing output dirs need
chmod 700
dry-run and artifacts
--dry-run validates repo/target/output without network or credentials.
Typical artifacts include:
report.mdfindings.jsoncoverage.jsonscan-manifest.json- sometimes
exports/results.sarif
Coverage is complete / partial / unknown.
Independent cost measurements
An independent hands-on (note.com/nobel) measured:
- ~92 packages / ~15s install
- ~408MB
node_modules info --jsonversions: CLI 0.1.1, plugin 0.1.14, runtime 0.144.6, default model gpt-5.6-sol at xhigh--max-cost 3: stopped early- cheaper model with a $6 cap: ~17 minutes with multiple findings
ChatGPT sign-in cost interpretation can differ from raw API dollar billing.
Sources:
- GitHub
- npm
- CLI docs
- note.com/nobel
- As of: July 2026
CI, SDK, and export for everyday pipelines
CI policy and exit codes
Put OPENAI_API_KEY in CI secrets; non-interactive runs prefer the API key. Use --auth api-key when you want that explicit.
- Default behavior is report-only
--fail-on-severity high(and similar) yields exit 1 when a completed scan meets the threshold- Incomplete coverage or runtime errors use exit 2—do not treat that as a clean pass
Targets, export, and hooks
Targets include:
--path--diff origin/main--working-tree--mode deep
Additional controls:
- Cap estimated spend with
--max-cost - Add design/threat-model context via
--knowledge-base
Export formats: sarif, csv, json. install-hook blocks high-severity or failed scans at pre-commit without replacing existing hooks.
TypeScript SDK and bulk-scan
SDK shape:
new CodexSecurity()run(repo, { outputDir, auth })- Read
reportPath/ findings close()
AbortSignal and onWorkerStatus are supported. bulk-scan supports interactive or CSV + workers; follow official hardened Docker compose guidance when containerizing.
Responsibility split from reverse-engineering
Independent reverse-engineering (Zenn/catatsuy) splits responsibilities as follows:
- LLM handles semantic judgment
- A deterministic finalizer owns IDs/seals/reports
- Fix stages separate Generate / Apply / Verify
CI command cheat sheet
| Command / surface | Primary use | Typical CI role |
|---|---|---|
scan --dry-run |
Input validation | Pre-PR config check |
scan --diff / --working-tree |
Change review | PR gate |
scan --fail-on-severity |
Policy fail | Protect main |
export --export-format sarif |
Existing SARIF viewers | Artifact storage |
CodexSecurity.run |
Internal orchestration | Custom workflows |
Sources (CI and SDK)
- CLI docs
- npm
- Zenn catatsuy
- Cyber Security News (July 2026).
Decide before adopt — access, cost, trust boundaries
Access boundary
Readable Apache-2.0 source is not the same as scanner entitlement. Independent notes and wasnotwas stress limited-beta / approved-customer access.
Full-repository scans may also require Trusted Access for Cyber; login alone does not grant it (official docs).
Cost and result sensitivity
Default models can be expensive. The independent hands-on stopped at $3 max-cost and completed a cheaper ~17-minute run under $6.
Results include source excerpts and reproduction steps. Plan for:
- output outside the repo
- limited reviewers
- retention policy
Supply-chain and ecosystem context
For ecosystem trust boundaries, Check Point Research documented CVE-2025-61260 in OpenAI Codex CLI.
Key points:
- project-local
.envredirectedCODEX_HOME - unprompted
mcp_serversexecution - fixed in 0.23.0 (2025-08-20)
- independent evidence for agentic tools that trust repository content
Treat that as supply-chain context for agentic tools—not as a substitute evaluation of Codex Security itself.
Adjacent platform moves
Pair this with platform moves such as GitHub’s GA security validation for third-party coding agents (GitHub GA security validation for third-party coding agents): generated code and local agent execution both need policy.
Pre-adoption checklist
- Confirm evaluation rights on the target repo and an outside-repo output dir (
0700). - Run
npx codex-security info --jsonand--dry-runto verify version and config. - Trial a small fixture or single path with
--max-cost; read coverage and proof gaps. - Promote CI from report-only to fail-on-severity; monitor exit 1 vs exit 2 separately.
- Decide plugin-only single-repo review versus CLI/SDK multi-repo harness needs.
- Review project-local config, secrets, and result-dir trust boundaries for agentic tools.
Sources (pre-adoption)
FAQ
Q1. Plugin or CLI/SDK?
Plugin often suffices for interactive single-repo work. Prefer CLI/SDK for CI, multi-repo history, budgets, and internal orchestration (note gtminami / HN).
Q2. Does public GitHub code mean I can scan?
No. You still need Node/Python prerequisites plus Codex Security access (and possibly Trusted Access for Cyber / limited beta). Source availability ≠ entitlement (official docs / wasnotwas / note gtminami).
Q3. Why is CI always green when I want failures?
Default is report-only. Without --fail-on-severity, findings can still exit 0. Incomplete coverage is exit 2 (official docs / npm).
Q4. Can this replace Semgrep/CodeQL?
Independent analyses frame it as a human AppSec complement / agentic harness, not a drop-in rule-based SAST replacement. Design for coexistence (Zenn catatsuy / wasnotwas).
Q5. Safest first step?
Safest order:
- dry-run
- small path + max-cost
- read proof gaps/coverage
- gradual CI
Do not block every commit with a heavy AI scan on day one (note gtminami / nobel / official docs).
Summary and next actions
What open-sourced is the CLI/SDK ops surface developers can clone into pipelines—not the same dimension as product initiatives or the editor plugin.
Anchor on official quick start and artifact contracts (outside-repo output, auth, exit codes), then use independent cost measurements and harness analyses for differential value.
Run checklist items 1–6 against your team’s rights, budget, and trust boundaries, and decide go/no-go from dry-run plus a small scan alone.
Related articles:
Author
krona23
Over 20 years in the IT industry, serving as Division Head and CTO at multiple companies running large-scale web services in Japan. Experienced across Windows, iOS, Android, and web development. Currently focused on AI-native transformation. At DevGENT, sharing practical guides on AI code editors, automation tools, and LLMs in three languages.
🔥 Most Popular
- Claude Code CLI vs Web vs Desktop: Essential 2026 Guide
- Agent Loops and Harnesses: Key Design Points for AI Development with Claude Code
- AI Code Editor Comparison 2026: 6 Tools Tested, Why I Use Zed + Claude Code
- Install OpenClaw: Node 24 or 26 (November 2026)
- 12 Workflow Improvements Switching Claude Code from CLI to Desktop












Leave a Reply