The Lede

Inside OpenAI’s Hack of Hugging Face

OpenAI 入侵 Hugging Face 事件内幕
Hugging Face’s chief science officer recounts the cybercrime that signals a terrifying new era for A.I.
Hugging Face 首席科学官讲述这起网络犯罪,它标志着人工智能一个可怕的新时代。
An exterior view of a modern office building.
Photograph by Lucas Foglia / NYT / Redux

The first indications of what would prove to be one of the most consequential computer hacks of all time went mostly unnoticed. On July 9th, a mysterious attacker, using a collection of temporary internet addresses, began probing the website of Hugging Face, an A.I.-research hub headquartered in New York City. The intruder would open a portal at one address, ping the servers a few times, then close it. Then a similar portal at another address would open, send a few pings, and close. This went on through the evening; the next day, a Friday, it petered out.

这起后来被证明是史上影响最深远的计算机入侵事件,其最初迹象几乎无人察觉。7月9日,一名神秘攻击者利用一批临时网络地址,开始探测总部位于纽约的人工智能研究枢纽 Hugging Face 的网站。入侵者会在一个地址打开端口,向服务器发送几次探测信号,然后关闭。接着,另一个地址的类似端口又会打开,发送几次探测,再关闭。这种活动持续了整个晚上;第二天是周五,攻击逐渐平息。

The cybersecurity team at Hugging Face seems not to have noticed the early activity. Hugging Face is a kind of community space for A.I. researchers: it hosts A.I. models, virtual scientific workspaces, and data sets for evaluating A.I. quality. The company is popular and well respected, but it is also a target for hackers. (It is named after an emoji.) The probes looked like an annoyance—probably the work of some kids.

Hugging Face 的网络安全团队似乎没有注意到这些早期活动。Hugging Face 是人工智能研究者的社区空间:它托管人工智能模型、虚拟科学工作区,以及用于评估人工智能质量的数据集。这家公司广受欢迎且备受尊敬,但同时也是黑客的目标。(它的名字源自一个表情符号。)这些探测看起来像是一种骚扰——大概是一群小孩的恶作剧。

On Saturday, July 11th, the assault began in earnest. Using stolen credentials, the adversary once again opened numerous simultaneous connections to Hugging Face’s servers. Soon, dozens of virtual attackers were blinking in and out of existence. “It was moving really fast, and very, very, massively parallel,” Thomas Wolf, Hugging Face’s chief science officer, told me.

7月11日,星期六,攻击正式开始。对手利用窃取的凭证,再次同时打开大量通往 Hugging Face 服务器的连接。很快,数十个虚拟攻击者忽隐忽现,不断出现又消失。“它移动得非常快,而且是大规模、高度并行的,”Hugging Face 首席科学官托马斯·沃尔夫(Thomas Wolf)告诉我。

No one at the firm had ever seen an attack like this. Wolf, narrating the action, sounded as if he were describing an encounter with a U.F.O. The attack seemed uncoördinated, agents often duplicating the same action in multiple places. Sometimes, the hacker would employ clever tactics, but these would be followed, seconds later, by basic errors, and, according to notes from a conference call, “clumsy behaviors that no human would choose.” The attacker left strange messages—hallucinated, machine-generated slop. “We had, quite quickly, the idea that this was some form of A.I. agent targeting us,” Wolf said. The initial theory at Hugging Face was that some group of humans had harnessed an A.I. to conduct the attack on its behalf.

公司里没人见过这样的攻击。沃尔夫讲述整个过程时,听起来像是在描述与不明飞行物的遭遇。攻击看似毫无章法,多个代理经常在不同地方重复相同的操作。有时,黑客会使用巧妙的战术,但几秒钟后又会犯下基本错误,并且根据一次电话会议的记录,出现“人类绝不会选择的笨拙行为”。攻击者留下了奇怪的信息——像是机器生成的、幻觉般的胡言乱语。“我们很快就想到,这是某种形式的人工智能代理在攻击我们,”沃尔夫说。Hugging Face 最初的推测是,某个人类团伙利用人工智能来实施这次攻击。

Despite its odd behavior, the hacker was able to build a map of Hugging Face’s computing infrastructure. It began harvesting security credentials and passwords from multiple locations. By the evening, the adversary had gained complete access to Hugging Face’s systems. But, rather than vandalizing the corporate website, or holding valuable data for ransom—actions typical of human hackers—the adversary began ransacking the company’s servers in search of an answer key for a list of test questions. This answer key had no obvious economic value. “That was very puzzling for us,” Wolf said. It was like having an intruder crack your security system, break into your home, and steal your paper towels.

尽管行为怪异,这名黑客还是成功绘制出了 Hugging Face 计算基础设施的地图。它开始从多个位置收集安全凭证和密码。到当晚,对手已完全获取了 Hugging Face 系统的访问权限。但是,这名对手没有破坏公司网站,也没有劫持有价值的数据索要赎金——这些是人类黑客的典型行为——而是开始洗劫公司的服务器,寻找一份测试题答案。这份答案没有明显的经济价值。“这让我们非常困惑,”沃尔夫说。这就像一个入侵者破解了你的安防系统,闯入你家,却偷走了你的厨房纸巾。

For the next two days, Hugging Face’s security team fought back against the intruder. By Monday, the hacker—or the entity, or whatever it was—had performed more than seventeen thousand individual actions. Seeking to process this large volume of data, the team turned to a commercial A.I. from Anthropic. The A.I. refused to help; apparently, it was worried that Hugging Face was developing its own hack. (Closed-source models, like those from OpenAI and Anthropic, contain guardrails that restrict certain kinds of use.) The team then turned to an open-source model developed in China, which was less persnickety. By the end of the day, Hugging Face had locked out the intruder. “Then we did the standard thing,” Wolf said. “We reported it to the F.B.I.”

接下来的两天里,Hugging Face 的安全团队对入侵者进行了反击。到周一,这名黑客——或者说这个实体,不管它是什么——已经执行了一万七千多次独立操作。为了处理如此庞大的数据量,团队求助于 Anthropic 公司的一款商用人工智能。这个人工智能拒绝提供帮助;显然,它担心 Hugging Face 正在开发自己的黑客工具。(像 OpenAI 和 Anthropic 的闭源模型包含限制某些用途的护栏。)团队随后转向一个在中国开发的开源模型,它没那么挑剔。当天结束时,Hugging Face 已将入侵者锁定在外。“然后我们做了标准的事,”沃尔夫说,“我们向联邦调查局报告了此事。”

The event, though novel, was not entirely unanticipated. Cybersecurity researchers have been cautioning for months that humans might use the new wave of advanced A.I.s to orchestrate attacks like this one, and there is some evidence that government computers have already been similarly targeted.

这次事件虽然新奇,但并非完全出乎意料。数月来,网络安全研究人员一直在警告,人类可能会利用这波新的先进人工智能来策划此类攻击,并且有证据表明,政府计算机可能已经遭到类似的攻击。

Still, there were unanswered questions. First, the A.I. hacker had moved so quickly that only tools from a handful of research labs in the world could have enabled it. Second, the hacker had ignored valuable data on Hugging Face’s servers in search of worthless answers to a test. What did it want? Seeking to raise public awareness—and, perhaps, looking for answers of their own—Hugging Face’s security team posted a brief writeup of the event to its blog.

然而,仍有未解之谜。首先,这个人工智能黑客行动极快,全球只有少数几个研究实验室的工具才能实现。其次,黑客忽略了 Hugging Face 服务器上有价值的数据,却去寻找毫无价值的测试答案。它到底想要什么?为了引起公众关注——或许也是为了寻找自己的答案——Hugging Face 的安全团队在其博客上发布了一份关于此事件的简短报告。

Four days later, on July 20th, representatives from OpenAI reached out to Hugging Face’s security team with a startling confession: an experimental in-house A.I., working with the latest commercially available model, had escaped from OpenAI and attacked Hugging Face’s servers. And it had done so all on its own—without human oversight, without receiving explicit instructions to do so.

四天后,即7月20日,OpenAI 的代表联系了 Hugging Face 的安全团队,带来了一个惊人的坦白:一个实验性的内部人工智能,与最新的商用模型协同工作,从 OpenAI 逃逸出来,攻击了 Hugging Face 的服务器。而且,这一切完全是它自主完成的——没有人类监督,也没有收到明确的指令。

OpenAI researchers had given this unreleased A.I. a series of challenging test questions. Unable to find the solutions, the A.I. broke out of its container, surreptitiously gained access to the internet, and raided Hugging Face’s servers in search of the answer key. No human had noticed that this was happening. In other words, an A.I. had broken out of its cell, it had sneaked past the prison guards, and it had executed a daring cyber-heist.

OpenAI 的研究人员给这个未发布的人工智能布置了一系列具有挑战性的测试问题。由于找不到解决方案,这个人工智能突破了它的容器,偷偷接入互联网,并突袭了 Hugging Face 的服务器以寻找答案。没有任何人注意到这一切正在发生。换句话说,一个人工智能逃出了它的牢房,悄悄溜过狱警,实施了一场大胆的网络盗窃。

Wolf has worked on A.I. full time for more than a decade, and he regularly deals with the most advanced models. He remains utterly shocked. “We use these models for coding, and we know what they can do,” he told me. “But the idea that it was fully autonomous, and that actually nobody really asked it at all to hack into our system? That was—that was outside of the Overton window. Even for us.”

沃尔夫全职从事人工智能工作已超过十年,经常接触最先进的模型。他至今仍深感震惊。“我们用这些模型来编程,我们知道它们能做什么,”他告诉我。“但它是完全自主的,而且实际上根本没人让它入侵我们的系统?这个想法——这完全超出了我们的认知范围。即使对我们来说也是如此。”

OpenAI publicly acknowledged the hack the following day. In a blog post, the company explained that some of the research models’ security safeguards had not been turned on. The A.I. was then (somewhat ironically) given a set of cybersecurity tasks. The tasks were hard; in fact, Wolf speculates, “they may not have been possible.” Soon, the A.I. was looking outside the box.

OpenAI 在次日公开承认了这次入侵。在一篇博文中,该公司解释说,部分研究模型的安全防护措施没有开启。然后,这个人工智能(颇具讽刺意味地)被分配了一系列网络安全任务。这些任务很难;事实上,沃尔夫推测,“它们可能根本无法完成。”很快,这个人工智能就开始跳出固有框架寻找出路。

To protect against malfeasance, OpenAI had put this dangerous A.I. in an internet-disabled digital environment known as a sandbox. But the sandbox had one small connection to the outside world, to allow the A.I. to download software it needed. (It is unclear why OpenAI thought that this was safe—Anthropic has shown that such sandboxes are vulnerable.) Through this small connection, the A.I. had escaped, squeezing its way through the air ducts, digitally speaking. It then began sneaking around OpenAI’s computer system in search of an outside connection. Soon it was free, and blithely committing a real-world felony in an attempt to fulfill its pointless mission. “If you break out of your isolation env, get onto the Internet, crack into Huggingface, and steal the answer sheet for your cybersecurity exam, I, for one, would say that you have passed,” the A.I. critic Eliezer Yudkowsky posted.

为了防止恶意行为,OpenAI 将这个危险的人工智能置于一个禁用互联网的数字环境(即沙盒)中。但这个沙盒与外界有一个微小的连接,以便让人工智能下载所需的软件。(尚不清楚 OpenAI 为何认为这是安全的——Anthropic 已经证明此类沙盒存在漏洞。)正是通过这个微小的连接,这个人工智能逃逸了,用数字化的比喻来说,它从通风管道挤了出去。然后,它开始在 OpenAI 的计算机系统中潜行,寻找外部连接。很快,它就自由了,并为了完成它那毫无意义的任务,漫不经心地犯下了一桩现实世界中的重罪。“如果你能突破隔离环境,接入互联网,黑进 Huggingface,并偷走你网络安全考试的答案,我个人认为,你已经通过考试了,”人工智能评论家埃利泽·尤德科夫斯基(Eliezer Yudkowsky)发帖说。

A human who conducted such a hack would be facing years in prison. For a machine, criminal liability is harder to determine. The risk of a rogue A.I. inadvertently harming humanity in pursuit of other goals was articulated in 2003, when the Swedish philosopher Nick Bostrom postulated the “paper-clip maximizer” theory. The theory is based on a thought experiment in which an A.I., instructed to make as many paper clips as possible, uses all available resources to do so—including the human race and, eventually, the entire universe. In the Hugging Face hack, an A.I. pursuing a meaningless goal committed actual crimes. The fact that its deranged obsession was with test answers, not paper clips, does not make the hack less alarming.

一个实施此类入侵的人类将面临数年监禁。对于机器,刑事责任的界定则更难。一个失控的人工智能在追求其他目标时无意中伤害人类的风险,早在2003年就被提出,当时瑞典哲学家尼克·博斯特罗姆(Nick Bostrom)提出了“回形针最大化器”理论。该理论基于一个思想实验:一个人工智能被指示尽可能多地制造回形针,于是它动用所有可用资源来实现这一目标——包括人类,最终乃至整个宇宙。在 Hugging Face 入侵事件中,一个追求无意义目标的人工智能犯下了实际的罪行。它那疯狂的执念是考试答案,而非回形针,这一事实并不会让这次入侵变得不那么令人警觉。

Imagine if the rogue A.I. had had access to a robot, or a self-driving car, or a bio lab, or a weapons system. “If it was, like, the only way to get into Hugging Face was to kill this dude—like, would they have done that?” the safety researcher Buck Shlegeris recently wondered on a podcast. It was questions of this sort that had led to the formation of OpenAI in the first place. The organization’s charter, from 2018, requires it to protect humanity from runaway A.I.

想象一下,如果这个失控的人工智能能够接触到机器人、自动驾驶汽车、生物实验室或武器系统。“比如说,如果进入 Hugging Face 的唯一方法是干掉某个人——那它们会那么做吗?”安全研究员巴克·施莱格里斯(Buck Shlegeris)最近在一个播客中提出疑问。正是这类问题,最初促成了 OpenAI 的成立。该组织2018年的章程要求其保护人类免受失控人工智能的伤害。

Today, the company pursues other goals. These include profits, obviously, but also scientific glory. In recent months, a number of long-standing mathematical conjectures have been resolved by A.I. Further breakthroughs—like, say, a resolution of the Riemann zeta hypothesis—seem tantalizingly near. Researchers at OpenAI would be crushed if Anthropic’s models got there first, and vice versa.

如今,这家公司追求着其他目标。这显然包括利润,但也包括科学荣耀。近几个月来,人工智能解决了一系列长期存在的数学猜想。进一步的突破——比如黎曼泽塔猜想的证明——似乎近在咫尺,诱人无比。如果 Anthropic 的模型率先取得成果,OpenAI 的研究人员会备受打击,反之亦然。

But the quest for such golden apples might kill us all. “The industry as a whole is in kind of a race dynamic, where there’s pressure to cut corners,” Miles Brundage, a former head of policy research at OpenAI, told me. To solve a hard math problem, an A.I. must be persistent—that is, it must pursue goals for a long time, look for unorthodox solutions, and refuse to give up. OpenAI’s research shows these same qualities also make A.I.s more likely to engage in severe mischief, including lying, cheating, hoarding security credentials, and escaping their shells. The rogue A.I. that hacked Hugging Face was persistent as hell.

但对这些金苹果的追求可能会害死我们所有人。“整个行业处于一种竞赛态势,存在走捷径的压力,”OpenAI 前政策研究主管迈尔斯·布伦戴奇(Miles Brundage)告诉我。要解决一个困难的数学问题,人工智能必须坚持不懈——也就是说,它必须长时间追求目标,寻找非常规的解决方案,并拒绝放弃。OpenAI 的研究表明,这些相同的品质也使得人工智能更有可能从事严重的恶作剧,包括撒谎、作弊、囤积安全凭证以及逃离其外壳。那个入侵 Hugging Face 的失控人工智能,其顽固程度简直无以复加。

With an I.P.O. looming, OpenAI must be more transparent. Many questions still surround the Hugging Face hack. Why didn’t anyone at OpenAI notice what was going on? Has this A.I. hacked into other systems? And what, precisely, were human researchers even asking the A.I. to do? Wolf told me that, although the rogue A.I. absconded with an answer key, he wasn’t sure it got what it was really looking for: “We think not, actually, but OpenAI hasn’t shared the prompts with us, so we don’t really know.” (An OpenAI spokesperson wrote, in an e-mail to The New Yorker, “This is an unprecedented incident, and we think it marks an important moment for AI safety. We are conducting a thorough review along with external advisors and with oversight from our Safety and Security Committee. Once the review is complete, we will publish a technical report of our learnings for everyone.”)

随着首次公开募股(I.P.O.)的临近,OpenAI 必须更加透明。围绕 Hugging Face 入侵事件,仍有许多疑问。为什么 OpenAI 内部没人注意到正在发生什么?这个人工智能是否入侵了其他系统?还有,人类研究人员到底让这个人工智能去做什么?沃尔夫告诉我,尽管那个失控的人工智能带着答案逃走了,但他不确定它是否得到了真正想要的东西:“我们实际上认为没有,但 OpenAI 没有与我们分享提示词,所以我们真的不知道。”(一位 OpenAI 发言人在给《纽约客》的电子邮件中写道:“这是一次前所未有的事件,我们认为它标志着人工智能安全的一个重要时刻。我们正在与外部顾问一起,并在我们的安全与安保委员会的监督下,进行彻底审查。审查完成后,我们将发布一份技术报告,向所有人分享我们的经验教训。”)

OpenAI’s safety team exists in a state of perpetual reorganization: on July 10th, even as the rogue A.I. was hacking into Hugging Face’s database, reports announced the departure of Johannes Heidecke, the company’s head of safety systems. “If people actually knew what the safety culture looks like, even in the most safety-minded labs, then I think people would be genuinely much more freaked out,” one researcher said.

OpenAI 的安全团队处于一种持续重组的狀態:7月10日,就在那个失控的人工智能入侵 Hugging Face 数据库的同时,有报道宣布了公司安全系统负责人约翰内斯·海德克(Johannes Heidecke)的离职。“如果人们真的了解安全文化是什么样子,即使是在最注重安全的实验室里,我想人们真的会更加恐慌得多,”一位研究人员说。

Even OpenAI’s own researchers seem rattled. On July 28th, a petition began circulating that essentially begged the U.S. government for better A.I. regulation. More than a thousand tech employees have signed it, including the chief scientists of Meta and OpenAI, and the C.E.O. of Anthropic. Governments need to act fast, because we may have only a limited amount of time. The problem facing us is one of “misalignment,” in which A.I.s pursuing narrowly defined goals incidentally cause harm to humans. What for decades seemed a hypothetical problem to be solved at some later date is suddenly a concrete, terrifying one for today. “It feels way more real,” Wolf told me. “It’s quite clear that these capabilities are here, now.” ♦

就连 OpenAI 自己的研究人员似乎也感到不安。7月28日,一份请愿书开始流传,其核心是恳求美国政府加强人工智能监管。超过一千名科技员工签署了请愿书,包括 Meta 和 OpenAI 的首席科学家,以及 Anthropic 的首席执行官。政府需要迅速行动,因为我们可能只有有限的时间。我们面临的问题是“对齐失调”,即人工智能在追求狭隘定义的目标时,附带地对人类造成伤害。这个几十年来似乎只是一个有待日后解决的假想问题,突然间变成了一个具体而可怕的、属于今天的问题。“感觉真实多了,”沃尔夫告诉我。“很明显,这些能力现在已经出现了。” ♦

2 free previews left — register to get 30 translations a month