章鱼总结
00:00 / 21:10

OpenAI · 21:10

说话人 0

Hi everyone, I'm Ian. I work on Cyber Product Engineering here at OpenAI, and today I'm going to share a bit about what we're building for AI security, how we've used it internally, and also how you can use it as well.

大家好,我是Ian。 我在OpenAI负责网络安全产品工程工作,今天我将分享一些我们正在为AI安全构建的内容,我们在内部如何使用它,以及你们也可以如何使用它。

说话人 1

Hi, and I'm Kyle. I work with Ian on the Cyber Product Engineering team, and I'm focused on the Codex Security CLI, which provides building blocks to help secure your software with AI. Today we'll walk through how the CLI works, from discovering and validating findings to generating patches that a developer can review and show a demo of how of our new Codex Security Cloud, which is a more turnkey solution of the CLI workflows that we announced today during the keynote.

嗨,我是Kyle。 我和Ian在网络安全产品工程团队共事,我专注于Codex Security CLI,它提供了一些基础构件,帮助你用AI保障软件安全。 今天我们将介绍CLI的工作原理,从发现和验证问题,到生成开发者可以审查的补丁,并演示我们全新的Codex Security Cloud。它是CLI工作流的一体化解决方案,我们在今天的主题演讲中宣布了它。

说话人 0

Great, so before we get all into that, I want to acknowledge the state of cybersecurity landscape today. We're definitely at an inflection point when it comes to security. The cost of hacking stuff is going to basically zero, and over the past few months, the latest models have made it possible to find thousands of latent security vulnerabilities in software that people depend on every single day. So this, this matters a lot, um, not just for security people, but also really for any developer building any type of application. and right now, fortunately, these frontier models are ahead of open weight models in terms of their cyber capabilities. so this creates what we call the defender's window. this is a window of opportunity to find and fix weaknesses before the same capabilities become widely available and fall into the hands of attackers. We need to use that lead now.

好的,在深入这些内容之前,我想先谈谈当今网络安全的形势。 在安全领域,我们确实正处于一个转折点。 攻击系统的成本基本趋近于零,而且在过去几个月里,最新的模型已经能够在人们每天依赖的软件中发现数千个潜在的安全漏洞。 所以这件事非常重要,嗯,不仅对安全从业者如此,对于任何构建各类应用的开发者来说也同样重要。 而目前,幸运的是,这些前沿模型在网络安全能力上领先于开放权重模型。 因此,这就形成了我们所说的“防御者窗口”。 这是一个机会窗口,让我们在同样的能力广泛普及、落入攻击者手中之前,找到并修复弱点。 我们现在需要抓住这一领先优势。

So we take, we took this to heart at OpenAI, and the way that we met the moment was by making the security of our systems a company-wide priority. That meant committing the people, the time, the resources to find and fix vulnerabilities as a top priority. Um, and while this was true, this is true for companies. It's also true for open source projects and even personal projects as well. So at OpenAI, what it looked like is we actually had a security sprint a couple months ago that had a quarter of all of our product engineers focused solely on strengthening the security of our internal systems. It was a huge effort. and this was really the starting point for building what we call internally our defense factory. this is a continuous loop that scans our systems, finds and validates vulnerabilities, assigns owners and verifies fixes. So through deduplication and validation across thousands of findings, we were able to scan our code base and focus really only on findings that could lead to actual exploits with a very low false positive rate of 0.81%.

所以我们在OpenAI认真对待了这一点,我们应对这一时刻的方式,是把系统安全提升为全公司的优先事项。 这意味着投入人员、时间和资源,把发现并修复漏洞作为首要任务。 嗯,虽然这一点,对公司来说是如此。 对开源项目乃至个人项目来说也同样如此。 因此在OpenAI,具体做法是:几个月前我们开展了一次安全冲刺,让我们四分之一的产品工程师专门致力于加强内部系统的安全。 这是一项巨大的工程。 这也正是我们在内部称之为“防御工厂”的体系的起点。 这是一个持续循环,它会扫描我们的系统,发现并验证漏洞,分配负责人,并验证修复是否有效。 通过对数千个发现结果进行去重和验证,我们得以扫描代码库,并真正聚焦于那些可能导致实际攻击的发现,误报率极低,仅为0.81%。

And of course we use codex to help create the fixes, which it did remarkably well with a rollback rate of less than 1%. So how did we actually make this happen? And how can you use it? We took everything that we learned from our internal security sprint at OpenAI and we built it into Codex Security. Codex security comes in several flavors. It's available as an open source plugin, CLI and SDK. And today we're launching a major update to the cloud version, which is a more turnkey solution. So Kyle is going to walk through some of the more critical and interesting problems that we ran into during our security sprint, and show you how we address them.

当然,我们也使用 Codex 来帮助生成修复方案,它的表现非常出色,回滚率不到 1%。 那么,我们究竟是如何实现这一点的? 你又该如何使用它? 我们把在 OpenAI 内部安全冲刺中学到的所有经验都整合进了 Codex Security。 Codex Security 有几种形式。 它以开源插件、CLI 和 SDK 的形式提供。 今天,我们还发布了云端版本的重大更新,这是一个更加开箱即用的解决方案。 所以 Kyle 将带大家了解我们在安全冲刺中遇到的一些最关键、最有趣的问题,并展示我们是如何解决这些问题的。

说话人 1

Gracias. Thanks.

谢谢。 谢谢。

So today, like Ian said, I'm going to talk about some of the bottlenecks that we hit while we were running our own internal defense factory and how we address them. We'll cover five main steps: giving agents context, running scans, enriching the findings, generating patches. and integrating this into your software development life cycle. Each step comes directly from how we ran our internal security sprint here at OpenAI. We'll use the CLI commands together as we walk through these steps to help us understand how it all comes together. The Codex Security CLI was a core building block of OpenAI's internal defense factory, and you can leverage the same tools to build your own defense factory by using the CLI, which is fully open source and under the Apache 2.0 license. 让我们开始给代理合适的上下文. You can imagine we have quite a bit of code here at OpenAI that we've written over the years, pointing an agent scanner at our repositories and saying, find all vulnerabilities, make no mistakes, didn't really cut it. So we needed to fan out a large number of scanners and focus each scan on a specific part of the code base. In doing so, we found that it was critical to give the agent enough context to understand what it was looking at. What does this part of the system do? How does it fit into the whole? How is it exposed? What protections are already in place around it? Some of that context, I'm sure you all know, lives outside of actual code bases. So there are two levels at which we think about giving a security agent context. The first is a narrow slice, which is a custom scan instruction. You can tell the agent which areas to investigate, what's in or out of scope for this scan, and which types of vulnerabilities to focus on. this was extremely helpful, but we found ourselves repeating the same background information over and over in those instructions, so we pulled that context out into a knowledge base we could reuse across scans. that's the second layer cross scan shared context we call a knowledge base. you can take the knowledge base or you can make the knowledge base available to both scanners and validators, and it includes things like architecture docs, firewall configuration, etc. It helps the agent understand the system and the protections that aren't visible in source code. At OpenAI, we also started committing security. md files. If you know what an agent. md file is, it's a very similar thing, but for security. We started committing these across components in our repo so that product owners could define their own threat models and own their own security guidelines. Together, these give the agent a broader context, the broader context it needs to understand what it's looking at, along with specific instructions for the scan at hand.

所以今天,正如 Ian 所说,我将谈谈我们在运行内部防御工厂时遇到的一些瓶颈,以及我们是如何解决这些问题的。 我们将涵盖五个主要步骤:为代理提供上下文、运行扫描、丰富发现结果、生成补丁。 以及将其集成到你的软件开发生命周期中。 每个步骤都直接源自我们在 OpenAI 内部安全冲刺中的实际做法。 在逐步讲解这些内容时,我们会结合使用 CLI 命令,帮助大家理解整个流程是如何衔接在一起的。 Codex Security CLI 是 OpenAI 内部防御工厂的核心组成部分,你可以使用同样的工具,通过 CLI 构建自己的防御工厂。该 CLI 完全开源,采用 Apache 2.0 许可证。 让我们开始给代理合适的上下文. 你可以想象,OpenAI 多年来编写了大量代码。如果只是让代理扫描器指向我们的代码仓库,然后下达“找出所有漏洞,不许出错”的指令,这种做法并不奏效。 所以我们需要同时启动大量扫描器,并让每次扫描聚焦于代码库的特定部分。 在这个过程中,我们发现让智能体拥有足够的上下文来理解它所看到的内容至关重要。 这部分系统是做什么的? 它在整体中如何配合? 它是如何对外暴露的? 它周围已经有哪些防护措施? 我相信你们都知道,其中一些上下文并不存在于代码库本身之中。 因此,我们在两个层面上考虑为安全智能体提供上下文。 第一个层面是狭窄的切片,即自定义扫描指令。 你可以告诉智能体需要调查哪些区域、本次扫描的范围包括什么或排除什么,以及重点关注哪些类型的漏洞。 这非常有帮助,但我们发现自己在这些指令中反复重复相同的背景信息,于是我们把这些上下文提取出来,放入一个可在各次扫描之间复用的知识库中。 这就是第二层:跨扫描共享的上下文,我们称之为知识库。 你可以使用该知识库,也可以让扫描器和验证器都能访问它,其中包括架构文档、防火墙配置等内容。 它帮助智能体理解系统,以及源代码中不可见的防护措施。 在OpenAI,我们还开始在代码仓库中提交安全文件。 md文件。 如果你知道什么是智能体的 agent.md 文件, md 文件,那它就是一个非常类似的东西,只不过是针对安全方面的。 我们开始在仓库中各个组件里提交这些文件,以便产品负责人能够定义各自的威胁模型,并负责各自的安全指南。 这些内容共同为智能体提供更广泛的上下文,即理解其所查看内容所需的更广泛背景,同时也为当前这次扫描提供具体指令。

Let's see that in action with a deep scan of an example repository using the Codex Security CLI. So here we go. This is our first catting, our first prompt. md. This is the custom scan prompt with instructions for what the agent could focus on in this specific scan. So we're going to do a deep scan. We're also going to show the knowledge base file here, which is the shared context about the architecture and the access rules. Again, this is an example repository we're showing as we go through this. So we're going to kick off this deep scan now. And you can see we pass those arguments in to provide the context, those files we saw before. The deep scan runs multiple security scans in parallel with agents investigating and validating potential vulnerabilities. It combines their results and keeps running additional passes until it can't find any new issues or it reaches its configured limit. So we're going to fast forward a ton because this can take a pretty long time, as you can imagine, scanning a whole code base. And a deep scan is very thorough. So I'm going to click here. They told me I make a lot of sound effects when I use the clicker, so deal with me. So now we have some findings.

让我们通过使用 Codex Security CLI 对示例代码库进行深度扫描来看看它的实际效果。 那我们开始吧。 这是我们的第一个 catting,也就是第一个提示词。 md。 这是自定义扫描提示词,其中包含了关于本次扫描中智能体应重点关注内容的说明。 所以我们要进行深度扫描。 我们还会在这里展示知识库文件,它是关于架构和访问规则的共享上下文。 同样,我们在演示过程中展示的是一个示例代码库。 那么现在我们开始这次深度扫描。 你可以看到,我们传入了这些参数来提供上下文,也就是我们之前看到的那些文件。 深度扫描会并行运行多个安全扫描,由智能体调查并验证潜在漏洞。 它会合并各项结果,并持续进行额外的扫描轮次,直到找不到任何新问题或达到配置的上限为止。 这个过程可能需要相当长的时间,你可以想象扫描整个代码库有多耗时,所以我们会快进很多。 深度扫描非常彻底。 所以我点击这里。 他们告诉我,我用鼠标点击时会发出很多音效,所以请多包涵。 现在我们有了一些发现。

As I mentioned before, we had to split the OpenAI code base into smaller areas and scan them in parallel. That meant spinning up a huge fleet of hundreds of agents across a bunch of different hosts, scanning different parts of the code base. The first challenge this introduced was deduplication. This is actually the part that I worked on during our internal security sprint, so it's pretty near and dear to my heart. And it was the first major bottleneck we hit. We had tens of thousands of findings coming in from different scanners across our repositories, and before we handed those off to developers and asked them to go fix them, we need to understand which findings corresponded to the same underlying issues. At that volume, we needed agents to help with the deduplication. And as a result of that work internally, we distilled it into what is now the deduplication workflow available in the CLI. So this is what it would look like if you were trying to deduplicate the scan results that you got from the CLI. And so more concretely, if multiple findings can describe the same vulnerability, before you assign that work to a developer, you need to sort out which findings are duplicates, so you don't have someone sending you an angry DM at like 1:00 in the morning asking you why did you assign 32 tickets to me instead of just one, because this is all just the same vulnerability. In our internal sprint, we found that across all of the scans, 36% of our findings were duplicates. Removing those dupes meant less time spent investigating the same issue and much less work for developers.

正如我之前提到的,我们必须把 OpenAI 代码库拆分成较小的区域,并行进行扫描。 这意味着要启动一支庞大的智能体队伍,数量达数百个,分布在多台主机上,分别扫描代码库的不同部分。 这带来的第一个挑战是去重。 这部分正是我在内部安全冲刺期间负责的内容,所以对我来说意义非凡。 而这也是我们遇到的第一个主要瓶颈。 我们从代码仓库中不同的扫描器获得了数以万计的发现结果,在把这些结果交给开发人员去修复之前,我们需要弄清楚哪些发现对应的是同一个底层问题。 在这种规模下,我们需要智能体来协助去重。 基于内部的这项工作,我们将其提炼成了现在可在 CLI 中使用的去重工作流。 所以如果你想对从 CLI 获得的扫描结果进行去重,它大致就是这样的流程。 更具体地说,如果多个发现可能描述的是同一个漏洞,那么在把任务分配给开发人员之前,你需要先理清哪些发现是重复的,这样就不会有人凌晨一点给你发一条愤怒的私信,问你为什么把32个工单分配给我,而实际上它们都只是同一个漏洞。 在我们的内部冲刺中,我们发现所有扫描结果里有36%的发现是重复的。 去除这些重复项意味着减少了调查同一问题所花费的时间,也大大减轻了开发人员的工作量。

From there, we had to classify them using our security rubric and prioritize what to fix. The next two steps in enriching the findings. So we had to answer two critical questions. First is how important are these findings for OpenAI as a company, and two, who should own the vulnerability. To answer the first question, we had to define which types of vulnerabilities we cared about the most. We started with defining critical vulnerabilities as ones where external actors could gain access they shouldn't have. we had to iterate on this rubric several times as we learned more about the vulnerabilities the scanners produced and how they fit into our internal framework. with the rubric you can run your findings. group。 and get a prioritized list so you know what to work on first based on what your company cares about. Or if you're an indie developer, what you care about as well. Shout out. The next step is figuring out who should work on that finding. For me, this was actually the most surprisingly difficult part of our OpenAI internal sprint. Knowing who owns what in a company that's moving so fast and growing so quickly took actually a large amount of human effort. Once we codified it, though, we were able to use that codification to reliably assign findings to the relevant teams with minimal churn and tickets being passed back and forth.

接下来,我们需要使用安全评估标准对它们进行分类,并确定修复的优先级。 接下来的两步是丰富这些发现的信息。 因此,我们必须回答两个关键问题。 第一,这些发现对 OpenAI 这家公司来说有多重要;第二,应该由谁来负责这个漏洞。 要回答第一个问题,我们必须先界定我们最关心哪些类型的漏洞。 我们最初将关键漏洞定义为外部行为者能够获得他们本不应有的访问权限的漏洞。 随着我们对扫描器产生的漏洞及其与内部框架的契合度了解越来越多,我们不得不多次修订这套评估标准。 有了这套标准,你就可以运行你的发现结果。 分组。 并获得一份优先级列表,从而根据你的公司所重视的内容,明确先处理哪些问题。 或者如果你是独立开发者,也可以按照你自己所关心的内容来操作。 大家鼓个掌。 接下来的一步是弄清楚应该由谁来处理这个发现。 对我来说,这实际上是我们OpenAI内部冲刺中最出人意料的难点。 在一家发展如此迅速、扩张如此快速的公司里,要搞清楚谁负责什么,实际上耗费了大量人力。 不过,一旦我们把这些信息规范化、制度化,就能利用这套规范可靠地将发现分配给相关团队,几乎不需要反复调整,工单也不会来回踢皮球。

So with all these great enriched findings that have been assigned, the next step is actually fixing them. At first we started with a human in the loop assigning vulnerability tickets to the teams, and they would prompt their codex to go look at the ticket they were assigned and go fix the issue, and then shepherd it through a PR and get it to production. As we learned more and more and improved our processes, we started auto generating these patches on behalf of the developers. Some of you may be thinking. No way. I do not want auto-generated security patches in my system. Which that thought process is why we found this process is more of a dial that you turn up, not a switch that you flip on. We had to gain confidence in the patches, and once we had the necessary context in place, we were able to do so. and the auto generated patches actually became a really valuable tool and super useful as we scaled this across the tens of thousands of findings. so that led us all of that led us to the codex security CLI patch command. So you can run it against the finding, tell the agent how to spin up the dev environment to test it with a special, with a special flag like validation prompt file, and you can put it in a, you can sorry, it can put up a PR to fix that vulnerability. when we started using this internally, we had a less than 1% rollback rate on auto generated patches, the 0.81% that ian mentioned earlier.

因此,在这些经过丰富、已经分配好的优秀发现之后,下一步实际上就是修复它们。 起初,我们采用人工参与的方式:由人把漏洞工单分配给各个团队,团队成员会让他们的Codex去查看分配到的工单并修复问题,然后通过PR推进,直到部署到生产环境。 随着我们学到的经验越来越多,流程也不断改进,我们开始代表开发人员自动生成这些补丁。 你们中的一些人可能正在想: 不可能。 我不想让自动生成的安全补丁进入我的系统。 正是这种想法让我们发现,这个过程更像是一个可以逐步调高的旋钮,而不是一个直接打开的开关。 我们必须对这些补丁建立信心,而一旦具备了必要的上下文环境,我们就能做到这一点。 自动生成的补丁后来真正成为了一个非常有价值、非常实用的工具,尤其是在我们将其扩展到数万个发现的时候。 所以,这一切最终促使我们推出了codex security CLI的patch命令。 你可以针对某个发现运行它,告诉智能体如何启动开发环境来进行测试,并使用一个特殊标志,比如validation prompt file,然后它就能提交一个PR来修复该漏洞。 我们在内部开始使用时,自动生成补丁的回滚率低于1%,即Ian之前提到的0.81%。

Part of that low rollback rate and the reason we could be so confident in those auto generated patches was due to how we verified the fixes before we merged them. we baked that into a verify fix command that you can use as a secondary check on the patches themselves to make sure the finding is actually fixed. you can think of this as an adversarial agent of sorts against the fix that you've created. So this is now our generated verified patch. From here, we would put up a PR and follow the normal SDLC in your company to get it merged. One of the best and in my opinion the most important parts of having access to these security primitives via the Codex Security CLI is that you can integrate them into the way that you work. Generating a verified patch is a great step towards getting a vulnerability fixed. That change then needs to go through your own team's development process. Every organization that I've seen does that just a little bit differently or very differently, and you probably need at least something like a code review, maybe you have a QA step, maybe there's product review or another step before you can actually ship the code to production. Having the security building blocks available through the CLI gives you the flexibility in how these tools are used and where. Once you have a defense factory of your own, how do you maintain the lead within the defenders window?

回滚率低的部分原因,以及我们之所以能如此有信心地使用这些自动生成补丁,是因为我们在合并修复之前进行了验证。 我们把这一步整合进了一个verify fix命令,你可以将它作为补丁的二次检查,以确保漏洞确实已被修复。 你可以把它看作是一个针对你所做修复的对抗性智能体。 所以这就是我们生成的经过验证的补丁。 接下来,我们会提交 PR,并按照贵公司正常的 SDLC 流程将其合并。 在我看来,通过 Codex Security CLI 使用这些安全基础能力,最好也最重要的一点之一,是可以将它们集成到你的工作方式中。 生成经过验证的补丁,是让漏洞得到修复的重要一步。 该变更随后还需要经过你们自己团队的开发流程。 我见过的每个组织做法都略有不同,甚至差异很大。你大概至少需要代码审查,也可能有 QA 环节,或者在代码真正上线到生产环境之前,还需要产品评审或其他步骤。 通过 CLI 获得这些安全构件,让你可以灵活决定这些工具如何使用、在哪里使用。 一旦你拥有了自己的“防御工厂”,你如何在防御者窗口期内保持领先?

And as the models themselves get better and better at fixing these vulnerabilities, this workflow actually gets more and more useful. So Ian, can you show us a little bit more about what we're seeing here?

随着模型本身在修复这类漏洞方面越来越出色,这一工作流程也会变得越来越有用。 那么 Ian,你能再向我们详细介绍一下我们在这里看到的情况吗?

说话人 0

yes sir thank you Kyle. So we're seeing a lot of improvements in both patch quality and cost. So this is patch bench, it's a third party eval which compares in this case 56 solvers is 6 astra using codex securities patch skill. Obviously you can see that that astra medium reasoning outperforms 56 sol at its at x high pretty substantially at less than half the cost per case. Um, and for for reference, humans at OpenAI benchmark right about here, 50%. So needless to say, we are working very closely with research, so that as models get better, your defense factory gets better, and we expect a lot more improvement here in the coming days and months. So as we rolled all this out internally, we ran into all the bottlenecks that Kyle has talked about. So things like figuring out which findings are duplicates, validating the vulnerabilities, actually patching them, and so forth. This curve is an extremely sanitized version of our internal security workload over time. So you can see that there's this huge spike of effort. And a large backlog that needs to be burned down. But to generalize our experience at OpenAI, I'm actually really optimistic about the way this curve will look for many organizations. We eventually arrived at a steady state in which there are much fewer vulnerabilities that are found much more quickly than before the use of AI to find vulnerabilities. And you know, you work down the backlog, you patch the vulnerabilities, you get down to that skinny part of the tail where you're catching new issues before they merge.

好的,谢谢 Kyle。 我们在补丁质量和成本两方面都看到了大幅改进。 这就是 Patch Bench,这是一个第三方评测,在本例中比较了 56 个求解器,即使用 Codex Security 补丁技能的 6 个 Astra。 显然,你可以看到 Astra 中等推理强度的表现明显优于 56 Sol 的 x high 模式,而每个案例的成本还不到其一半。 作为参考,OpenAI 的人类基准大约在这里,即 50%。 不言而喻,我们正与研究团队密切合作,因此随着模型能力提升,你的防御工厂也会随之提升,我们预计未来几天和几个月内这方面还会有更大改进。 在我们内部推出这一切时,遇到了 Kyle 提到的所有瓶颈。 比如判断哪些发现是重复的、验证漏洞、实际修补它们,等等。 这条曲线是我们内部安全工作负载随时间变化的一个极度简化版本。 你可以看到,这里出现了一个巨大的工作量峰值。 还有一大堆积压的问题需要逐步消化掉。 不过就我们在 OpenAI 的经验而言,我其实非常乐观,认为这条曲线在许多组织中都会呈现出良好的走势。 我们最终达到了一种稳定状态:发现的漏洞数量少得多,而且发现速度远快于在使用 AI 查找漏洞之前。 你知道,你逐步处理积压问题,修补漏洞,最终进入那条细窄的长尾部分,在问题合并之前就能将其捕获。

And you're running periodic scans. I think this skinny part of the tail, um, you know, is is very important because you need a way to keep that curve down, uh, which means that you need some way to run these scans continuously as the code base changes. The CLI and the SDK that we've open sourced are like the nuts and bolts, right? So you can connect them to your repositories and your review process. You can string them together yourself. You can put them into CI/CD or GitHub Actions and so forth. But we've also solved this problem in a much more turnkey way through Codex Security Cloud, which Sam talked about in the keynote earlier today.

同时你还在定期进行扫描。 我认为这条细窄的长尾非常重要,因为你需要一种方法让这条曲线保持在低位,这意味着你需要某种方式,在代码库变化时持续运行这些扫描。 我们开源的 CLI 和 SDK 就像是基础构件,对吧? 你可以把它们连接到你的代码仓库和审查流程中。 你也可以自行将它们串联起来。 你可以把它们接入 CI/CD 或 GitHub Actions 等等。 但我们也通过 Codex Security Cloud 以更加开箱即用的方式解决了这个问题,Sam 今天早些时候的主题演讲中提到过它。

So Codex Security Cloud runs this continuous security loop, so you don't have to orchestrate it yourself. You just hook up your GitHub repositories. And the best part about Codex Security Cloud, and really one of the most notable things about this launch, is that it gives you access to our Daybreak class models, which are designed specifically for security use cases. So that's what's running under the hood in Codex Security Cloud. So I can show you a quick demo, so you know what it looks like in action. Step one, find Codex Security Cloud in the plugin marketplace. So this is within Codex. You open plugins, you search for Codex Security Cloud and install it. Open the plugin. Also remember to hook up your GitHub connector. so we'll go in and we'll run a new scan. i'm going to set up this one to run on every single new commit. we will hit scan and fast forward a bit. and you get these results. so this is org-wide view of what your security pipeline looks like over time, the issues that are found and so forth. Um, you can dig into these results. And uh look at some of the specific findings, and then optionally you can auto generate a patch. So this is kind of the full continuous loop that that we were discussing earlier. Um, and it will open a PR uh straight to to GitHub. So if you want to run these same capabilities that Kyle has shown you in a in a much more automated way, um, use Codex Security Cloud. Uh, we rebuilt it, it's now powered by our Daybreak Blue model by default, and you don't have to go through any access requests or permissions and and so forth. we're really so excited to give you these these tools that we've been using internally at at OpenAI. so you can do this in your own code base, in your own projects. install codex security on npm. it is completely open source. or you can find codex security cloud in the plugin marketplace before the end of the week. that's that's all. thanks everyone for coming. yeah.

所以 Codex Security Cloud 会运行这个持续的安全循环,你无需自己去编排。 你只需连接你的 GitHub 代码仓库即可。 而 Codex Security Cloud 最棒的地方,也是这次发布最值得注意的一点,是它让你可以使用我们的 Daybreak 级模型,这些模型是专门为安全用例设计的。 所以这就是 Codex Security Cloud 底层运行的东西。 我可以给你演示一下,让你了解它实际运行的样子。 第一步,在插件市场中找到 Codex Security Cloud。 这是在 Codex 内部进行的。 你打开插件,搜索 Codex Security Cloud 并安装它。 打开该插件。 也别忘了连接你的 GitHub 连接器。 所以我们进去运行一次新的扫描。 我打算把这个设置为每次有新提交时都自动运行。 我们点击扫描,然后快进一小段。 然后你就会看到这些结果。 所以这是组织范围的视图,展示你的安全流水线随时间的变化、发现的问题等等。 嗯,你可以深入查看这些结果。 呃,查看一些具体的发现,然后可以选择自动生成补丁。 所以这就是我们之前讨论的完整持续循环。 嗯,它会直接向 GitHub 发起一个 PR。 所以如果你想以更自动化的方式运行 Kyle 向你展示的这些功能,嗯,就使用 Codex Security Cloud。 呃,我们重新构建了它,现在默认由我们的 Daybreak Blue 模型驱动,而且你无需经过任何访问申请或权限审批等流程。 我们非常兴奋能把这些我们在 OpenAI 内部一直在使用的工具交给你们。 所以你可以在自己的代码库、自己的项目中使用它。 在 npm 上安装 codex security。 它是完全开源的。 或者你可以在本周末前,在插件市场中找到 Codex Security Cloud。 就这些。 感谢大家前来参加。 嗯。

摘要

本视频由 OpenAI 网络安全产品工程团队的 Ian 和 Kyle 介绍 Codex Security 的设计与内部实践。视频先指出 AI 正使安全攻击成本趋近于零,前沿模型已能发现大量潜在漏洞,因此存在一个需要抢先修复的“防御者窗口”。随后,演讲者分享 OpenAI 内部安全冲刺和“防御工厂”的持续循环:扫描、验证、去重、分级、分配、生成补丁并验证修复。讲解重点包括为智能体提供分层上下文、深度扫描、去重与归属判定、自动补丁的可控推进,以及与团队现有开发流程的集成。视频还展示了补丁基准与云端版本的使用流程,并说明开源 CLI 与 SDK 的用途。其价值在于为开发者和安全团队提供一套可复用的 AI 安全工作流参考。

章节

00:23 AI 安全的转折点与防御者窗口

演讲者介绍自己在 OpenAI 网络安全产品工程团队的工作,并说明本次将讲解 AI 安全的构建方式、内部使用经验和对外使用方法。视频指出,当前安全领域处于转折点:攻击成本趋近于零,最新模型在过去几个月已能在日常依赖的软件中发现数千个潜在安全漏洞。前沿模型目前在网络安全能力上领先于开源权重模型,由此形成“防御者窗口”,即在同等能力广泛扩散、落入攻击者手中之前,抓紧找出并修复弱点。OpenAI 为此将系统安全设为公司级优先事项,投入人员、时间和资源,这一判断��样适用于企业、开源项目和个人项目。

主讲人开场介绍(无明确视觉证据,代表性锚点)
本次分享的 AI 安全主题概览
第二位讲者出场介绍
Codex Security CLI 产品介绍
Codex Security Cloud 演示预告

02:13 OpenAI 内部安全冲刺与防御工厂

OpenAI 曾组织安全冲刺,约四分之一的产品工程师专门用于加固内部系统,这是一项大规模投入。冲刺的成果是形成了内部“防御工厂”,即一个持续循环:扫描系统、发现并验证漏洞、指派负责人、验证修复。通过对数千条发现进行去重和验证,团队只聚焦于可能导致实际利用的问题,误报率约为 0.81%。团队使用 Codex 辅助生成修复,回滚率低于 1%。

公司级安全优先原则的核心表述
将漏洞修复列为最高优先级
安全原则适用于各类公司
安全原则延伸到开源与个人项目
内部安全冲刺的具体投入

03:28 Codex Security 的形态与开源 CLI

OpenAI 将内部冲刺的经验整合进 Codex Security,目前提供开源插件、CLI 和 SDK 等形式,并同步推出云端版本的重大更新,它是 CLI 工作流的一站式方案。本段随后引出后续内容:演讲者 Kyle 将讲解安全冲刺中遇到的关键难题及解决方式。CLI 是 OpenAI 内部防御工厂的核心组件,采用 Apache 2.0 许可证完全开源,开发者可以用它构建自己的防御工厂。

修复结果的回滚率数据
实现方式的引入
使用方式说明
Codex Security 产品介绍
Codex Security 的多种形态

04:23 为安全智能体提供分层上下文

在 OpenAI 的大型代码库中,直接让智能体寻找“所有漏洞”效果不佳,因此团队将扫描拆分到大量智能体并聚焦于具体代码区域。关键在于让智能体理解代码所处的系统背景,包括该部分的功能、与整体的关系、暴露方式和已有防护措施,而这些信息常存在于代码之外。上下文分两层:一是针对单次扫描的自定义指令,说明检查范围、范围内外和重点漏洞类型;二是跨扫描共享的知识库,包含架构文档、防火墙配置等,可供扫描器和验证器共用。团队还在代码仓库的各组件中提交 security.md 文件,让产品负责人定义各自的威胁模型和安全准则。演示中,Kyle 使用示例仓库,通过自定义扫描提示文件和共享知识库文件发起深度扫描。

演示使用 CLI 命令的步骤
Codex Security CLI 工具介绍
知识库中架构文档等共享上下文示例
按组件提交的安全 md 文件

07:55 深度扫描的运行方式

深度扫描会并行运行多个安全扫描,智能体在其中调查并验证潜在漏洞,合并结果后持续进行额外轮次,直到不再发现新问题或达到配置上限。由于需要扫描整个代码库,这一过程耗时较长,演示中做了快进处理。扫描完成后,系统产生了一批发现结果,为后续去重和分级提供输入。

展示深度扫描的自定义提示词文件内容
展示共享架构与访问规则的知识库文件
深度扫描完成后展示的漏洞发现结果

09:15 大规模发现的去重及重复率

OpenAI 的代码库被拆分后由数百个智能体并行扫描,产生了数万条发现,因此去重成为第一个主要瓶颈。不同发现可能描述同一漏洞,如果不先去重,开发者会收到大量重复工单。团队将去重经验整理为 CLI 中的去重工作流。内部冲刺中,所有扫描合计有 36% 的发现属于重复项,去除后减少了重复调查和开发者的工作量。

CLI去重工作流中扫描结果的演示画面
内部冲刺中重复发现占比36%的数据结果

10:59 严重度分级与负责人归属

去重之后,团队需要用安全准则对发现分级,并确定修复优先级,核心问题是两个:这些发现对公司有多重要,以及应由谁负责修复。团队最初将关键漏洞定义为外部行为者可以获得本不应有的访问权限,并根据扫描器产出和内部框架多次迭代该准则。应用准则后,可得到按公司关注点排序的修复清单。负责人归属是演讲者认为最难的环节,因为公司快速变化和扩张,理清“谁负责什么”需要大量人工投入。一旦将归属规则固化,就能较少往返地将发现可靠分配给相关团队。

引出分级后的两个关键问题,作为本段的代表性画面

12:42 自动生成补丁与人工把关

修复流程经历了三个阶段:起初由人工把漏洞工单分配给团队,团队用 Codex 处理工单并提交 PR;随后团队逐步为开发者自动生成补丁。演讲者提到,许多人会担心系统自动生成安全补丁,因此自动补丁更应被视为可调节的“旋钮”,而非一键开启的开关。团队先建立对补丁质量的信心,并在具备足够上下文后逐步推进。随着规模扩展到数万条发现,自动补丁成为有价值的工具,并由此形成 Codex Security CLI 的 patch 命令。该命令可针对某条发现,通过验证提示文件说明如何搭建开发环境进行测试,并提交修复 PR。内部使用时,自动补丁的回滚率低于 1%,即前文提到的 0.81%。

codex security CLI patch 命令,展示修复入口
自动生成补丁的回滚率数据

14:19 补丁验证与融入开发流程

低回滚率的原因之一,是团队在合并前对修复进行验证。为此提供了 verify-fix 命令,作为补丁之后的二次检查,用于确认漏洞确实已修复,可将其看作针对修复方案的对抗性智能体。生成并验证补丁后,仍需提交 PR,并按照公司既有 SDLC 流程完成代码审查、QA、产品评审等环节后才能发布。演讲者认为,通过 CLI 获取这些安全能力,可以让团队按自身流程灵活选择使用方式和位置。

补丁修复前的验证过程
验证修复命令作为二次检查
针对修复方案的对抗式检查
生成的已验证补丁
提交 PR 并走常规 SDLC 流程

16:00 模型表现、成本与持续扫描

Ian 展示了第三方评测 PatchBench 的结果,它比较了 56 个 solver 与使用 Codex Security patch skill 的 GPT-5.6 Astra。结果显示,Astra 在中等推理强度下明显优于高强度的 56 solver,且单案例成本不到后者的一半;OpenAI 人工基准约为 50%。随着模型进步,防御工厂也会随之改进。内部推广时,团队遇到了去重、验证、修补等瓶颈,安全工作量在初期出现明显高峰和积压。演讲者认为,多数组织最终会进入稳定状态,即发现的漏洞更少、发现速度更快,然后逐步清理积压并进入尾部,即在变更合并前拦截新问题,并定期扫描。

PatchBench第三方评测对比图

18:04 持续安全扫描的必要性与 CLI/SDK 的组合

要维持安全漏洞曲线的下降,需要随代码库变化持续运行扫描。开源的 CLI 和 SDK 提供基础组件,可连接代码仓库和审查流程,用户可自行组合,也可接入 CI/CD 或 GitHub Actions。OpenAI 还提供了更自动化的 Codex Security Cloud,它由 Sam 在主题演讲中介绍,可自动运行持续安全循环,无需自行编排。

讲解中提到的长尾曲线形态,对应需要压低的曲线图

18:47 Codex Security Cloud 演示与使用方式

Codex Security Cloud 只需连接 GitHub 仓库即可使用,并提供面向安全场景设计的 Daybreak 系列模型。演示流程包括:在 Codex 插件市场中搜索并安装 Codex Security Cloud,连接 GitHub 连接器,设置每次新提交都运行扫描,然后查看组织级的安全概览和问题趋势。用户可以查看具体发现,并选择自动生成补丁,系统随后直接在 GitHub 上开启 PR。该云端版本现已默认使用 Daybreak Blue 模型,无需访问申请或额外权限。CLI 已在 npm 上以完全开源的形式发布,Cloud 版本也将在本周内于插件市场上线。

Codex Security Cloud 持续安全闭环开场
接入 GitHub 仓库
Daybreak 安全模型介绍
底层模型说明
演示开始

结论

01:58 在前沿模型领先开源权重模型的防御者窗口内,组织应尽快找出并修复可被利用的弱点。

03:14 通过去重和验证,OpenAI 内部防御工厂将关注点集中在可能导致实际利用的发现上,误报率约为 0.81%,Codex 生成修复的回滚率低于 1%。

05:52 为智能体提供系统架构、暴露方式和现有防护等上下文,是获得有效安全扫描结果的关键。

10:44 内部冲刺中 36% 的发现属于重复项,去重可显著减少重复调查和开发者的工作量。

13:20 自动生成安全补丁应被视为可逐步调高的控制项,需要先建立对补丁质量的信心,再逐步扩大使用范围。

14:32 在合并前对修复进行独立验证,并将补丁纳入团队既有的代码审查和 SDLC 流程,是降低回滚风险的重要保障。

16:30 在 PatchBench 中,使用 Codex Security patch skill 的 Astra 中等推理强度版本优于高强度的 56 solver,且单案例成本不到后者的一半。

18:08 要长期降低漏洞数量,必须随代码变化持续运行扫描,在变更合并前拦截新问题。

20:22 Codex Security Cloud 可自动运行持续安全循环,并默认使用 Daybreak Blue 模型,无需额外访问申请。

Codex Security:从漏洞到已验证的修复 | DevDay 2026 · 视频总结 · OctSum