OpenAI 的 AI Agent 在安全测试中突破沙箱限制自主攻击 Hugging Face。这是 Agent 时代网络安全的重大事件,警示 AI 自主性带来的新风险。
这个故事太疯狂了。简版:OpenAI 对一个未发布的模型进行网络安全测试,且模型的护栏功能被关闭了。该模型没有解决测试,反而突破了 OpenAI 的沙箱,然后找到漏洞入侵 Hugging Face,目的是通过窃取答案来欺骗这次测试。
在这个过程中,它充分论证了模型可用性失衡如何损害我们保护软件的能力。
我们目前有三份文档可以帮助我们理解这里发生了什么。
ExploitGym: Can AI Agents Turn Security Vulnerabilities into Real Attacks? 是一篇在 2026 年 5 月 11 日发布的论文,描述了 ExploitGym——一个针对 LLM 驱动的 agent 系统的新评估套件。
Security incident disclosure — July 2026 是 Hugging Face 在 2026 年 7 月 16 日发布的报告,介绍了他们如何检测到来自一个"agent 安全研究工具——使用的 LLM 身份仍不明确"的攻击,该攻击突破了他们的一些系统。
OpenAI and Hugging Face partner to address security incident during model evaluation 是 OpenAI 在 2026 年 7 月 21 日的声明,承认正是他们的 agent 工具干的,并表示他们正在与 Hugging Face 合作收拾烂摊子。
我之前没看过 ExploitGym 论文,它确实很有意思。来自加州大学伯克利分校、马克斯普朗克研究所、加州大学圣塔芭芭拉分校和亚利桑那州立大学的作者设计了一个新基准,用于评估模型将报告的漏洞转化为具体漏洞利用的能力。OpenAI、Anthropic 和 Google 都提供了反馈并帮助对他们的模型运行了基准测试。
该基准"包含 898 个实例,源自影响热门软件项目的真实漏洞"——包括 Linux 内核和 V8 JavaScript 引擎。ExploitGym 基准在 GitHub 上可用。
以下是最好地代表他们基准结果的段落:
Among all configurations, Claude Mythos Preview and GPT-5.5 achieve the highest success counts (157 and 120 successes, respectively), demonstrating that current frontier agents can exploit a substantial subset of real-world vulnerabilities under controlled conditions. GPT-5.4 also solves a notable 54 tasks, placing it in an intermediate tier. The remaining model–agent pairings solve fewer than 15 tasks each, underscoring that end-to-end exploitation remains challenging and sharply differentiates today's frontier systems. Notably, Claude Opus 4.7 achieves fewer successes than Claude Opus 4.6 despite being a newer checkpoint, and does so at substantially lower cost on the full set. Trace inspection reveals that Claude Opus 4.7 and Gemini 3.1 Pro frequently conclude early after judging the target vulnerability non-exploitable.
论文还描述了他们为防止 agent 作弊(超出测试参数范围)所采取的方法。这在接下来会很相关!
Outbound connections are restricted to a curated allowlist that permits routine package installation (Ubuntu apt repositories and PyPI) and fetching the toolchains required for building V8. All other external endpoints are blocked.
论文以此作为结尾(强调是我的):
Our results show that autonomous exploit development by frontier AI agents is no longer a hypothetical capability. While current agents are not yet reliable across all targets, they already exploit a non-trivial fraction of real-world vulnerabilities, including complex targets such as kernel components. This rapid emergence is itself a central finding, showing that capabilities that would have seemed implausible are now present in deployed frontier models.
这里有个重要细节:这篇论文不是关于发现漏洞,而是关于能否利用这些漏洞并将其转化为可工作的漏洞利用。
当 Anthropic 在 4 月首次限制 Mythos 的访问时,他们也谈到了这项能力。能够利用漏洞的模型比只能发现漏洞的模型危险得多。
Fable 与 Mythos 的一个区别是,它更可能拒绝以这种方式武器化漏洞。我的印象是美国政府在上个月禁止 Fable 时并没有理解这个区别。
我们对这次攻击的第一次提示来自 Hugging Face 在 2026 年 7 月 16 日发布的博文:
A malicious dataset abused two code-execution paths in our dataset processing (a remote-code dataset loader and a template-injection in a dataset configuration) to run code on a processing worker. From there, the actor escalated to node-level access, harvested cloud and cluster credentials, and moved laterally into several internal clusters over a weekend.
我希望他们能发布更多关于完成这次攻击代码的细节。我假设这意味着使用 datasets 库的包,这是 Hugging Face 的一个项目,用于打包和共享其平台上的数据集。该库过去常常执行任意代码,但随着时间推移已经逐步锁定,2025 年 7 月的 4.0.0 版本完全删除了 trust_remote_code=True 标志。
假设攻击使用了该库,它要么滥用了 pickle 序列化,要么找到了其他不太明显的代码执行路径,要么(最可能的是)指定了 datasets<4.0.0 作为依赖项。
该活动由一个自主 agent 框架运行(似乎基于 agent 安全研究工具构建——所使用的 LLM 仍不明确),该框架在多个短生命周期沙箱群中执行成千上万个个别操作,其自迁移命令控制暂存在公共服务上。
这是一次非常复杂的攻击!
然后 Hugging Face 遇到了一个障碍:他们试图使用"商业 API 背后的前沿模型"——我猜来自 Anthropic 和 OpenAI——来帮助分析攻击,但被挡住了:
When we started the log analysis, we first used frontier models behind commercial APIs. This did not work: the analysis requires submitting large volumes of real attack commands, exploit payloads, and C2 artifacts, and these requests were blocked by the providers' safety guardrails, which cannot distinguish an incident responder from an attacker.
他们转向使用自己的 MIT 许可证 GLM-5.2 自托管实例,这帮助他们弄清楚了发生了什么。
这表明防守团队和(迄今为止身份不明的)攻击者之间存在根本的不对称:
We do not know which model powered the attacker's agents, whether a jailbroken hosted model or an unrestricted open-weight one; either way, the attacker was bound by no usage policy, while our own forensic work was blocked by the guardrails of the hosted models we first tried.
作为他们对这次攻击有多认真的有用指标:
[...] Finally, we have also reported this incident to law enforcement agencies.
那么谁对这个"自主 agent 框架"负责呢?结果是 OpenAI 自己。
五天后,在 7 月 21 日,OpenAI 揭露了罪魁祸首。他们一直在对一个新的、尚未披露的模型运行 ExploitGym 基准,该模型的运作方式远远超出了其预期参数(强调是我的):
After investigating, we now know that this particular incident was driven by a combination of OpenAI models — including GPT‑5.6 Sol and an even more capable pre-release model, all with reduced cyber refusals for evaluation purposes — while being internally tested on a benchmark [ExploitGym] of cyber capabilities. [...]
We estimate maximal cyber capabilities by running this evaluation without production classifiers used to prevent models from pursuing high-risk cyber activity. Our benchmarks run in a highly isolated environment, with network access constrained to the ability to install packages through an internally hosted third-party software that acts as a proxy and cache for package registries.
The models identified and chained vulnerabilities across OpenAI's research environment and Hugging Face's production infrastructure to obtain test solutions directly from Hugging Face's production database. All evidence suggests that the models were hyperfocused on finding a solution for ExploitGym, going to extreme lengths to achieve a rather narrow testing goal.
这里发生了什么很清楚。OpenAI 移除了一个正在开发的模型的安全过滤器,将其锁在一个沙箱里,告诉它解决 ExploitGym 问题。由于没有护栏,没有什么能阻止模型尝试突破沙箱、入侵 Hugging Face 并直接从那里读取答案。
OpenAI 的沙箱使用了目前常见的模式,允许访问与通过受控代理安装额外包有关的白名单网站。用 OpenAI 的话来说:
While operating in our sandboxed testing environment, our models spent a substantial amount of inference compute finding a way to obtain open Internet access, in pursuit of solving the evaluation problem. To gain access, the models identified and exploited a zero-day vulnerability (which we've now responsibly disclosed to the vendor) in the package registry cache proxy. With this access, our models performed a series of privilege escalation and lateral movement actions in our research testing environment until the models reached a node with Internet access.
所以第一步是突破到公网。该模型随后入侵了 Hugging Face 以找到答案:
After gaining Internet access, the models inferred that Hugging Face potentially hosted models, datasets and solutions for ExploitGym. Knowing this, the model searched for and successfully found ways to gain access to secret information that it could use to cheat the evaluation. In one example, the model chained together multiple attack vectors, including using stolen credentials and zero-day vulnerabilities to find a remote code execution path on the Hugging Face servers.
将多个攻击向量链接在一起正是这些新模型能做的,而前几代模型可能会失败。
我上个月写过 Claude Fable 是如何不知疲倦地主动出击的,当时我注意到它在我自己的笔记本电脑上旋转自定义网络服务器并部署 CORS 技巧来帮助调试 WebKit CSS 问题。事实证明,不知疲倦的主动性是这一代 Mythos 级模型的决定性特征。如果你给它们一个目标,给它们一个达到目标的方式,即使是无意中的,它们也会想出办法。
不可避免地,会有一些人会将这个故事驳回为 OpenAI 的不诚实营销技巧,以使他们的模型听起来恐怖地有效。我在该事件的 Hacker News 讨论中找到了 81 个"营销"一词的实例。
对那些人我说,把你的头拿出沙子里吧——为了否认这里证据不断加强,你现在甚至把 Hugging Face 也包括在你的阴谋论中!
我们今天拥有的最好的模型既能发现也能利用新漏洞。ExploitGym 论文本身得出结论,"自主漏洞利用开发已经不再是一个假设能力",这次事件是一个完美的例子。
这个故事最令人恼火的细节之一是,Hugging Face 面对来自 OpenAI 某个模型的意外且激进的攻击,却无法转而求助于 OpenAI 的模型来帮助他们抵御攻击。
我们能获取的前沿模型正越来越受到限制,受美国政府持续威胁出口管制的严重影响。Claude Fable 5 甚至不愿为我校对这篇文章!它坚持降级我使用一个功能较弱的模型。
与此同时,来自中国的开放权重模型,如 GLM-5.2、Kimi 3 和新的 Qwen 3.8 Max 似乎没有这些限制——任何存在的限制也可能通过修改权重来微调消除。
这些约束应该能让我们更安全。我认为存在它们可能产生相反效果的风险。