openai/codex-security帮你找出并修复代码里的安全漏洞
Codex Security 是 OpenAI 推出的安全工具,专门帮你在代码里找漏洞、查清楚问题出在哪,并且给出修复办法。不管是自己写的小项目还是公司的大工程,它都能帮你把安全风险提前发现,省得等出了问题再补救。
它有好几种用法:可以在 Codex 里选一个安全检查流程直接跑;也可以在命令行里扫描整个代码仓库;还能接到自动化流程里,比如让 GitHub 定期自动扫描。扫描完会生成报告,告诉你哪里有问题、严重程度如何,还能直接生成修复补丁。
开发者在 Codex 会话里打开仓库并启用安全插件,让它重点扫认证和授权部分,拿到报告、源码证据和覆盖范围说明。
用户在仓库目录里用命令行跑一次扫描,完成后打开生成的 Markdown 报告看结果,之后还能找回最近一次扫描。
团队在 GitHub 仓库里配置每周自动扫描,把 API 密钥存成仓库密钥,扫描结果只报告不阻断任务。
用自带的 Docker Compose 配置扫描一批仓库,结果和登录状态在多次运行之间保留下来。
案例来自项目官方说明里举的例子和演示,不是本站编的。
用之前要准备:需要 Node.js 22.13.0 以上(22.x 系列)或 24.x/26.x,以及 Python 3.10 以上;用自动化功能时还需要 OpenAI 或 Codex 的 API 密钥
复制下面的命令,粘进终端(命令行)回车就装好了:
npm install --global @openai/codex-security npm install @openai/codex-security 命令原样摘自项目官方说明,本站没有改动。
能免费用、改、商用;改了代码再发出去要注明改过哪里,并保留原来的版权和许可说明。
以上是对许可证的通俗解释,不是法律意见;正式商用以官方仓库的 LICENSE 文件为准。
项目本身开源,采用 Apache-2.0 许可。但扫描要调用 OpenAI 或 Codex 的接口,需要你自己的 API 密钥,会产生相应费用。
说明里没有专门提 Windows。它通过 npm 安装,需要 Node.js 22.13.0 以上的 22.x 版本,或 24.x、26.x,以及 Python 3.10 以上。
说明里没有提到界面或报告的语言选项,从现有内容看不出是否支持中文。
本地扫描不需要连云端也能用。云端连接是可选的,只有你主动发布报告或读取云端结果时才会用到。
说明里没有提到显卡要求,它是在本地跑命令行、调用接口来工作的,不涉及本地跑模型。
下面是海外开发者在 Hacker News(国外程序员常去的技术论坛)上讨论这个项目的真实评论,按讨论热度挑选,中文由 AI 翻译,点「看原文」可以对照英文。
Hey HN, Michael here, co-founder of Promptfoo and one of the people working on the Codex Security CLI at OpenAI. Thanks for checking this out and for flagging the auth issues. We just open-sourced it, and there's still plenty for us to improve. Expect the product to evolve quickly. If you try it, I'd really appreciate hearing what works well and what you think we should improve. Happy to answer questions here. CLI docs: https://learn.chatgpt.com/docs/security/cli EDIT: If you'd like to help make this better, we're hiring: https://openai.com/careers/full-stack-software-engineer-cybersecurity-products-san-francisco/
Just ran it on a small repo. It ran for almost an hour and then got interrupted. It drained half my weekly usage on a Pro plan. npx codex-security scan . [00:00] Preparing scan [00:00] Authentication: stored Codex credentials. [00:03] Preparing scan [01:20] Running scan [01:20] Preflight: worker delegation supported (up to 8 worker slots). [52:47] Running scan codex-security: Could not save the Codex Security scan: Repository HEAD changed while the scan was running. Start a new scan. codex-security: Partial output was kept at ...
How does it work? Does the tool upload code to ChatGPT for analysis? That may not be allowed for some corporate projects.
I wonder if tools like this will put companies like snyk out of business. We use snyk at work and I have not been satisfied.
I seem to have gotten a bunch of you are trying to stuff we don't allow errors.. very annoying. Can they explain what types of projects it works on and how does it check I own it? Like will it just not work on Linux kernel even on my own patches to it?
I don't think there's much to this other than it being a convenient CI wrapper around their existing models? Edit: there's a little bit more meat here: https://github.com/openai/codex-security/tree/main/sdk/typescript/_bundled_plugin/skills
数据来自 GitHub,本站每周核对一次,最近核对于 2026-11-22。