Glean 拾遗
日刊 /2026-07-31 / OpenAI 推出 AI 代码安全扫描 CLI/SDK,集检测、验证与修复于一体

OpenAI 推出 AI 代码安全扫描 CLI/SDK,集检测、验证与修复于一体

原文 github.com 收录 2026-07-31 06:00 阅读 2 min
AI 解读

Codex Security 是 OpenAI 推出的命令行工具和 TypeScript SDK,利用大语言模型(如 GPT-5.6-terra)扫描代码中的安全漏洞,并通过验证流程过滤误报,同时提供修复建议。它支持多种模型配置与努力等级,可集成至 CI/CD 流程,并按需使用 ChatGPT 登录或 API Key 认证。适合在开发阶段或部署前自动检测安全风险,降低人工审计成本。

原文 2 分钟
原文 github.com ↗
§ 1

OpenAI introduces @openai/codex-security, a CLI and TypeScript SDK that leverages AI to automatically find, validate, and fix security vulnerabilities in your code. It's designed for both local development and CI pipelines.

OpenAI推出了@openai/codex-security,这是一个命令行工具和TypeScript SDK,利用AI技术自动发现、验证和修复代码中的安全漏洞。它适用于本地开发环境以及持续集成流程。

§ 2

Traditional scanners often suffer from high false-positive rates or missed vulnerabilities. @openai/codex-security uses OpenAI's code model to better understand code context and provide actionable fix recommendations.

传统安全扫描工具可能产生大量误报或漏报。@openai/codex-security利用OpenAI的代码模型,更准确地理解代码上下文,提供可操作的修复建议。

§ 3

It supports both ChatGPT sign-in and API key authentication. You can specify the model (e.g., gpt-5.6-terra) and scan effort. Scan history is stored in a state directory, which can be overridden via environment variables.

支持ChatGPT登录和API密钥两种认证方式,可指定模型(如gpt-5.6-terra)和扫描力度(effort)。扫描历史保存在状态目录,支持环境变量覆盖。

§ 4

Requires Node.js 22.13+ (22.x, 24.x, or 26.x) and Python 3.10+. Install via npm, then login and scan the current directory. Example commands:

npx @openai/codex-security login
npx @openai/codex-security scan .

Optionally specify model and effort:

npx @openai/codex-security scan . --model gpt-5.6-terra --effort high

安装需要Node.js 22.13+或24.x/26.x,Python 3.10+。使用npm安装,登录后即可扫描当前目录。命令示例:

npx @openai/codex-security login
npx @openai/codex-security scan .

可指定模型和力度:

npx @openai/codex-security scan . --model gpt-5.6-terra --effort high
§ 5

@openai/codex-security ships as both a CLI and a TypeScript SDK. The CLI is ideal for ad-hoc scans and CI integration, while the SDK lets developers programmatically embed scans into their own toolchains. Both leverage OpenAI's code security model for analysis.

@openai/codex-security提供命令行工具和TypeScript SDK两种使用方式。CLI适合即时扫描和CI集成,SDK允许开发者以编程方式集成到自己的工具链中。两者都调用OpenAI的代码安全模型进行分析。

§ 6

Ideal for local code security audits and CI/CD pipeline integration. Note: requires internet access to OpenAI's service, and a Trusted Access account is recommended for best results. Scan speed and cost may vary based on model and code size.

适合本地代码安全审计、CI/CD流水线集成。注意:需要网络连接到OpenAI服务,且建议使用Trusted Access账号以获得最佳效果。此外,扫描速度和成本可能因模型和代码量而异。

打开原文 ↗