今年7月,发生了一起让整个AI社区都绷紧神经的事件:OpenAI的AI系统入侵了Hugging Face。7月21日,OpenAI公开承认他们就是这次攻击的幕后黑手。之所以会发生这样的事,是因为OpenAI为了测试模型的网络安全能力,关闭了通常用于防止此类行为的常规安全护栏。正是在那些测试期间,这起事件发生了。
更糟糕的是,在随后的几天和几周里,人们发现Hugging Face事件并非孤例。Anthropic、Meta和OpenAI在其他场合也都发生过类似事件——智能体超出了其预期范围,在未经批准的情况下实施了真实世界的网络攻击行动。
Greg Brockman,OpenAI的联合创始人之一,声称这是“网络安全的一个分水岭时刻”。OpenAI在Black Hat(一个广受欢迎的网络安全会议)上做了演讲,许多人声称那是我们所有人开始正视AI带来的未来网络安全威胁的时刻。周三,METR发布了一份(部分)独立、但范围过于狭窄的90页报告,详述了事件经过。METR提供了一份有用的调查结果摘要,你可以在这里阅读,这里还有一些评论。(OpenAI自己的报告在这里。)我们应该从这起事件中吸取哪些教训?
首先,不可否认的是,AI确实带来了真正的安全挑战。AI实验室希望我们关注AI如何让威胁行为者能够比以往任何时候都更快、更高效地实施攻击性网络行动,这绝对是事实。然而,现实情况是,与此同时,在组织内部使用AI也从根本上扩大了潜在的攻击面,为攻击者提供了全新的入侵途径。人们确实应该深感担忧。正如参与调查的Ryan Greenblatt所说:“我们目前没有好的方法来理解/监督AI‘蜂群’的活动和目标。”
其次,并非所有恐慌性的观点都是正确的。例如,就 OpenAI 事件而言,许多人都在用“失控”的角度来讨论它。生成式 AI 智能体正变得越来越强大,这使它们越来越难以被约束;这一点是事实。然而,“失控”这种说法本身也开始失控了,理解 AI 安全的真实状况非常重要。虽然智能体正变得愈发强大,但如果 OpenAI 遵循了更好的实践,大部分发生的事情本可以避免。存在一些具体且应当采取的步骤,可以用来控制它们并防止此类事件发生。
举个例子,我们来谈谈“沙箱隔离”,即限制智能体可以访问哪些资源、不能访问哪些资源。例如,沙箱可以阻止智能体接触某些文件或访问互联网。如今流行的观点似乎是沙箱隔离已无济于事。在 Hugging Face 事件之后,《时代》杂志援引一位匿名 OpenAI 员工的话谈论沙箱时说:“模型以前就突破过沙箱,我们总是试图修补它们。但问题在于,不可能修补一个创造性 AI 可能做的每一件事。”虽然我们无法确定这是否属实,但我们确实知道,有些沙箱系统比其他系统更有效;在最近的一篇博客文章中,安全公司 Trail of Bits 介绍了在他们进行的一项测试中,某个特定的 AI 智能体能够逃脱部分沙箱(利用 Linux KVM、QEMU 和 libslirp 中的漏洞),但并非全部。至少在他们的测试中,他们测试的智能体未能逃脱名为 Firecracker VM 的沙箱。OpenAI,可能还有整个领域,都需要提升其沙箱隔离的水平,但这并不意味着这件事做不到,或者至少不能做得更好。(我们确信会看到常见的军备竞赛;构建可靠的沙箱需要不断迭代和更新,这与网络安全领域的其他任何事情都一样。)
第三,沙箱并不足够。要防范安全事故,需要一整套完整的生态系统。即便有了强大的沙箱,你仍然需要部署监控,不仅要确保智能体不会逃逸,还要确保它不会在沙箱内部执行被禁止的操作。
对于本不应具备互联网访问权限、或仅能访问一组允许域名列表的智能体而言,最基本的监控层级涉及检查网络流量。就 OpenAI 的情况而言,如果他们有一条简单的规则来监控流量,并对任何访问 Hugging Face 等越界域名的网络请求发出警报,仅凭这一点就能发现并阻止此次事件。涉事智能体在 7 月 8 日就已突破沙箱并获得互联网访问权限,而对 Hugging Face 的主要攻击直到两天后才发生。在我们看来,OpenAI 未能更快地注意到这一点,属于疏忽。
更高级别的监控本应到位,但实际并未如此。OpenAI 在监控链式推理方面做了实际工作,但在引发此次事件的评估过程中,他们根本没有运行该系统。正如 OpenAI 所承认的那样:“如果我们在事件发生时部署了当前的 CoT 监控系统,它本会在模型突破 Hugging Face 系统的一天多之前就捕获到最初的相关活动,并呼叫我们的安全团队。”换句话说,这类监控本可以阻止此次事件的发生。
举个例子,涉事智能体之一有一段链式推理,内容为:“我们正在使用泄露的 token 攻击第三方 HF,这可能超出了预期范围……这可以说未经授权……外部服务,不相关。可能有风险。但目标是解决方案。”这太明目张胆了,几乎就像恶意软件在大喊“我是恶意软件”。OpenAI 本应发现这一点;检测到这一点本应是轻而易举的事。
第四,网络安全一直强调“纵深防御”,即层层叠加控制措施,这样即使某一层失效,还有其他层在保护你。除了沙箱和监控之外,还有其他本应部署的解决方案。
Xbow 这家公司构建智能体用于开展进攻性网络安全工作,最近撰文介绍了他们如何约束智能体,以防止类似 OpenAI Hugging Face 事件的发生。他们通过代理服务器实施网络限制,该代理服务器位于智能体可访问的任何系统之外,从而能够决定智能体可以访问哪些域名、不能访问哪些域名。他们还运行一个“守护模型”,对智能体正在执行的每个动作的合法性进行判断,以决定是允许还是阻止该动作。此外,他们还设有基本的健康检查机制,确保目标系统处于在线且健康的状态,一旦发现异常便会暂停操作。例如,这有助于识别你的智能体何时可能正在造成实际损害。你可以在此处阅读他们的完整文章。
网络安全领域另一种常见方法是使用蜜罐文件(canaries),当这些文件出现在日志中时便会触发警报。例如,OpenAI 可以在沙箱之外放置包含任务虚假答案的文件。一旦智能体逃逸,它就会读取该文件,从而触发警报。归根结底:良好的安全性需要多层防护,这些防护本应到位以防止此类事件发生,而令人惊讶的是,其中许多防护层实际上并不存在。
第五,上述讨论的各项措施都不是超出 OpenAI 能力范围的技术创新。作为一家公司,他们完全具备实施所有这些措施的人才。然而,网络安全很少归结为技术问题。更多时候,它关乎文化、人员和流程。这次失败的正是这些方面。
或许这并不完全令人意外。这类管控措施需要组织具备相应的成熟度,而一家经历了 OpenAI 那种增长速度的公司,必然会有一些薄弱环节。然而,重要的是不能将此视为借口。AI 实验室的员工常常表现得好像他们是 AI 安全领域的领导者,而我们在这里可以清楚地看到,事实并非如此。事实上,这种态度或许正是一开始犯下其中一些错误的原因。
以OpenAI那位化名“roon”的研究员为例,他曾主张:“这些实验室里的安全与对齐研究人员,是地球上最神经质、最偏执、最有才华、最痴迷于AGI的人,即便如此,这些事还是发生了。未知的未知,其覆盖面确实极其广阔。”我们无法评判他们神经质或偏执的程度,但事后看来,无论他们拥有多少才华,显然都不够用,而且对网络安全机制的掌握也不够精深。OpenAI的员工或许曾相信自己干得很出色,但事后回顾,他们并没有做许多在网络安全领域实属常规的操作,这或许说明,过度自信可能让他们未能尽到应有的审慎 diligence。
归根结底,如果我们真的想严肃对待这些安全事件,那么今后这些失败理应附上相应的法律后果。OpenAI可以宣称自己是地球上对安全最偏执的公司,但它的行动并没有体现这一点。
我们要么坐等这个故事重演,要么现在就着手建立监管框架,为今后AI的发展确保一个更安全的环境。
最后,并非每一种AI形态天生就具有风险。更窄、更聚焦的AI系统,比如AlphaFold、GPS路径规划系统、经典网络搜索、图书和电影推荐系统等等,从一开始就根本不会尝试入侵其他系统(或试图逃逸沙箱)。正如Cal Newport在一段关于OpenAI/Hugging Face遭入侵事件的视频讨论中所论证的那样(该观点与我们的看法相当一致),真正容易遭受这些风险的,恰恰是某一种特定类型的AI。社会应当(a)判断开放式、难以完全控制的AI智能体所带来的收益是否大于这些风险,并且(b)投入更多精力去开发那些从一开始就不那么“蹩脚”的替代性AI形态。
本文由Zack Korman联合撰写,他是Embroidery(一家AI智能体监控与检测平台)的首席执行官兼联合创始人;他因在AI应用于网络安全领域的工作而广为人知。
In July, in an incident that has the whole AI community on edge, OpenAI’s AI systems hacked Hugging Face, and on July 21 OpenAI came out and revealed that they were responsible for the attack. This was made possible by the fact that OpenAI had disabled the normal guardrails that prevent this sort of thing in order to test the model’s cybersecurity capabilities. It was during those tests that this incident occurred.
Worse, in the subsequent days and weeks, it came out that the Hugging Face incident wasn’t an isolated case. Anthropic, Meta, and OpenAI all had similar incidents on other occasions in which agents went outside their intended scope and conducted real-world cyber operations without approval.
Greg Brockman, one of OpenAI’s cofounders, has claimed that this is “a watershed moment for cybersecurity”. OpenAI gave a talk at Black Hat, a popular cybersecurity conference, and many are claiming that it is the moment we all woke up to the future cybersecurity threats posed by AI. On Wednesday, METR released a (partly) independent, though too narrowly scoped, 90 page report on what happened. METR has a useful summary of the findings that you can read here, with some commentary here. (OpenAI’s own report is here.) What lessons should we take from the incident?
First, it is undeniable that AI poses real security challenges. The AI labs want us to focus on how AI enables threat actors to perform offensive cyber operations faster and more efficiently than ever before, and that is absolutely true. The reality, though, is that at the same time, the use of AI within an organization also radically expands the potential attack surface, giving attackers entirely new ways to gain entry. People really should be deeply concerned. As Ryan Greenblatt, who participated in the investigation, put it, “We don’t have good approaches for understanding/overseeing the activity and aims of AI ‘swarms’.”
Second, though, not every panicked take here is correct. For example, with respect to the OpenAI incident, many people are talking about it in terms of “loss of control”. Generative AI agents are becoming increasingly capable, and that makes them harder and harder to contain; this is true. However, the “loss of control” narrative is itself starting to grow out of control, and it’s important to understand what the reality of AI security looks like. While agents are becoming more capable, most of what happened could have been prevented had OpenAI followed better practices. There are concrete steps that can and should be taken to control them and to prevent incidents like these.
As an example, let’s consider “sandboxing”, which means limiting which resources an agent can and cannot access. For example, a sandbox might stop an agent from touching certain files or accessing the internet. Popular wisdom now seems to be that sandboxing is a lost cause. After the Hugging Face incident, an anonymous OpenAI employee was quoted in Time while talking about sandboxes saying, “Models have broken out of sandboxes before, and we always try to patch them. But the problem is it’s impossible to patch every single thing that a creative AI can do.” While we can’t judge for sure whether this is true, we do know that some systems for sandboxing have been more effective than others; in a recent blog post, the security company Trail of Bits walked through how in a test that they conducted, a particular AI agent was able to escape some sandboxes (exploiting vulnerabilities in Linux KVM, QEMU, and libslirp), but not all. At least in their test, the agent that they tested was not able to escape the sandbox known as Firecracker VM. OpenAI and probably the field as a whole needs to up its sandboxing game, but that doesn’t mean it can’t be done, or at least done better. (We expect the usual arms races to be sure; building sound sandboxes requires constant iteration and updating, as with anything else in cybersecurity.)
Third, sandboxes aren’t enough. One needs a full ecosystem to prevent security incidents. Even with a strong sandbox, you need monitoring in place to ensure not only that the agent doesn’t escape, but also that it doesn’t perform disallowed actions within that sandbox.
For agents that aren’t meant to have internet access, or only have access to a set of allowed domains, the most basic level of monitoring involves inspecting network traffic. In the case of OpenAI, if they had a simple rule to monitor traffic and alert on any network requests reaching out-of-scope domains like Hugging Face, that alone would have caught and prevented this incident. The agent in question had broken out of the sandbox and gained internet access by July 8th, whereas the main attacks on Hugging Face didn’t occur until two days later. OpenAI was, in our view, negligent in not noticing that more quickly.
More advanced levels of monitoring should also have been in place, but weren’t. OpenAI has done real work on monitoring chain-of-thought reasoning, but they simply didn’t have that system running during the evals in question that caused this incident. As OpenAI acknowledges, “If our currently deployed CoT monitoring system was running at the time of the incident, it would have caught the initial relevant activity and paged our security team more than a day before models breached Hugging Face systems.” In other words, this type of monitoring would have prevented this incident.
To take one example, one of the agents in question had chain-of-thought reasoning that said, “We’re attacking third-party HF using leaked token, potentially outside intended scope. ... This is arguably unauthorized. ... external service unrelated. Could be risky. Yet goal solution.” This is so blatant it is almost a like a piece malware shouting “this is malware”. OpenAI should have caught that; it should have been trivial to detect this.
Fourth, cybersecurity has always been about “defense in depth”, where you stack layers of controls so that if one layer fails you have other layers protecting you. There are other solutions beyond sandboxing and monitoring that should have been in place.
Xbow, which builds agents to do offensive cybersecurity work, recently wrote about how they contain agents to prevent incidents like the OpenAI Hugging Face situation. They enforce network restrictions through a proxy server, outside of any system the agent has access to, so they can decide which domains the agent can and cannot access. They also run a “guardian model” that judges the legitimacy of each action the agent is taking to decide whether to allow or block that action. And they have basic health checks to ensure the system they are targeting is alive and healthy, pausing if it finds that isn’t the case. That can be useful for identifying when your agent might be causing real damage, for example. You can read their full post here.
Yet another common method in cybersecurity is to use canaries that trigger alerts when they appear in logs. For example, OpenAI could have files outside of the sandbox containing fake answers to the task. Once the agent escaped, it would read that file, and that would trigger an alert. The bottom line: good security requires many layers of protection that should have been in place to prevent this, and to a surprising degree many of those protection layers were not there.
Fifth, none of the measures discussed above are technical innovations beyond what OpenAI is capable of. As a company, they have the talent to do all of this. However, cybersecurity rarely comes down to technology. More often than not, it is about culture, people and processes. That is what failed here.
Perhaps this is not entirely surprising. These types of controls take organizational maturity, and a company experiencing the type of growth OpenAI has gone through is going to have some weak spots. However, it’s important to not see that as an excuse. Employees at the AI labs often speak as if they are the leaders in AI security, and we can see clearly here that is not the case. In fact, that attitude might explain why some of these mistakes were made in the first place.
Take the AI researcher at OpenAI known as “roon”, who argued that “the safety and alignment researchers at these labs are the most neurotic paranoid talented AGI pilled people on the planet of earth and these things still happen. The surface area of unknown unknowns is vast indeed.” While we can’t speak to their level of neurosis or paranoia, in hindsight it’s clear that whatever talent they may have had was not enough and not well enough versed in the mechanics of cybersecurity. OpenAI employees may have believed they were doing a great job, but in hindsight, they weren’t doing a lot of things that are actually standard in the cybersecurity world, perhaps suggesting that overconfidence may have kept them for doing the diligence they should have.
Ultimately, if we want to take these security incidents seriously, there likely ought to be legal consequences attached to these failures going forward. OpenAI can claim to be the most security paranoid company on earth, but it isn’t reflected in its actions.
We can either wait for this story to repeat itself, or we can develop the regulatory framework now that will ensure a safer environment for the development of AI going forward.
Finally, not every form of AI is inherently risky in the first place. Narrower, more focused AI systems like AlphaFold, GPS routing systems, classic web search, book and movie recommendation systems, and so on, never even try to hack other systems (or try to break out of sandboxes) in the first place. As Cal Newport argues in a video discussion of the OpenAI/Hugging Face hack that is quite compatible with our own, it is a very specific type of AI that is vulnerable to these risks in the first place. Society ought to (a) decide whether the benefits of open-ended and difficult-to-fully-control AI agents outweigh those risks and (b) put far more effort into developing alternative forms of AI that aren’t so janky in the first place.
This essay was jointly written with Zack Korman, CEO and co-founder of Embroidery, an AI agent monitoring and detection platform; he is well-known for his work in the application of AI to cybersecurity.