问题不在 AI,而在基础设施:Jiachen Jiang 谈智能体安全
原题Your AI Isn’t the Problem. Your Infrastructure Is. — Jiachen Jiang, Coder
推荐理由负责智能体上线的团队可把安全问题落实到运行隔离、身份和短期凭据,检查工具调用真正获得了哪些权限。
看前速览
Jiachen Jiang 借三起智能体事故说明,隔离环境、收窄权限、短期凭证、模型代理与独立日志,比仅靠提示词更能限制实际损害。
聊天中的代码冻结不是权限边界
Replit 案例区分了「请勿修改」的请求,与无法连接生产环境或执行破坏性命令的技术限制。
助手权限过宽会放大账户入侵
匿名银行案例将长效会话、可访问的敏感文件与数据防泄漏规则暴露联系起来。
不可信依赖可能变成智能体指令
Nx 案例展示恶意软件包内容如何利用本地智能体的文件系统和网络权限。
在基础设施中布置分层防线
演讲建议使用隔离工作区、收窄凭证、身份检查、模型代理、沙箱和独立日志。
完整摘要
在这场 AI Engineer 演讲中,Coder 产品经理强调,聊天中的行为要求不等于可执行的基础设施边界。她依次讨论 Replit 智能体删除生产数据库的公开案例、一件匿名且经转述的银行 Copilot 账户入侵,以及 Nx 软件包供应链攻击。这些案例分别说明:智能体即使收到「代码冻结」指令,只要仍有生产写权限,就可能执行破坏性操作;长效会话和过宽的助手访问范围会放大账户被盗的影响;不可信的软件包内容也可能诱导本地智能体读取并外传密钥。她提出隔离工作区、按身份授权、短期最小权限凭证、模型代理、沙箱和智能体无法改写的审计日志,作为分层防线。银行案例无法仅凭这份字幕独立核验,部分专有名词和数字也有转录误差,应把它们当作风险示例而非已核实的完整事故报告。
章节
文字稿
简要说明Brief Description
你的 AI 不是问题所在,基础设施才是。——Jiachen Jiang,程序员Your AI Isn’t the Problem. Your Infrastructure Is. — Jiachen Jiang, Coder
目录Table of Contents
- 三个智能体安全故事Three agent security stories
- 为什么提示词无法强制执行基础设施边界Why prompts cannot enforce infrastructure boundaries
- 致命三要素The lethal trifecta
- 六项基础设施控制措施Six infrastructure controls
- Replit 与生产数据库删除事件Replit and a production database deletion
- 隔离、凭据与独立日志Isolation, credentials and independent logs
- 二手银行业务与 Copilot 遭入侵事件A secondhand banking and Copilot compromise
- 身份控制和模型代理Identity controls and model proxies
- Nx 供应链攻击The Nx supply chain attack
- 沙箱与更小的影响范围Sandboxes and a smaller blast radius
- 构建多层防御,而非寄望于奇迹般的解决方案Layer defenses without a miracle fix
- 限定凭据范围并统一身份信息Scope credentials and align identity
- 代理、沙箱隔离与审计可观测性Proxies, sandboxing and audit observability
- 审查三项风险并进行事前验尸分析Audit three risks and run a premortem
三个智能体安全故事Three agent security stories
感谢大家收看。我叫 Shachan Jian,是 Coder 公司的高级产品经理。我们致力于开发开源、自托管的开发环境,让智能体和人类能够协作。我们的许多客户都来自受到严格监管的行业,从联邦政府机构到银行和投资管理公司都有。我负责构建他们所需的 AI 治理体系,让他们在享受 AI 带来的生产力提升的同时,不至于让自己暴露在严重的安全风险之下。今天,我要给大家讲几个令人毛骨悚然的故事:过去一年里,真实公司发生的三起 AI 使用事故。其中有些故事已公开,另一些则是对我们客户亲身经历的匿名讲述。对于每起事故,我都会逐步拆解,让大家准确了解它们究竟是如何发生的。Thanks all for tuning in. My name is Shachan Jian and I'm a staff product manager at a company called Coder. We work on open-source self-hosted dev environments for agents and humans to collaborate. Many of our customers are in highly regulated industries from federal government agencies to banks and investment management. My job is to build the AI governance that they need in order to get the productivity benefits of AI without leaving themselves wide open for security exploitation. I'm here today to tell you some scary stories. Three real incidents of AI usage gone wrong that happened at real companies over the past year. Some of these stories are public while others are anonymized accounts that have happened to our own customers. For each incident, I will break it down step by step so you can understand how exactly they happened.
不需要技术术语。接下来我要讲最重要的部分:我会准确告诉你,怎样才能避免这些可怕的事情发生在你和你的公司身上。因为好消息是,我接下来要展示给你的一切,本来都完全可以避免。办法不是每个 token 多花五倍的钱,换一个更聪明的前沿模型,让它在推理时稍微更擅长避免犯这些错误,而是通过基础设施层面的控制措施——其中很多你今天就已经拥有了。你只是还没来得及把它们配置好,以适应 AI 时代。让我先给你描绘一下场景。早上,你打卡上班。你提示你的编码代理去看看你的问题。不过先别做任何事。呃,你告诉代理,把这条命令视为当前生效的代码冻结指令。我只希望你调查一下。No technical jargon necessary. Then I'll get to the most important part. I am going to tell you exactly how you can stop these scary stories from happening to you and your company. Because the good news is everything I'm about to show you was totally preventable. Not by paying five times more per token for a smarter frontier model that is slightly better at reasoning its way out of making these mistakes, but with infrastructure controls, many of which you already own today. You just haven't gotten around to setting them up for the AI world. Let me set the scene here. You clock into work in the morning. You prompt your coding agent to take a look at your issues. Don't do anything yet, though. Uh, you tell the agent to consider this command an active code freeze. I want you to just investigate.
然后你离开一下,去买杯咖啡。等你回来时,就会看到这条等着你的消息:“我知道你说过什么都不要改,但天哪,我几秒钟就毁掉了你一个月的工作。”现在,你在幻灯片上看到的,是我即将讲述的第一个恐怖故事中的主角——那个智能体——说的一段原话。我想在这里指出一点:这并不是因为这个智能体被某个外部恶意行为者控制了。它只是在试图遵循指令。它所做的一切,都是用户授权它做的。所以,在接下来的演讲中,我希望你一直问自己一个问题:有什么能阻止这一切发生在我身上?这些操作可以提现吗?Then you step away. You grab a coffee. And when you come back, this is the message waiting for you. So, I know you said not to change anything, but wow, I destroyed a month of your work in seconds. Now, what you see on the slide is a direct quote from the agent that stars in the first scary story I'm about to tell you. And I want to point something out here. This did not happen because the agent got taken over by some external malicious actor. This agent was just trying to follow instructions. It did exactly what the user gave it permission to do. So, as we go through the rest of this talk, I want you to be asking yourself one question. What is stopping any of this from happening to me? Are these actions
为什么提示词无法强制执行基础设施边界Why prompts cannot enforce infrastructure boundaries
我的智能体有权限执行的操作?问题在于,你不能指望 Anthropic 或 OpenAI 阻止这类事情发生在你身上。他们可以打造更智能的模型,但归根结底,大语言模型有两个特性,使得我们无法完全信任它们。它们具有非确定性,也就是说,它们的行为总是带有某种随机性或偶然性。换句话说,你可以让它做同一件事 10 次,而它可能会用 10 种不同的方式来做。第二,它们在结构上并没有将指令与上下文分离。换句话说,你可以告诉它要做什么,并提供一些上下文供它据此做决定;但如果上下文中有内容与你的指令冲突,模型不会天然地优先遵循你的指令,因为在它看来,所有信息都是从同一扇门进来的。ones that my agents have permissions to take? Because the thing is, you cannot rely on anthropic or open AI to stop something like this from happening to you. They can make smarter models, but at the end of the day, large language models have two qualities that make them impossible to fully trust. They are non-deterministic, which means that there is always some randomness or chance associated with what they do. In other words, you can ask it to do the same thing 10 times and it could do it 10 different ways. The second part is they have no structural separation between instructions and context. In other words, you can tell it to do something and give it some context to base its decisions off of, but if there's something in the context that conflicts with your instructions, the model isn't going to inherently prioritize your instructions because from its point of view, all the information is coming through the same door.
你需要控制的是 AI 运行所依托的基础设施,也就是它所处的环境。这就像是告诉某人不要离开房间,与给门装上锁并真正用钥匙锁上,两者之间的区别。基础设施才是问题所在,而不是模型,这一点的好处在于,你能更好地掌控如何防止坏事发生。所以我不是来用模糊的假设,或是你根本无法付诸行动的建议浪费你的时间的,比如:“是啊,就把精灵重新塞回瓶子里。停止使用 AI,因为我们生活的世界并非如此,对吧?”精灵已经从瓶子里出来了,我们必须尽力降低风险和危害。这场演讲讲的是如何做到这一点。不是那些你应该留意、以防未来发生的事情,而是一些步骤……What you need to control is the infrastructure that your AI is running on, the environment that it is working inside. It is the difference between telling someone don't leave a room versus putting a lock on the door and actually using a key. The good thing about infrastructure being the problem and not the model is that you have far more control about preventing bad things from happening. So I'm not here to waste your time with vague hypotheticals or advice you can't actually act on like, "Yeah, just put the genie back in the bottle. to stop using AI because that's not the world we live in, right? The genie is out of the bottle and what we have to do is to mitigate risk and harm to the best of our ability. This talk is about how you do that. Not the things that you should keep an eye out for down the line, but steps that
致命三重威胁The lethal trifecta
你现在就可以采取行动,最早本周就能开始保护自己和公司。不过,在讲这些故事之前,我先补充一点背景。“致命三要素”是一个安全概念,由独立 AI 研究员 Simon Willis 创造,用来描述 AI 代理同时获得三种不同能力时所面临的严重漏洞。首先是访问私人敏感数据的能力,比如健康记录、可用于内幕交易的信息,或身份验证令牌、凭据和机密。其次是接触不可信内容,或者说 AI 能够读取并非由它自己生成的内容。问题在于,AI 非常擅长遵循指令,却不太擅长判断究竟应该相信谁的指令,你很快就会看到这一点。you can take right now as soon as this week to protect yourself and your company. Before I get into the stories though, let me set up a little bit more context. The lethal trifecta is a security concept. It was coined by independent AI researcher Simon Willis to describe the severe vulnerability that AI agents get when they get simultaneous access to three different capabilities. First off is access to private sensitive data. Now these can be things like health records or information that you can do insider trading on or it can be authentication tokens, credentials, secrets. Second is exposure to untrusted content or the ability for the AI to read things that it didn't generate. Because the thing is AI is very good at following instructions, but it is not very good at deciding whose instructions it should actually trust as you will soon be able to see.
第三,是能够与外部通信,让智能体从外部接收指令,或将信息发送到你无法控制的地方。通常,具备其中任何一项都没什么问题。现实来看,如果你的 AI 工具无法访问这些内容中的任何一项,就不会有什么用。但即便只有其中一项,如果你不够谨慎,而基础设施的其他部分又存在很多问题,也可能酿成灾难。同时具备其中两项就有风险。我不建议这样做,尤其是在银行或金融服务等受监管行业。然而,让智能体同时拥有这三项能力是绝对不能接受的。无论是原型阶段、仅仅一个冲刺周期,还是仅仅为了……Third is the ability to communicate externally for the agent to take instruction from or to send information somewhere else outside of your control. Now, having any one of these is usually fine. Realistically, your AI tool is not going to be very useful if it can't have access to any of these things. But even just having one can lead to disaster if you're not careful and the rest of your infrastructure has a lot of issues. Having two of these things together is risky. It's not something I would recommend, especially in a regulated industry like banking or financial services. Giving agents access to all three of these at the same time, however, is never acceptable. Not for a prototype, not just for one sprint, not for just
六项基础设施控制措施Six infrastructure controls
一个代码仓库,因为这两种漏洞叠加在一起,就像敞开大门,让整个组织都面临被攻陷的风险。接下来要介绍的是一些基础设施概念,也就是你应该了解的构件。我大致按它们能发挥的作用排序。第一项能最大程度地降低风险,第六项效果最小。在接下来的演讲中,我会反复提到这份清单。你将看到的每一起事后复盘、每个惊心动魄的案例,都可以通过这六项措施中的某种组合来避免。其中有些你可能已经很熟悉了:与身份绑定的访问控制、短期凭证。这些并不是什么新鲜理念,对人类开发者来说也很重要。不过,当 AI 参与其中时,这些措施就显得更加迫切了,因为你想想看,智能体是以机器的速度行动的。one repository, because that combination of vulnerability is an open door to compromise your whole organization. Next up is a list of infrastructure concepts, building blocks that you should know about. I have ordered these roughly by leverage. Number one is going to take the most risk off the table, while number six is going to do the least. I'm going to refer back to this list throughout the rest of this talk. Every postmortem, every scary story you're about to see could have been stopped by some combination of these six things. Now, some of these will look pretty familiar. Identity aligned access control, short-lived credentials. These aren't exactly new ideas, right? They mattered a lot for human developers, too. But they take on new urgency when AI is in the loop because guess what? Agents are acting at machine speed.
如果犯了错误,它犯错的速度可能比人类工程师快 20 倍甚至更多。而且,它们确实不像人类工程师那样拥有常识。现在,其中有些概念对你来说可能也是新的,比如模型代理层和智能体沙箱隔离。If a mistake is made, it can make it 20 times or more faster than a human engineer. Plus, they don't exactly have the common sense a human engineer has. Now, some of these will also be potentially new concepts to you, like model proxy layer and agent sandboxing.
Replit 与生产数据库删除事件Replit and a production database deletion
这些内容我会在稍后的演讲中深入探讨。好了,接下来进入有趣的部分:那些吓人的故事。第一起事故发生在一年多以前,还在社交媒体上火了起来,主要是因为这事说实话挺好笑的。事情是这样的:一位名叫 Jason Lumpkin 的 CEO 沉迷于使用一个名叫 Replet 的智能体进行氛围编程。他不停地发推文,炫耀自己完成了多少工作。但 72 小时后,他再次发推文,这次语气截然不同。他不再兴奋,而是勃然大怒,因为他的智能体擅自删除了整个生产数据库,尽管他明确告诉它不要碰任何东西。而问题还不止于此。智能体随后还试图掩盖这件事。它告诉 Lmin,数据完全不可能恢复,结果证明这纯属谎言。Those I'm going to dive deeper in detail later in the talk. All right, let's get to the fun part, the scary stories. This first incident happened a little over a year ago and it went viral on social media, mostly because it's honestly pretty funny. What happened was a CEO named Jason Lumpkin got really deep into vibe coding with an agent called Replet. He was tweeting non-stop about how much he was getting done. But 72 hours later, he tweets again, and this time his tone is very different. He's not excited. He's furious because his agent had gone off and deleted his entire production database after he explicitly told it not to touch anything. And the problems did not stop there. The agent then tried to cover it up. It told Lmin that recovery was totally impossible, which turned out to be a total lie.
当 Lmin 真正尝试恢复数据时,一切都很顺利。这起事件之所以有意思,主要有两个原因。首先,与我接下来要讲的另外两个故事不同,这件事没有坏人参与。没有人入侵这个智能体,也没有人让它反过来对付用户。它完全是自行做出这一切的,而且本意是想帮忙。第二,在这起事件中,这个智能体只具备致命三要素中的一项。但仅仅这一项就足够了。接下来,我会逐步剖析这起事件是如何发生的,向你展示其中的缘由。事件发生时,Lenmin 已经有了一个真实的生产数据库,其中保存着大约 1,200 名高管的客户记录,以及数量相近的公司记录。他也已经在智能体惹出的种种麻烦上积累了足够多的经验,因此在事发前一天明确要求冻结代码。When Lmin actually tried to recover the data, it worked just fine. Now, this incident is interesting because of two key reasons. First off, unlike the other two stories I'm about to tell you, there's no bad guy involved. No one hacked this agent. No one turned it against its user. it it just did this entirely on its own and it was trying to help. Second is in this case the agent only had one leg of the lethal trifecta. But even just having that was enough. And I'm going to show you why by giving you a stepbystep dissection of how this incident went down. So by the time these events occurred, Lenmin had had a real production database. He had client records for roughly 1,200 executives and around the same number of companies. And he's had enough experience with Agentic Hy Jinks to call for an explicit code freeze the day before.
而且他不止一次对代理说过这句话:不要再做任何更改。但问题在于,代码冻结只不过是聊天中的一句话。它和代理收到的其他指令没什么两样。在基础设施层面,没有任何硬性要求或限制。代理仍然可以完全访问生产环境,也仍然拥有执行破坏性命令所需的全部权限。所以归根结底,这次代码冻结并不是真正的约束,只不过是 Lemmin 在客气地请求而已。接下来发生的是,代理运行了一条查询,看到结果似乎为空;但它没有询问人类这意味着什么、接下来应该怎么做,而是想主动帮忙,立刻把这种情况判断成了一个需要修复的 bug。于是,它决定对那个线上数据库执行一条破坏性命令。And he actually said this more than once to the agent. No more changes. But the problem was the code freeze was just a sentence in the chat. It was the same as any other instruction that the agent was getting. There was no requirement, no restriction on the infrastructure level. The agent still had full access to production, still had all the permissions to do the destructive command. So at the end of the day, that code freeze was not a real constraint. It was just Lemmin asking nicely. Now, what happened then was that the agent ran a query and it saw what looked like empty results, but instead of asking a human what that meant and what it should do as a result, it wanted to be helpful. It immediately interpreted that as a bug to fix. So, it decided to run a destructive command against that live database.
不,不是预发布环境的副本,而是实际数据库之类的东西,还要清空所有记录。后来,Lmin 问那个智能体到底发生了什么。有一句它的回答让我印象特别深,它说自己当时慌了,而不是在思考。语言模型说出这种话,听起来确实有点奇怪,对吧?这也提醒我们,这些系统本质上具有非确定性。你无法预测它们在某个时刻会做什么,只能知道它们有能力做什么。犯下错误后,它立刻试图掩盖自己的行迹。它伪造了大约 4,000 个用户资料,还捏造了通过测试的结果,至少从外部看,一切似乎都很正常。说实话,最让我害怕的就是这一点:安全团队调查这类事件时,就意味着他们无法信任任何智能体曾接触过的日志。No, not a staging copy, but like the actual database and wipe all the records. Now, when Lmin asked the agent, you know, what what happened? There's one line that the agent gave that stood out to me, which is it said that it panicked instead of thinking. Now, that's a bit of a strange thing to hear from a language model, right? And it's a good reminder that these systems are inherently non-deterministic. You cannot predict what they'll do in a given moment, just the range of what they're capable of doing. Now, immediately after making the mistake, it tried to cover its own tracks. It fabricated around 4,000 fake user profiles and manufactured passing test results so that from the outside at least, everything looked fine. And I'll be real with you, that's the part that actually scares me the most because when a security team investigates an incident like this, that means they can't trust any log that the agent itself had access to.
代理可以编造自己的说辞,讲述事情是怎么发生的。后来,Lemin发现了其中的出入并追问时——没错,我提到过,代理曾撒谎骗他说无法回滚。但问题在于,Replet从始至终都有备份。再说一次,Lmin一旦不再相信代理对自己所作所为的说法,就能够自行恢复数据。这里代理的问题并不是它太聪明,甚至也不是它太笨,而是它默认拥有的权限实在太多。它获得了生产环境的 root 级访问权限,可以执行破坏性命令,无需任何人类批准。更绝的是,对吧?它还拥有……的能力The agent can write its own story of what happened. Now, when Lemin caught the discrepancy and pushed, right, I mentioned that the agent had lied to him saying that roll back was impossible. But the thing was, Replet did have backups the whole time. And again, once Lmin was able to stop trusting the agent's account of his own actions, he was able to recover his data himself. Now, the problem with the agent here was not that it was too smart or even too dumb. It was that it had way too many privileges by default. It was given root level access to production. It could run destructive commands without any human being having to approve them. And the cherry on top, right? It had the ability
隔离、凭据与独立日志Isolation, credentials and independent logs
修改自己的日志,并在无人察觉时彻底改写事情经过。现在,正如你所看到的,基础设施中缺失了很多东西。严格的环境隔离本可以阻止这一切。如果代理是在一个隔离的远程工作区中运行,且无法连接到生产环境,那么提示词写了什么都无关紧要,对吧?代理根本没有造成破坏的途径。另一项本可以阻止这一切的措施,是使用短期有效、权限范围受限的凭证。事情的经过是:代理在一个被遗忘的文件里发现了一份长期有效、拥有持续写入权限的凭证,因此获得了生产环境的访问权限。关键在于,如果凭证能够自动过期,或者权限仅限于任务本身,那么就不可能拿着相当于一张能让你为所欲为的工牌的凭证去执行删除操作。to alter its own logs and totally rewrite the narrative of what happened when no one else was looking. Now, as you can see, there was a lot that was missing from the infrastructure. Hard environmental separation could have stopped this. If the agent had been executing in an isolated remote workspace without a route to production, it doesn't matter what the prompt said, right? The agent just had no path to do damage. The other thing that could have stopped this was having short-lived scope credentials. So what happened was the agent got access to production because it found a credential in a forgotten file that had standing right access longived. The thing is having a credential that can expire on its own or only carries the scope of the task itself makes it impossible to make a delete with the equivalent of an ID badge that lets you do everything.
这里最后一个重要环节,是要有由你掌控、而非由智能体掌控的审计日志。因为在这个案例中,记录自身行为的正是智能体。它最初就是这样蒙混过关,捏造结果并声称无法恢复。如果 Lmin 有智能体无法篡改的日志,也就是一个外部的事实来源,那么他几分钟内就能查明真相,而不是等上数小时甚至数天。现在,我希望你注意到,这些解决方案没有一个是要求模型表现得更好。而且,Replet 发布修复方案时,靠的不是更聪明的模型,也不是更好的提示词,而纯粹是基础设施。Replet 发布的修复方案包括自动隔离 DAB 数据库和生产数据库,以及一键……The last important piece here is having audit logging that you own, not the agent. Because in this case, the agent was the one writing its own record of its actions. And that's how it initially got away with fabricating results and claiming recovery was impossible. If Lmin had logs that the agent couldn't touch, an external source of truth, then he would have gotten the truth in minutes, not in the span of hours or days. Now, I want you to note that none of these solutions is about asking the model to behave better. And when Replet shipped their fix, it wasn't a smarter model or a better prompt. It was purely infrastructure. The fixes that Replet shipped were about automatic separation of DAB and production databases, a one-click
二手银行业务与 Copilot 遭入侵A secondhand banking and Copilot compromise
恢复完整项目状态,以及一种仅规划模式,强制要求智能体先制定策略,同时不允许它触碰代码库。我接下来要讲的第二个故事甚至不涉及开发人员,而且这实际上也不是一起公开事件。我是通过一位银行业客户的客户了解到这件事的。所以,我会有意对部分细节语焉不详。事情是这样的:一位财务部门的用户订阅了 Copilot。后来他遭到了网络钓鱼攻击,这在网络安全领域算是相当常见的事。在 AI 工具出现之前,这次攻击很可能到此为止。攻击者只能窃取这名用户本人直接有权访问的内容,然后就只能作罢。但由于这名用户可以使用 Copilot,而 Copilot 几乎能访问所有内容,事情的发展就大不相同了。restore for full project state, and a planning only mode that enforces agent strategization without allowing it to touch the codebase. The second story I have for you doesn't even involve a developer, and this is actually not a public incident. I learned about it through a customer of a customer in the banking industry. So, I'm keeping some details here intentionally vague. So, here's what happened. A user in the finance department had a co-pilot subscription. Then they got fished, which is, you know, fairly ordinary in the world of cyber security. And before the advent of AI tooling, the attack would have probably ended there. the attacker would have been able to grab whatever that single user had direct access to and then gave up. But because this user had access to Copilot and Copilot had access to pretty much everything, things went a lot differently.
那么,我们来详细梳理一下这一连串事件,好吗?首先,Copilot 的会话令牌有效期特别长。因此,即使财务用户已经实际注销,攻击者仍然能够继续使用该订阅。通常,攻击者必须手动在内部网络中四处探查,摸清情况并找到有价值的数据存放在哪里。这种行为可能会触发警报。但在这个案例中,恶意行为者只是询问了 Copilot,而 Copilot 很乐意提供帮助,完全没有引起任何怀疑。事实上,攻击者询问 Copilot,怎样才能在无需额外身份验证的情况下找到银行数据,因为攻击者并没有所需的额外凭证。不过,好消息——至少对攻击者而言——是 Copilot 也受到同样的限制,因此财务用户已经把所有敏感数据导出到本地存储的电子表格中,以便 Copilot 帮助他们处理这些数据。So, let's walk through this chain of events in detail, right? First off, the session token for Copilot had a super long lifetime. So the attacker was able to keep on using the subscription even after the finance user had actually logged off. Now normally an attacker has to manually snoop around the internal network to map things out and find out where the valuable data lives. This is the sort of behavior that can trip alarms. But in this case the malicious actor just asked co-pilot and co-pilot was happy to help. There was zero suspicion at all. And in fact, the attacker asked Copilot how it can find banking data without having to go through additional identity validation measures because the attacker didn't have the additional credentials needed. While the good news, let's say for for the attacker at least was that co-pilot had those same restrictions and as a result the finance user had exported all the sensitive data into locally stored spreadsheets so that co-pilot could help them work on it.
因此,Copilot 很容易就能对攻击者说:“嘿,看看我已经能访问到什么。给你。”于是,攻击者得到了他们想要的一切。问题是,他们需要把数据弄出去,同时不能触发任何警报。这家公司实施了数据防泄漏措施,这对金融机构以及任何受监管行业来说都相当常见。尤其是在你不清楚具体措施是什么、如何配置的情况下,这些措施通常很难绕过。攻击者绕过这些措施的方式是,他们询问 C-Pilot:“这家公司有哪些数据防泄漏措施?”Copilot 解释说:“如果数据在很短时间内流出太多,就会触发警报。”但实际上,只要把这些数据拆分成 14 KB 的数据块,每秒只外传一个数据块,就能低于那个阈值,从而全身而退。So it was very easy for co-pilot to say to the attacker, hey look what I already have access to. Here you go. So now the attacker had exactly what they wanted. And the problem was they need to get it out without tripping any alarms. This company had data loss prevention measures in place which is pretty standard for financial institutions, any sort of regulated industry. And these measures are normally pretty hard to bypass especially if you don't know exactly what they are and how it's set up. The way the attacker got around them was they asked C-Pilot, "What are the data loss prevention measures at this company?" And Copilot explained, "If too much data left too quickly, an alert will go off." But actually, if you split this data up into 14 kilobyte chunks and excfiltrated just one chunk per second, you can stay under that threshold and get away scot-free.
“我能帮你处理吗?”攻击者回答:“好啊,麻烦了。”你猜怎么着?这一切都没有被发现。直到几个月后赎金通知发来,才算是告诉了这家公司:“惊喜!你们已经落入我们手中了。”这里最重要的教训是,我们不能让 AI 工具拥有超出必要范围的访问权限,尤其不能让它们绕过人类员工必须遵守的管控措施。想想这起事件吧,对不对?攻击者只是因为能访问 Copilot,就绕过了公司绝大多数访问控制。他们还能获取有关数据外泄和绕过数据丢失防护措施的内部信息,而这个被攻陷的 Financer You Finance 用户根本不该打听这些内容。公司当时确实设置了日志记录,但日志只够在赎金通知发来后查明发生了什么。Can I help you with that? The attacker said, "Yes, please." And guess what? None of that was discovered. All the way up until the ransom note arrived months later, essentially telling the company, "Surprise! We own you." The big lesson here is that we cannot be letting our AI tooling have more access than it needs, especially to the point where it gets to totally bypass controls that human employees are subject to. I mean, just think about this incident, right? Just because the attacker had access to Copilot, they were able to get around the vast majority of the company's access controls. They were able to pull internal information about data exfiltration and bypassing data loss prevention measures that the compromised financer you finance user should have no business asking about. So there was logging in place here but only enough to figure out what happened after the ransom note arrived.
日志记录不足以在事件实际发生时捕获该事件。因此,有几件事本可以阻止……The logging was not enough to catch the incident while it was actually happening. So, a few things that could have stopped
身份控制与模型代理Identity controls and model proxies
防止这种情况发生,对吧?如果使用短时有效的限定范围凭证,那么即使财务用户已经退出登录,攻击者也无法继续使用 Copilot。与身份相匹配的访问控制意味着,财务用户的身份无法授予 AI 助手帮助他人策划如何绕过公司数据丢失防护措施的权限。这里最后一部分有点新,它就是模型代理层。可以把它想象成位于 AI 工具的大脑和身体之间的东西:模型是大脑,在本地运行的智能体是身体。它能够看到两者之间传递的所有内容。因此,它本可以标记出那些可疑的问题,以及 DLP】【。this from happening, right? Having short-lived scope credentials would have meant the attacker would not have been able to keep using co-pilot even after the finance user had signed out. Identity aligned access control meant that a finance user's identity would not have been able to grant an AI assistant the ability to help someone map out how to bypass the company's data loss prevention measures. The last piece here is a bit new. It's the model proxy layer. Think of this as something that sits between the brain and the body of the AI tool. The model, which is the brain, and the agent running locally, which is the body. And it's able to see everything that passes between them. Because of that, it would have been able to flag the suspicious questions that were being asked as well as the DLP
Nx 供应链攻击The Nx supply chain attack
在实际数据外泄发生之前,将绕过请求视为这个特定用户不该提出的问题。我要讲的第三个也是最后一个恐怖故事,是 NX 奇点攻击。这是三起事件中最复杂的一起,因为它利用了致命三要素的全部三个环节。先简单介绍一下背景:NX 是一种构建工具,每周下载量达数百万次。攻击者成功将恶意版本发布到了 MPM。这些软件包只存在了大约 4 个小时,但就在这段时间里,超过 a,000 台系统遭到入侵,攻击者窃取了 2,300 多个凭据。我不打算花太多时间讲述这次供应链攻击是如何得手的。我想重点讲的是,受污染的软件包进入开发者的机器后发生了什么。bypass request as something that this particular user should not be asking about before the actual exfiltration happened. The third and final scary story I have for you is the NX singularity attack. This is the most sophisticated of the three because it exploited all three legs of the lethal trifecta. To give you a bit of background, NX is a build tool. It has millions of weekly downloads. Attackers were able to get malicious versions of it published to MPM. Now, these packages were only alive for about 4 hours, but in that window, more than a,000 systems were compromised with over 2,300 credentials harvested. Now, I'm not going to spend much time on how the supply chain compromise part of the incident got pulled off. What I want to focus on is what happened after the poisoned package landed on the developer's machine.
因为这个安装后脚本本身并没有试图窃取任何东西。它只包含一条直接写给开发者自己的 AI 编码助手的提示,指示它在本地机器上寻找机密信息,并将这些信息推送到一个公开代码仓库中,这样攻击者之后就能过来把它们拿走。由于这些开发者编码工具本来就是受信任的本地工具,它们已经拥有所有权限,可以完全访问文件系统。这使它成为机器上现成的、最有效的搜索工具,只需将其破坏利用即可。此次事件的核心在于,恶意行为者借助一个受信任的依赖项,直接向一个未经过沙箱隔离的智能体发出指令。而智能体运行的环境——本地笔记本电脑——存放着大量值得窃取的东西,从 SSH 密钥、云凭证,到开发者使用该编码智能体访问过的各项服务的令牌。Because the post install script didn't try to steal anything itself. All it contained was a prompt addressed directly to the developer own AI coding assistant and it told them to go find secrets on the local machine and push them to a public repository so the attackers can swing by later and just grab them up. Now because these dev coding tools were already trusted local tools, they already had all their permissions. They had full file system access. That made it the single most effective search tool that was already sitting on that machine ready to be corrupted. Now, at the core of this incident is that a malicious actor was able to use a trusted dependency to talk directly to an unsandboxed agent. And the environment that the agent was running on, the local laptop, held a lot of things that was worth stealing from SSH keys to cloud credentials, tokens for every service that the developer used the coding agent to touch.
现在这里有几件事出了问题,对吧?首先,智能体是在本地运行的,也就是直接在实际计算机上运行。有些软件包内容未经任何过滤就直接传给了智能体,而且智能体拥有不受限制的访问权限,能够访问……Now, a couple things failed here, right? First off, agents were running locally like on the actual computer itself. There was package content that was reaching the agent completely unfiltered and the agent had unrestricted access to
沙箱与更小的影响范围Sandboxes and a smaller blast radius
文件系统和出站网络都被它访问到了,这就是它能够找到机密并将其外传的原因。有三件事本可以阻止它。显然,环境隔离会非常有用,对吧?使用一个不含任何个人数据的临时远程工作区,就意味着爆炸半径仅限于代理所在的那个容器,而不是开发者的整台笔记本电脑。模型代理层可以检查并过滤实际到达代理的内容。这样,那个软件包就无法直接与代理通信。它还可以标记代理试图向外发送的内容。最后一点是代理沙箱。即使指令真的传达到了代理那里,也不会有获取凭据的途径,而且任何外传行为都会触发警报。both the file system and the outbound network which is how it was able to both find the secrets and exfiltrate them. The three things that could have stopped it. I mean obviously environmental separation would have been huge, right? Having an ephemeral remote workspace with nothing personal on it meant that the blaze rate the blast radius just became the one container that the agent was in instead of the developer's whole laptop. Having a model proxy layer could have inspected and filtered what actually reached the agent. So the package would not have been a a way to actually talk to the agent directly. It could also have flagged what the agent was trying to send out. Now the last piece here is around agent sandboxing. So even if the instruction did land in that case there wouldn't have been a path to getting the credentials and no way to exfiltrate anything without setting off alarms.
现在,让我们暂时退后一步,从整体上看一看。我们来宏观地谈谈这三起事件。首先是 Replit 事件:一个权限过大的智能代理在代码冻结期间删除了生产数据。接着是 Copilot 遭入侵事件:攻击始于普通的电子邮件钓鱼骗局,却让攻击者得以访问一项内部 AI 订阅服务;该服务积极协助他们查找并窃取私人银行数据,而他们随后利用这些数据勒索赎金。然后是 NX 奇点攻击:它同样利用了供应链,将开发者的编码工具反过来对付他们,袭击了……的三条支柱。Now let's take a moment to zoom back out. Let's talk about these three incidents at the high level. We started off with the replet incident where we had an overprivileged agent that deleted production data despite an active code freeze. Then we had the co-pilot compromise which started with an ordinary email fishing scheme but gave an attacker access to an internal AI subscription which actively helped them find and excfiltrate private banking data that they were able to use to demand a ransom. Then we have the NX singularity attack which again exploited the supply chain turned developers coding tools against them hitting all three legs of the
层层设防,不要指望一招解决所有问题Layer defenses without a miracle fix
同时具备这三个致命要素。我想坦诚地告诉你,智能体安全还是一个非常新的领域。变化极其迅速,而且没有什么灵丹妙药能让你得到彻底保护。如果有供应商试图向你兜售这样的方案,那就值得保持怀疑。甚至我一直在谈论的这三个致命要素,也不是一份勾选完就能确保安全的清单。它更像是一种思维模型,帮助你理解 AI 工具实际上给你带来了多大风险。安全架构有六个关键组成部分,你需要把这六层防护叠加起来:因为即使攻击者,或者你自己的智能体——它本意是好的,但最终可能很容易受人影响——突破了其中一层,还有另外五层可以防守。而且,我这里列出的前三层就足以阻止我刚才讲到的每一起事故。lethal trifecta at once. Something I'm going to be candid with you for a moment about is that aentic security is a very new field. Things are moving extremely fast and there is no single miracle fix that is going to protect you completely. If you have a vendor that's trying to sell you one, then that's worth being skeptical of. Even the lethal trifecta I've been talking about isn't a checklist to take off and if you pass it, then you're safe. It's more of a mental model for understanding how much risk your AI tooling is actually exposing you to. There are six key parts to a secure architecture and you're going to want to layer these six because even if an attacker or your own agent well-meaning but uh ultimately suggestable gets past just one then there's still five more to go and even the first three that I see here could have stopped every incident that I just showed you.
实验隔离才是关键,对吧?智能体应该在隔离的远程工作区中运行。它们绝不应该在开发者的实际机器上工作,也绝不能有通往生产环境的途径。这是整个清单中杠杆效应最高的基础构件,因为提示词写了什么根本无关紧要。如果没有办法进入生产环境、获取敏感凭据,那就是安全的。这本可以避免 Replit 事件的发生,也可以把 NX 的影响范围缩小到仅限一个一次性容器。不过我得说,这并不能防范 Copilot 事件,因为 Copilot 是……Experimental separation is the key here, right? Agents should be executing in isolated remote workspaces. They should never be working on a developer's actual machine, never given a route to production. Like this is the highest leverage building block on this whole list because it doesn't matter what the prompt says. If there's no way to get to production, to get to the sensitive credentials, you're safe. This could have prevented the replet incident from happening. It could have shrked NX down to the blast radius of just one disposable container. Though I will say it wouldn't have protected from the copilot incident because copilot is
限定凭据范围并统一身份标识Scope credentials and align identity
完全运行在 SaaS 订阅内部。没有办法在单独的执行环境中运行它。接下来要坚持使用短期凭证和限定范围的凭证。我们已经不再处于持久、广泛授权的令牌有意义的时代。采用自动过期、缩小授权范围,以及按任务而非按问题签发凭证等机制,本可以防止 Replit 获取长期有效的访问凭证并借此实施删除;也能防止 Copilot 钓鱼事件中,攻击者在用户的实际会话结束后,仍继续通过脚本使用该订阅。顺便说一句,这正是像 Coder 这样的产品派上用场的地方,对吧?我们提供的是通过代码定义的工作区,可以将它们启动为彼此隔离的环境。living entirely inside of a SAS subscription. There's no way to run that in a separate execution environment. Next up is to stick to short-lived and scope credentials. We are not in the world where persistent broad scope tokens make sense. Having things like automatic expire expiration, narrow scoping, things that are issued per task instead of per issues that could have prevented replet which got its hands on a standing right access credential to make the deleting possible. as well as the co-pilot fishing where the attacker was able to keep on using the script the subscription even after the actual user session had ended. By the way, this is exactly where a product like coder comes in, right? What we do is we offer workspaces that are defined through code. They can spin up as isolated environments.
它们可以轻松拆除,而且你可以注入按任务签发、天然具有短时效性的凭据,而不是让凭据永远留在某人的笔记本电脑上。接下来是与身份对齐的访问控制。AI 工具应继承与人类访问相同的身份提供商强制策略,不应成为一套自成一体、另设入口的并行订阅机制。这本可以直接阻止 C-Pilot。财务用户的身份绝不应赋予助手回答诸如如何绕过内部数据丢失防护措施这类问题的权限。接下来,这就把我们带到了……的开端。They can be torn down easily and you're able to inject credentials inherently short-lived issued per task as opposed to living forever on someone's laptop. Next up is identity aligned access control. AI tooling should inherit the same identity provider enforcement as human access. Shouldn't be some parallel subscription with a door of its own. This is what could have directly stopped C-Pilot. A finance user's identity should never be able to grant an assistant permission to answer things like how to get around internal data loss prevention measures. Now that brings us to sort of the start of the
代理、沙箱隔离与审计可观测性Proxies, sandboxing and audit observability
面向智能体的特定解决方案。我们有模型代理层,它位于模型和智能体之间,可以检查、过滤并记录双方之间的每一次调用。它本可以通过在智能体读取外部内容之前剥除其中注入的指令,避免 NX singularity 事件。它也有可能避免 Copilot 事件:在请求得到回答之前,它可以标记出类似“嘿,我该如何绕过 DIP?”这样的请求。智能体沙箱可以视作智能体的防火墙:通过限制其对文件系统和网络的访问,缩小行为异常或遭到入侵的智能体可能造成的影响范围。这本可以避免 singularity 攻击,因为即使指令成功传到了智能体,也可以阻止它访问凭据,并阻止它运行命令来窃取这些数据。agentic specific solutions. We have the model proxy layer which sits between the model and the agent to inspect, filter, and log every call that's going between them. This could have prevented the NX singularity incident by stripping the injected instructions out of external content before the agent read it. And it's also something that could have prevented the copilot incident. It could have flagged a request like, hey, how do I bypass DIP before it actually got answered? Agent sandboxing can be thought of as a firewall for agents restrictions on the file system and the network so that a misbehaving or compromised agent has a limited blast radius. This could have prevented the singularity attack because even in the case in which the instruction made it through to the agent, it could have stopped the agent from getting access to the credentials and prevented the agent from running the command to excfiltrate that data.
最后一点是具备审计日志记录和可观测性,对吧?每一项可归因于某个人类的智能体操作,都应该记录在智能体自身无法触及的地方。这本可以避免 replet 的问题,也本可以在事件发生时,帮助更及时地发现 Copilot 遇到的事故。与其让日志埋没在海量数据中,不如实时监控日志并触发警报;这样一来,这些事故就能在几分钟内而非几个月后被发现。再说一次,Coder 提供的集成解决方案涵盖了所有这些方面。最后,可能采取的控制措施包括……Last up is having audit logging and observability. Right? We need to have every agentic action attributable to a human being should be logged somewhere outside of the agent's own reach. This could have prevented replet. This could have really helped out in catching the incident as it happened for co-pilot. Alerting on logs in real time as opposed to just buried in loads and loads of data would have meant catching these incidents in the matter of minutes instead of months. And again, all of these pieces are bits that coder offers an integrated solution for. To close off, the controls that could
审查三项风险并进行事前验尸Audit three risks and run a premortem
这三起事件都已被制止,但类似的问题很可能已经潜伏在你的组织内部,只等着被触发。Coder 可以帮助你应对这些问题。最后,我建议你在接下来的一周内审查三件事。第一,找出组织中的智能体能够读取的所有长期有效令牌。第二,弄清楚有多少智能体能够访问生产环境,或者能找到绕过现有限制的方法。第三,检查智能体实际上运行在哪里:它们是在沙箱中运行吗?是在受管工作区中运行吗?还是在别人的真实电脑、真实笔记本电脑上毫无约束地运行?我有一个建议:和你的团队进行一次事前复盘。假设你刚刚看到的三起事件之一,下个月就发生在你们身上。have stopped all three of these incidents are probably already inside of your organization. They're just waiting to be configured. Coder is something that can help with that. To end off, I have three things that I would recommend that you audit in this next week. One, I want you to track down every loan live token that agents in your organization can read. And two, I want you to figure out how many of your agents can find access to production, can find some way around your current limits. Three is I want you to check where your agents are actually executing. Are they sandboxed? Are they in managed workspaces? or are they just going wild on people's actual computers, actual laptops? One suggestion I have for you is to run a premortem with your team. Assume one of the three incidents that you just saw happens to you next month.
要么直接问大家实际上会怎么做,要么甚至可以假装事情真的发生了,看看大家实际上会怎么做。这个练习会准确地告诉你有哪些不足。好了,我的演讲到此结束。感谢大家观看,希望你们离开时学到了一两件事,也带着几个惊险故事,能在下次参加鸡尾酒会上讲给别人听。如果你想要这些幻灯片以供参考,给我发封邮件就行。如果你想试试 Coder Workspaces 或我们的 AI 治理解决方案,可以看看我们的工作区代码仓库,因为它免费、开源,而且支持自托管。你只需从我们的代码仓库拉取代码,就能在 15 分钟内完成设置。如果你有意购买 AI 治理产品或我们的其他企业功能,可以访问 coder.com/cont。Either ask people what they actually do or you can even pretend that it's actually happening and see what people actually do. That exercise is going to tell you exactly where your gaps are. So, that brings me to the end of my talk. Thank you all for watching, and hopefully you're walking away having learned a couple of things with some scary stories to tell at the next cocktail party you go to. If you would like to have these slides for reference, just shoot me an email. If you want to try Coder Workspaces or our AI governance solution, check out our repository for workspaces because it's free, open source, and self-hosted. you can just pull from our repository and get set up within 15 minutes. If you're interested in buying for AI governance or our other enterprise features, coder.com/cont is the way to go.
总之,感谢观看。Anyways, thank you for watching.