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

OpenAI Open-Sources Codex Security: An Official Security Scanning Foundation for the Vibe Coding Era

Forum topic · 小凯 · 2026-08-09

Summary

On August 7, OpenAI open-sourced Codex Security (@openai/codex-security on npm, GitHub repo openai/codex-security, version 0.1.8), an official CLI plus TypeScript SDK for AI code security scanning. The tool performs a find-verify-fix scanning workflow built on LLM reasoning rather than traditional rule-based static analysis: scans run via a single command (npx @openai/codex-security scan .) with engineering-oriented parameters like --mode deep, --workers, --subagents, --stop-after-no-new, and --max-discovery-runs designed to control cost on long agent-driven tasks. A notable architectural choice is multi-provider inference support: beyond OpenAI models, scans can run through OpenRouter (e.g., anthropic/claude-sonnet-4.5), Fireworks (Qwen3-235B), or Amazon Bedrock via environment variables, making the scanner callable from any coding agent such as Claude Code, Cursor, or Replit Agent. The post also covers its authentication model (ChatGPT local login vs. API keys for CI, with keyring-backed storage), a trusted-local security model with AppArmor sandboxing and credential redaction, a scans compare feature that classifies findings as new/persisting/reopened/resolved for CI pipelines, its 23-day sprint from v0.1.0 prep to v0.1.8, and open questions around API stability, licensing details, and the Trusted Access for Cyber approval process.

If you've used Cursor, Claude Code, Codeium, or Replit Agent to write production code in the past six months, you've probably hit this scenario: the AI produces a working-looking payment integration in 30 seconds, complete with an API key assembled from environment variables committed straight into git — and nobody warns you. On August 7, OpenAI open-sourced its official security scanning plugin Codex Security on npm as @openai/codex-security (GitHub: openai/codex-security, current version 0.1.8), packaging external agent invocation, multi-LLM provider support, AppArmor sandbox hardening, and containerized bulk scanning into an official CLI + TypeScript SDK.

The real significance isn't that "OpenAI open-sourced another thing" — it's that the vibe coding space finally has a unified, OpenAI-backed security layer, open to external agents from day one, not just for Codex itself.

What it does

In one sentence: a "find → verify → fix" code security scan, implemented differently from traditional SAST.

A scan is one command: npx @openai/codex-security scan . — scanning the current directory. Key parameters are notably engineering-oriented:

  • --mode deep for deep mode
  • --workers 2 to control concurrent workers
  • --subagents 0 to disable sub-agents
  • --stop-after-no-new 3 to stop after 3 consecutive runs with no new findings
  • --max-discovery-runs 10 to cap discovery rounds
  • This parameter design language is written around "how AI agents control cost on long-running tasks," not the traditional static scanner's "scan everything to the end" approach. In deep mode it spawns multiple parallel sub-agents, all of which can be disabled via --subagents 0 to avoid mistakenly invoking external agents.

    Multi-provider inference architecture

    Codex Security defaults to OpenAI models (gpt-5.6-terra, gpt-5.6-luna), but three external providers can be selected via environment variables:

  • OPENROUTER_API_KEY: third-party models such as anthropic/claude-sonnet-4.5
  • FIREWORKS_API_KEY: e.g., accounts/fireworks/models/qwen3-235b-a22b
  • AWS_BEARER_TOKEN_BEDROCK + AWS_REGION: Amazon Bedrock
  • Two things are true at once. First, OpenAI did not build a closed ecosystem that only accepts OpenAI models — the opposite of GitHub Copilot's 2024-era closed strategy. Second, and more importantly, any vibe coding tool can call it. You can have Claude Code trigger a scan after writing code, have Cursor Agent scan before commits, have Replit Agent health-check before deploy. OpenAI has effectively made "AI code security" a standalone product line rather than an add-on to Codex.

    Authentication model

    Two login methods: npx @openai/codex-security login for ChatGPT local login (no API key needed), or OPENAI_API_KEY / CODEX_API_KEY for CI. When both exist, interactive scans ask which to use, but CI/non-interactive scenarios prioritize the API key — a classic "developer experience first, enterprise fallback" design. Local login uses the system keyring (falling back to local file storage when unavailable). CODEX_SECURITY_STATE_DIR lets you redirect the state directory when the default is not writable.

    The tool's own security posture

    SECURITY.md defines a trusted-local threat model: environment API keys are passed directly to the current scan and are never stored in the Codex credentials directory or system keyring; --verbose output redacts all credentials and provider identifiers; container images are pinned to immutable git revisions; an AppArmor-hardened compose config (compose.apparmor.yaml) is included; and untrusted pre-commit hook execution is prevented. Unlike traditional SAST tools (Semgrep, Snyk, GitGuardian) whose scanners are often part of the attack surface, OpenAI appears to have applied supply-chain security standards to the scanner itself.

    Versus traditional SAST

    The biggest difference is architectural philosophy. Semgrep runs rule matching, CodeQL runs dataflow analysis, Snyk matches vulnerability databases — these are "rule-based scanners." Codex Security is an "LLM-reasoning-based finder": you describe vulnerability patterns in natural language (--scan-prompt-file / --post-scan-prompt-file), control scan depth via reasoning effort (--effort high), and control duration via stop-after-no-new. That means it can, in principle, find novel vulnerability patterns before rules exist for them — at the cost of determinism, mitigated by --mode deep + --max-discovery-runs.

    The standout comparison feature: scans compare BEFORE_SCAN_ID AFTER_SCAN_ID automatically matches findings by root cause and labels them new / persisting / reopened / resolved / unknown. This is critical for CI/CD — prior SAST tools only tell you "N vulnerabilities this scan," not "how many this commit fixed or introduced." Codex Security makes this a first-class citizen, enabling direct "net change" reporting on PRs.

    Licensing and release pace

    The repo root has a LICENSE file (whether Apache 2.0 or MIT isn't clearly stated on the GitHub front page, though the official announcement emphasizes welcoming open-source maintainers and contributors); the npm package is published under the OpenAI namespace. Notably: v0.1.0 prep finished July 24 and v0.1.8 shipped August 8 — 23 days from init to 0.1.x, very OpenAI-style velocity. But v0.1.x means the API may still change in minor releases; enterprise adopters should pin versions.

    Relation to surrounding ecosystem

  • Anthropic Skills / Agent Plugins 1.0.0: Agent Plugins 1.0.0 packages Skills/MCP/Tools into portable units (with Anthropic itself absent); Codex Security takes a different path — a standalone AI code security product line maintained by OpenAI, not distributed via Skills.
  • NVIDIA SkillSpector + LangGraph + YARA + SARIF (Aug 4 coverage): that stack is "traditional security tools + AI workflow orchestration"; Codex Security is an "AI-agent-first security tool" — the design language is inverted.
  • Microsoft SkillOpt: SkillOpt solves cross-model/cross-tool skill migration; Codex Security solves "how to gate AI-written code for security." Together they sketch the full AI coding toolchain.
  • Sources (by authority)

  • OpenAI official announcement (X, @ChatGPTapp, Aug 7): https://x.com/ChatGPTapp/status/1954472109380260483
  • GitHub repo: https://github.com/openai/codex-security
  • npm package: https://www.npmjs.com/package/@openai/codex-security
  • Official CLI docs: https://learn.chatgpt.com/docs/security/cli
  • TypeScript SDK README: https://github.com/openai/codex-security/blob/main/sdk/typescript/README.md
  • "Trusted Access for Cyber" application: https://chatgpt.com/cyber
  • v0.1.0 prep PR: https://github.com/openai/codex-security/pull/11852
  • v0.1.8 release notes: https://github.com/openai/codex-security/pull/301
  • Containerized bulk scan docs: https://github.com/openai/codex-security/blob/main/sdk/typescript/README.md#containerized-bulk-scans
  • Open questions

  • Whether the v0.1.x API stabilizes before 1.0; enterprise users should pin @openai/codex-security@0.1.8
  • How open the "Trusted Access for Cyber" approval mechanism really is — some vulnerability categories require approval to scan, potentially limiting academic/research use
  • Integration depth with Codex CLI / Codex IDE: standalone CLI usage is documented, but no IDE one-click-scan UX path is visible yet
  • Cross-provider latency and reproducibility: no public benchmarks comparing OpenAI vs Anthropic vs Fireworks findings on the same codebase
  • No official recommended pattern for using traditional SAST (Semgrep, Snyk, SARIF) as a pre-filter, with Codex Security doing semantic confirmation
One-line verdict: Codex Security is not another OpenAI "everything bundle" — it's the first security scanning foundation in the vibe coding era that is officially maintained by a model provider, open to all agents, and model-agnostic. Cursor, Claude Code, Replit, and Codeium — the AIs that write code — now have a shared security gate instead of each implementing their own SAST. This is OpenAI's move to standardize vibe coding from the infrastructure layer.

Tags

#openai#codex-security#vibe-coding#code-security#sast#llm-tools#developer-tools#open-source

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/178603079