# codex-security **Repository Path**: devai/codex-security ## Basic Information - **Project Name**: codex-security - **Description**: 一套面向代码安全的命令行工具(CLI)+ TypeScript SDK,核心作用是自动扫描、校验、修复代码安全漏洞,服务 DevSecOps、AI 代码安全场景。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-31 - **Last Updated**: 2026-07-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Codex Security `@openai/codex-security` is a CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities in your code. **See the [Codex Security documentation](https://learn.chatgpt.com/docs/security/cli)** for more details. > Note: for best results, we recommend that your account is verified for [Trusted Access](https://chatgpt.com/cyber). ## Quick start Requires Node.js 22.13.0 or later in the 22.x release line, Node.js 24.x, or Node.js 26.x; Python 3.10 or later; and access to Codex Security. ```bash npm install @openai/codex-security npx @openai/codex-security login npx @openai/codex-security scan . npx @openai/codex-security scan . --model gpt-5.6-terra --effort high ``` For CI, set `OPENAI_API_KEY` or `CODEX_API_KEY` instead of signing in. Environment API keys are passed directly to the current scan and are never stored in Codex's credential home or system keyring. Local sign-in honors Codex's configured credential backend, including a system keyring required by a managed device. Codex Security keeps login and scan credentials in the same private, persistent state directory. If both a ChatGPT sign-in and an API key are available, interactive scans ask which credential to use. CI and other noninteractive scans keep the existing API-key precedence. Select a credential explicitly when needed: ```bash npx @openai/codex-security scan . --auth chatgpt npx @openai/codex-security scan . --auth api-key ``` To make your ChatGPT sign-in the automatic default, unset any configured API keys: ```bash unset OPENAI_API_KEY CODEX_API_KEY ``` Scan history is stored in the Codex Security workbench state directory. If that directory cannot be written, set `CODEX_SECURITY_STATE_DIR` to a writable directory outside the repository. `scans compare BEFORE_SCAN_ID AFTER_SCAN_ID` automatically matches findings by root cause, reuses saved matches, and identifies new, persisting, reopened, resolved, or unknown findings. Missing findings remain unknown when coverage is incomplete or their original location was not reviewed. ## TypeScript SDK ```ts import { CodexSecurity } from "@openai/codex-security"; const security = new CodexSecurity(); const result = await security.run("."); console.log(result.reportPath); await security.close(); ``` ## Containerized bulk scans Use the official image and included Docker Compose configuration for noninteractive, resumable scans of repositories pinned to immutable Git revisions. See the [container quick start](sdk/typescript/README.md#containerized-bulk-scans) for authentication, private result storage, and optional Ubuntu AppArmor hardening. For complete command help, runtime defaults, native multi-agent worker limits, environment variables, deep-scan configuration, and SDK options, see the [package README](sdk/typescript/README.md) and the [official CLI reference](https://learn.chatgpt.com/docs/security/cli/reference).