安全大模型能力的跨越与漏洞检测重心的转移
在过去的几个月里,Anthropic 的安全团队与大语言模型 Claude 进行了深度协作,旨在发现并修复系统与代码中的安全漏洞。从行业大趋势来看,前沿大模型的网络安全能力正呈现跨越式提升,这在英国人工智能安全研究所(UK AI Security Institute)的基准测试中得到了验证。以 Mozilla 公司最近公布的数据为例,Firefox 在 2025 年月均安全漏洞修复数量约为 20 个,而在 2026 年 2 月和 3 月这一数字三倍增长至 60-70 个,4 月更是飙升 7 倍达到了 400 个。这一显著增长的背后,有近三分之二的漏洞修复归功于前沿大模型协助安全防御者进行的大规模漏洞扫描与修复。
大模型的引入为防御端带来了前所未有的规模化能力。回溯历史上的重大安全事件,例如 Log4Shell(Java 日志库漏洞,允许攻击者通过特定注入字符串在受害者系统上执行任意代码,曾在数日内导致比利时国防部被黑客入侵、某金融科技平台泄露 200 万用户数据)和 Heartbleed(OpenSSL 加密库漏洞,危及全球大范围的互联网基础通信安全),这些关键漏洞的排查和修复往往耗费了安全人员海量的精力和假期。在 Anthropic 的自身实践中,团队扫描了超过 1000 个开源代码仓库,在 23,000 个潜在漏洞候选对象中,有 6,200 个被评定为“高危”或“严重”级别。截至最近一次更新,已有 1,600 个漏洞提交给了相关维护者,并有大约 100 个补丁被合并回了上游主分支。
这些实践数据表明,随着大模型能力的提升,漏洞发现(Vulnerability Discovery)本身已经变得相对简单,整个安全防御的瓶颈已经全面转移到了漏洞验证(Verification)、分级分流(Triage)以及补丁生成(Patching)环节。
Original English Source
Hi, I'm Eugene Yan, member of technical staff at Anthropic. Um, I've spent the last several months working with security teams and Claude to find and fix vulnerabilities in codes and systems. So, I want to share with you what we've learned as much as we can. Before I get started, quick show of hands. How many of here here are security engineers in your day job? Okay. Okay. How many of you here are engineers in your day job? Oh, sweet. Okay, great. I have better understanding of how to give this talk now. Um, security engineers in the room. Please don't boo me if I oversimplify things. I want to get this message out to as many people as I can. So, first I want to share with you three highlevel trends that we are seeing in terms of model capabilities, right? Number of vulnerabilities found um and where the bottleneck is shifting to. Then I want to distill the lessons we've learned from working with dozens of uh organizations to improve their security posture as well as the bottleneck that you might encounter and how you can try to address it and prep for it. And finally, I want to share how you can get started this week with links to resources. So why do we care about so much about cyber security now? Um time horizon benchmarks track the length of time an AI model can complete a task measured against an actual human doing the task. Um so we all know about the meter eval task. You know how how much knowledge what a engine can do. The UK AI security institute has a cyber security version of this. You know these tasks require identifying exploiting security weaknesses in target systems and you know testing skills like reverse engineering and web exploitation. So in this chart we see that models are able to increasingly do longer cyber security task. Um but what's also interesting is that you kind of see a step jump against the previous regression line. So these models are a step improvement in capability. And what does this step improvement in capability buy us? Recently Mozilla Firefox published a number of security bug fixes they made each month. The average in 2025 was about 20 20ish. And then you can see in February and March it kind of 3xed to about 60 and 70. And then in April it 7xed to 400. So what this means is that what's happened in April is 20x of last year's average. Um they attributed about twothirds of this to mess preview about 271 which shows that frontier models can help defenders like yourself find and fix vulnerabilities at scale. We also uh what are some notable vulnerabilities? Hands up. Who here remembers lock for shell? Anyone? Anyone was here over the December holidays like scrambling to patch this seu? So log for shell um is a bug in the Java logging library. If an attacker sends a string, you log it, the attacker can run code on your system. The Belgium defense ministry was breached within days and a fintech platform uh leaked 2 million users data. And then before that we had heartbleleed which is an a bug in open SSL. You know so much of the of the internet runs on OpenSSL and we we all know what impact it had. This is entropic sharing of our own work scanning more than a thousand open source repos. Um from 23,000 candidates uh 6,200 of them were rated as high or critical and at the time of the update 1,600 of them were reported to maintainers and about 100 patch upstream. We shared our observation that finding vulnerabilities now is quite straightforward. The bottleneck has now shifted to verification, triage, and patching. And I want to share with you everything we've learned about that so you can get ahead of it.
智能安全靶场(Agentic Harnesses)的系统设计与基础架构
为了系统化地解决这些瓶颈,企业和安全团队需要采用智能安全靶场(Agentic Harnesses: 一套结合了大语言模型与执行环境,用以自动化检测、验证和复现漏洞的智能体平台)。从多个团队的落地经验来看,这一体系的构建主要分为两个前置的准备步骤,即威胁建模与沙箱隔离。
第一步是威胁建模(Threat Modeling: 对系统资产、潜在威胁向量及信任边界进行系统化评估和文档化定义的过程)。许多安全团队发现,在接入漏洞扫描前,如果能提供一份详尽的威胁模型文档,模型检测的“真阳性率”(True Positive Rate)可以飙升至 90% 以上(通常达到 75% 以上就是一个非常优秀且实用的基准)。正如一位首席信息安全官(CISO)所言:“大模型对代码上下文的理解极其出色,但对系统全局架构的理解却相对贫瘠。” 这是因为大模型只能理解它能直接读到的代码,而对于架构师为什么这样设计系统、过往紧急排修了哪些未公开漏洞等“隐性上下文”(Implicit Context),大模型一无所知。因此,我们需要将这些资产、API 入口、敏感数据等隐性上下文提取出来并写入文档。例如,对于一个订单服务(Order Service),我们需要在威胁模型中明确定义其关键资产是包含客户敏感个人身份信息(PII)的数据,其信任边界的入口是订单查询 API,且该 API 可能存在 SQL 注入或缺乏身份鉴权等潜在威胁向量。
第二步是沙箱隔离(Sandbox Isolation: 一个无外网出口、无云凭证的受控运行环境,用于安全地测试不可信代码或引爆漏洞概念验证)。因为我们需要让大模型去编写并故意引爆漏洞概念验证(Proof of Concept: 简称 PoC,指一段用于证实漏洞确实存在并可被利用的验证性代码),甚至是运行一些不可信代码,所以必须提供严密的物理隔离。一个标准的订单服务沙箱可以通过 Docker Compose 容器编排来实现:将应用容器、PostgreSQL 数据库容器和 Redis 缓存容器连接在同一个隔离网络内,而漏洞检测 Agent 则部署在目标边界之外,通过 HTTP 协议发起探针测试。通过这种方式,我们不仅能防止大模型发生数据外泄或误操作生产环境,还能通过提供完全一致的 Baseline 基础镜像,实现漏洞复现的高一致性与可重复性。
Original English Source
So how do we do this in our own systems and code bases? Um, two words, agentic harnesses. I'm citing Mozilla again, and this was even before they worked with me preview. I'm going to read off the screen here. Early experiments showed that some promise, but the high rates of false positives made it impractical to scale. But the introduction of agentic harnesses that can reliably detect security issues has changed this. Right? These models and harnesses together can find real bugs and dismiss nonreproducible speculation. So the harness and the model working together can get a lot of work done. We found that most teams converge in approximately these six steps. And a big chunk of my talk is going to be about these six steps. Right? Right. The first two steps are set up, right? You do a bit of upfront investment per codebase. How many of you here know what a threat model is? Amazing. I love that. Uh a track model is some kind of like kind of a system design, but for your codebase or system, what are threat vectors? So, this helps you decide what are the vulnerabilities in your system that you care about. And then also, we also want an isolated sandbox where you let your model run possibly untrusted code or you let your model deliberately detonate proof of concepts of exploits. I'm going to call them pox to confirm that they are true positives. And then the next four are loop where you know we have discovery that identifies vulnerabilities. Verification confirms that they are real. We have triage. You know you can't give a developer 100 vulnerabilities. You got to identify the top 10 or 20 critical and high so they can focus their attention and then you can patch patch the bugs. So now I'm going to talk about each step. Now to make things concrete I want to share with you how they apply on a hypothetical system. So this is order service. Order service you type in a ID and then you look up an order. So what kind of vulnerabilities might we find in this? Um the first step is the threat model. So why does this matter? So several teams if you look at a code right finding have found that having a well doumented thread model really increases your true positive rate to 90%. 90% is outstanding if you ask me. I think anything above 75 is is great. That's where you want to aim for. Now to put it another way, one CISO said this, the model has great context of the code but poor context of the system. And why does this why does this happen? It's whatever the model can read, the model will understand well. But there's so much information that the model cannot read. Why did the senior designer design the system this way? What are all the vulner vulnerabilities that on call has been fixing that has not been written down? All of this is now implicit context in your head, but you need to write it down somewhere, maybe in a threel to help the model be a better security engineer. So we can work with models to build these thread models. And the track model is really just a document, right? First, we can bootstrap a trap model, give the model access to all your documents and code, even past code commits, past patches that were made and what CVE they were patching and you can ask the model to infer, hey, what possible what other CVs have not been patched, right? So a model can do that. Then after the next step is that you should ask the model to interview the expert on the system right what are some things that could happen that we didn't plan for or what are some things that we actually don't need to worry about for vulnerability because maybe this is an internal VPN only app or there's a compensating control elsewhere a lot of this is not in the code right if you look at your codebase it's not there but it needs to be written down somewhere so the model can benefit for it so here's an example thread model of order service right you know the key asset is the data you know contains customer PII and the entry point is the orders API we can also see that the model has suggested some possible threat vectors like SQL injection and that the fact that you could call this API without any form of authentication then the second step is the sandbox so isolation and reproducibility in some cases we may be running untrusted code in some cases we may be asking the model to deliberately create exploits so we want some isolation ation um to prevent the model from doing bad things. So this isolation doing bad things could be data exfiltration or you know dropping things in production and of course uh you you want all of this to be running in a VM without egress and of course without your cloud credentials. The second thing we want is reproducibility. So a lot of times uh you may find that the model may find a bug because you were using a old dependency or you want you want all of your agents to be starting from the same baseline container so that your agents can verif can can can run everything in a partners in the pipeline. So now building a repro uh representative sandbox of your system is actually quite difficult but the capability is quite useful. I think here's one team we worked with. They quoted the biggest lever we had is having the model test beds essentially sandboxes with live systems and where they can run and detonate the pox to confirm that they are true positives. So how would a sandbox for order service look like? Well this is a simple sandbox uh three docker images connected together. One for the app, one for the posgress database and one for the radius cache. And on the right we have the security agent uh which sits outside the target boundary trying to probe the app via HTTP.
闭环安全代理:从检测、独立验证到严重性分级(Triage)
在基础环境配置完毕后,便进入由大模型驱动的漏洞检测、验证和分流循环:
-
第三步:漏洞检测(Discovery):这一阶段的核心目标是优化召回率(Recall),即尽可能多地找出潜在漏洞。在实操中,我们发现随着模型能力的逐步演进,Prompt 的编写应该走向“精简”而非“面面俱到”。每当大模型能力发生台阶式跨越时,我们几乎都可以将 Prompt 压缩 50% 左右——旧模型可能需要你列出所有要防范的安全类别细则,而新模型只需给出简洁的指令(如“寻找外部不受信任数据穿过信任边界的节点”),模型便能极好地完成推理。此外,必须为检测 Agent 配备动态的辅助工具,如允许其主动查询 API、读取系统运行日志和查看源码。如果仅仅让大模型静态地“阅读”代码,效果会大打折扣;一旦赋予其动态执行工具,其真阳性率可以接近 100%。例如,检测 Agent 在五行 Python 订单查询代码中,一眼就认出了利用字符串插值拼接 SQL 语句的典型漏洞:
query = f"SELECT * FROM orders WHERE id = '{order_id}'" -
第四步:漏洞独立验证(Verification):此阶段的目标是优化精准率(Precision)。为了避免检测 Agent 在自我循环论证中产生“自我审查”并降低召回率,必须引入独立的对抗性验证 Agent。该验证 Agent 既看不到检测 Agent 的推理过程,也不知道具体上下文,仅接收漏洞报告,并以“假设该漏洞是假的”为前提,尝试编写并执行 PoC。在订单服务的例子中,验证 Agent 会在一台全新的沙箱容器中,直接执行
curl命令发起 SQL 注入请求。如果命令返回了被拖出来的客户 PII 敏感数据,漏洞即被确证为真阳性。 -
第五步:漏洞严重性分级(Triage):如果直接将验证通过的所有漏洞抛给业务开发人员,由于精力有限,开发人员很快就会对安全警报产生钝化和信任流失。因此,分流代理必须评估漏洞的实际业务影响。这就需要结合威胁模型中的隐性上下文进行“补偿性控制”的裁量:例如,虽然订单服务的 SQL 注入确实存在,但由于系统外围有应用防火墙(WAF)阻截 SQL 漏洞,且该服务仅在局域网内部提供给仓储物流系统使用,绝不暴露给互联网,分流代理在经人工确认后,便可将其似然性评级从“高危”降为“低危”。
Original English Source
Now that we have the setup done we can now move on to doing the work of discovery finding the vulnerabilities. So the first is no so what are some there there are three things that matter a lot and there's no surprises here. The first thing is really context engineering. You're going to give the model all the context as much context as you can. If the if it's written down and if you share with the model, the model can find it. The model will be a better security engineer. You'll improve your vulnerability coverage. You'll reduce your false positive rate. The second is to have simple prop simpler props. Um, how many of here have found that as models get better, you actually need to remove from your prompts. That's what I found with every new model version of StepJum, I actually have to cut my prompt size by maybe about 50%. Right? So as models get better your prompts need to be less and less specific prescriptive even while you know previous models you might ask the model to look out for specific category classes but for newer models you can just probably say something like look for where untrusted data hits the trust boundary and the model is very good at inferring this. Finally give the model tools. So one example we had a pentesting team. They give the model tools to check the response to to query the API, check the response, read the logs, read the source code. Now this is just like the tools that you give a regular security engineer, right? A lot of times you expect the model to just read the code. That doesn't quite work. Allow the model to be dynamic to read the tools uh to to run the tools. And when they did this, their true positive rate was almost 100%. because the model could actually verify in the loop. So here is the get API for the order service and it's just five lines of code. Can anyone here spot the vulnerability? You can shout it out you guys. Exactly. So this is what the discovery agent flag right you know in line four we built a SQL query via Python string interpolation. So the user input input flows straight to the SQL query right and that means that someone can inject a SQL query that excfiltrates data from your database. This is code that I would have written right as me as a non security engineer it's just a very I just write the simplest code possible and this is how it would look like current models are very good at detect spotting simple stuff like this. So after discovery so we have maybe a thousand let's say 100 vulnerabilities we may have not been able to confirm them. The next step is verification. So if you think about machine learning, discovery optimizes for recall. Find as many vulnerabilities as possible. Verification optimizes for precision. Of the 100 vulnerabilities we found, how many of them are truly optim uh truly exploitable. So we have them both working separately. So we found that it's helpful to have these two steps separately, right? Because when the discovery agent is trying to verify its own work in the loop, trying to debate against itself in the loop, it may actually self censor and this may actually hurt recall. Um, and when building the verification agent, it's helpful for the verification agent to be independent and adversarial. Independent means that the verification agent doesn't see the reasoning traces, doesn't see all the work that the discovery agent has done. All the verification agent gets is the vulnerability and it approaches it from an adversarial point of view. assume that this vulnerability is false, try to confirm it's false or confirm it's true. So this sets the this sets a very high bar for the vulnerability which reduces the false positive rate. And also if you have invested the time in building building a representative sandbox um have the verification agent build the detonate the pock to confirm if the ver the vulnerability is true. So in this case back to order service our verification agent is confirming the SQL injection right in a fresh container and this is why we have everything containers the verification agent is only given line number four here's where a SQL injection could happen and the verification agent actually tries just runs the corl command and the verification agent can see all the customer pi that has been exfiltrated. So now you have confirmation that a SQL injection can work. So after discovery and verification, we've maximized recall, we've optimized for precision, the next step is triage. So a lot of this may truly fire, but some of these are bug correctness issues. They have very low business impact. So across multiple teams, they shared that you can lose trust with product engineers by sending them all the vulnerabilities that are true, even those that are medium or low severity because those engineers can't cope. And as we've seen so many times, the scars resource now is engineer attention. So imagine you're a product engineer. What are the kinds of vulnerabilities you want to actually receive and fix? So as part of this step, we can do dduplication, you know, cheap heristic checks or we can get a model to help you with clustering and dduplication. We should also consider the severity of the exploit, right? Uh one thing to consider is the magnitude of the outcome of the impact. What is the magnitude? Is it a ring zero magnitude or ring one magnitude? Um, and also the likelihood of it occurring, right? How many hoops does an attacker have to jump through to actually make that exploit? And this is where the thread model is useful to all. You can decline the thread model as just synonymous with context. Just give the model context about your business, right? So for example, compensating controls. If you have a firewall, something that was initially high severity could actually be low. On the other hand, if you know that your database is mostly customer PI data or healthcare data, a model might have have set that as medium severity, but it actually could be high because the the contents of your data are so sensitive. So in this case, we have on the left triage that the agent has done. The agent has said that this is high severity for these reasons, right? High impact, high likelihood. Now on the right after human review the operator has confirmed that you know has downgraded this to low likelihood and the reason why it's low likelihood is because we have an application firewall that blocks SQL injections and also there's the fact that the service is internal only it's only for internal I warehousing or internal logistics it's not it's never internet facing therefore the likelihood is low now you can imagine like how would the model know this this is not written in a codebase it may be available in a system design it may be available in your documentation, it may be available in your confluence etc. So this is the kind of context you need to provide to the model so that the model can get better at this.
自动化补丁生成与组织治理落地的核心壁垒
在确立漏洞和划分优先级后,整个体系将迈向最终的闭环:
- 第六步:补丁生成与验证(Patching & Validation):补丁 Agent 会自动为漏洞代码生成修复方案。在这个过程中,需要采用生成式校验器循环(Generative Verifier Loop):模型生成单线修复(例如将原有的字符串拼接 SQL 改为参数化查询以阻断 SQL 注入)后,系统会启动两个层面的校验。首先,原本验证成功的 PoC 命令必须彻底失效;其次,原有的业务测试套件必须保持全绿通过,以防引入功能性衰退。最后,补丁还可以提交给一个全新的检测 Agent 进行对抗性再攻击,确保修复方案不存在二次绕过的可能。在通过上述所有的闭环自动化验证后,最终提交给人类进行代码合并审查(Merge Review)。
然而,非技术性的组织瓶颈往往比技术本身难上一个数量级。在推进大模型安全治理落地时,企业通常会遭遇以下三大瓶颈:
- 漏洞路由分配(Vulnerability Routing):当月均漏洞数量从十几个上升到数百个时,人工派单已不再现实。企业需要基于
CODEOWNERS(代码所有权配置文件)或服务归属字典,实现无大模型参与的低成本自动派单。 - 严重性校准规则(Severity Calibration):安全团队(红队/蓝队)和业务开发团队对“什么是高危漏洞”的理解经常不一致。必须通过跨部门会议,将业务场景、补偿控制等边界条件一次性落笔写成规则文档,并将这些共识输入给大模型。
- 修复带宽与学习曲线(Patching Bandwidth):不要指望一步到位实现全自动闭环。企业应当选择“双手握住方向盘”的交互式起点,让工程师在 Claude Code 或日常集成开发环境(IDE)中先以半自动方式使用,摸清大模型缺失哪些隐性上下文、在哪些场景下精度降低,然后再向高度自动化的安全管线演进。
Original English Source
Now after that we close the loop patching to validate the patch you know we can build a patch and then we want to validate there's a ladder of sorts first the original PC has to stop working that's basic second the existing test suite should stay green no regression and then we can go further right we can have a fresh discovery agent try to attack the patch code again is the patch comprehensive enough and teams have found that by giving the patching agent such feedback um you can actually the patch quality improves greatly right and you know This is the generative verifier loop. Give your agents context, give your agents feedback, and they they can do the do their work. And finally, a human confirms the patch before it's been merged. So here's how the patch will look like. You know, in the first div, we update the code, it's a oneline fix where we move the variable out of Python uh and therefore we reduce the code of SQL injection. And in the second div, not only do we update the code, not only do we fix the system, we close the loop. We make sure that the next time we run this loop, we run this scan, these issues don't happen again. And this is really important when you're building the building harnesses, right? You're building loops. They're operational expense, but when you close the loop, they now become capital expense. You get better with each iteration you run. So you make clear the compensity controls. We have the application firewall and the fact that it's internal only. Okay. So the quick recap, these are the six steps and each step focuses on one thing. Track model provides context. Sandbox provides isolation and reproducibility. This is the baseline fundamentals that you need to have. This will carry throughout every scan. You have context and reproducibility. Then after that, the rest is really if you look at it, it's if you if you squint, it actually looks like an ML pipeline. Recall, precision, ranking, and closing the loop. It's a regular machine learning pipeline. Now, that's the technical challenge we have. There's another technical challenge we have. And as my previous director would say, non-technical problems are an order of magnitude harder than technical problems. So what are some other bottlenecks you might have? So imagine you have a process. What happens when you have one or two orders of magnitude more input? What is going to start to break? In the case of the harness, the scanning harness, you just have more engineering. You spend more compute. You pay more money. Things that can be solved with money are not really problems. But human attention doesn't scale. Your deaf, your product engineers and your security engineers, what if they don't agree on what high severity or uh critical severity is? You need to put them in a room. You need to write down all these rules so that everyone agrees. And you know your threat models, they're all stuck in people's heads right now. Someone needs they need to be interviewed maybe by a model or by someone else and write all that trap model down so that now you can have agents help you. And finally, you know, patching patch patch review. Um, I still don't know of many companies that gone through fully automated patch review, especially when p uh patching security issues. So, here are some organizational bottlenecks that you might hit and what you can do. The first thing is vulnerability routing. So, if you maybe get a dozen vulnerabilities a month, you can probably curate them. You know, email them to specific teams, assign Jira tickets. When you have hundreds, you can't do this. And this can really be as simple as you know sending it to the code owner etc. um or or the service owner and it doesn't really need an LM in the loop. Then second thing is severity calibration. The the one hard thing we found is that product engineers and security engineers red team blue team they may not agree on what high severity is and all this requires a lot of your business context. I really think it helps to have everyone discuss and write it all down once and for all agree upon that that you can send that to agent and finally the patching bandwidth. Um I'm sure no one writes very few of you here write code by hand now but it's also very challenging for you to just be given the vulnerability and try to implement a patch even with LM assistance. you definitely want to be moving towards AI generated patches and then have the human loop verify and you know generate the patch reattack the patch. Okay, if you only remember one thing well here are the three things you want I want you to remember. I would like to you start now please start with open source dependencies start with whatever you're comfortable with. Two I want to teach you how to climb the learning curve. Don't try to aim for automation immediately. Right? Start interactively. Do it hands on the wheel with uh claw code or your favorite ID. Doesn't matter. Learn where you get cut. Learn what kind of context you're missing. Learn where precision is low. Then third is don't just aim for scanning. Uh scanning is not the bottleneck. Verification, triage, and patching. And then all your organizational processes. Those are the bottleneck. Over there. I have a couple of resources. We have cloud security to scan your codebase, validate findings such as patches. We have a blog. We have open source repos for with that includes the interactive skills and autonomous harnesses and all you have to do is to run this few steps to very quickly get hands on the wheel and in it if you look at step five you have the harness and you can just customize it. That's all I had. Thank you.