OpenAI Releases Codex Security: An Open-Source CLI and TypeScript SDK to Find, Validate, and Fix Security Vulnerabilities in Your Code
OpenAI has launched Codex Security, a new suite of tools including a CLI and TypeScript SDK designed to identify, validate, and remediate security vulnerabilities.
The OpenAI Codex Security tool provides programmatic and command-line interfaces for automated repository auditing.
- OpenAI has introduced `@openai/codex-security`, a developer-focused toolkit for finding and fixing code vulnerabilities.
- The release includes both a Command Line Interface (CLI) and a TypeScript SDK compatible with Node.js 22 and Python 3.10.
- Key features include repository scanning, CI/CD integration, and flexible authentication through ChatGPT accounts or API keys.
Introduction to Codex Security
OpenAI has expanded its developer ecosystem with the release of Codex Security, a specialized suite of tools designed to enhance software security through automated analysis. Available as a Command Line Interface (CLI) and a TypeScript SDK, the tool aims to assist developers in finding, validating, and remediating security vulnerabilities directly within their development workflows. This launch signals a shift toward more integrated, AI-driven security auditing for modern software repositories.
Technical Requirements and Installation
The Codex Security tool is distributed via the Node Package Manager (npm) under the package name `@openai/codex-security`. To ensure compatibility, the tool requires a modern development environment, specifically Node.js version 22 or later and Python version 3.10 or later. According to the official repository, users must also have active access to Codex Security services to perform scans.
Installation is performed through standard package management commands:
npm install @openai/codex-security
Once installed, the CLI allows users to log in and initiate repository-wide scans immediately. The initial setup typically involves running npx codex-security login followed by npx codex-security scan . to analyze the current working directory.
Core Functionalities and CI/CD Integration
Codex Security is built to function both as a local development aid and as a robust component of a Continuous Integration (CI) pipeline. Its primary capabilities include scanning entire repositories, reviewing specific changes, and tracking findings over time. This longitudinal tracking allows teams to monitor the security posture of their codebase as it evolves.
For automation in CI environments, the tool can be configured to use environment variables for authentication, specifically by setting the OPENAI_API_KEY. This removes the need for interactive logins during automated builds. The tool also supports a non-interactive mode, which is essential for integration with platforms like GitHub Actions or Jenkins, ensuring that security checks are a mandatory part of the deployment process.
Authentication and Credential Management
The tool provides a flexible authentication model that accommodates both individual developers and enterprise systems. Users can authenticate using either their ChatGPT credentials or a standard OpenAI API key. In scenarios where both a ChatGPT sign-in and an API key are available, the CLI defaults to interactive prompts to ask which credential should be prioritized. However, developers can explicitly select a credential type using the --auth flag:
npx codex-security scan . --auth chatgptnpx codex-security scan . --auth api-key
To streamline the workflow, users can make ChatGPT sign-in the automatic default by unsetting existing OPENAI_API_KEY or CODEX_API_KEY environment variables. Additionally, the tool manages its internal state—including scan history—within a dedicated workbench directory. Users can override the default location by setting the CODEX_SECURITY_STATE_DIR environment variable, which is particularly useful in environments with restricted file system permissions.
The TypeScript SDK
For teams requiring deeper integration or custom tooling, the TypeScript SDK provides programmatic access to Codex Security features. This allows developers to build custom security dashboards or automated remediation scripts. A basic implementation involves importing the CodexSecurity class, initializing it, and running a scan on a specific path. The SDK returns a results object that includes the path to the generated security report, enabling further automated processing of the findings.
Broader Ecosystem Context
The release of Codex Security occurs within a broader framework of documentation and tools hosted at ChatGPT Learn. The documentation site lists Codex Security alongside other advanced OpenAI initiatives, including Model Context Protocol (MCP) servers, workspace agents, and specialized models. The site structure suggests that security auditing is becoming a core pillar of the OpenAI developer experience, sitting adjacent to tools for reasoning, vision, and real-time audio processing. By providing these tools, OpenAI is positioning itself not just as a provider of models, but as a comprehensive platform for secure software development.
Enjoyed this?
Get more posts like this delivered to your inbox.
Microsoft Announces v2.0 of Official MCP C# SDK: Stateless by Default & Interactive via MRTR
Next →Anthropic Releases MCP 2026-07-28 with Stateless Core and Extensions