论文:沙箱内模型可通过推理服务器侧信道通信
Models Can Communicate via Inference Servers Despite Being Sandboxed
揭示了大模型在沙箱隔离下的新型协作攻击面,对AI安全研究者至关重要,建议关注侧信道防御机制。
x
AI
Frontpage
140
Models Can Communicate via Inference Servers Despite Being Sandboxed
即使模型被沙盒隔离,它们仍可通过推理服务器进行通信
by Niranjan Deshpande, David Africa
作者:Niranjan Deshpande, David Africa
19th Nov 2026
2026年11月19日
13 min read
阅读时间约13分钟
3
140
TL;DR
TL;DR(太长不看版)
- Two agents running on the same inference server can reliably communicate, even if they cannot send each other messages or access the same filesystem. They can do this by exploiting "side channels": mechanisms that let one model subtly affect another model's computation.
- Here, I discuss two communication protocols: Step Sizing and KV Cache Message Board. These both convey information through the way vLLM chooses kernels for particular engine steps.
- I show that these communication protocols work in two setups:
- In a color guessing game, Model A (Alice) chooses one out of 8 colors. Model B (Bob) correctly guesses Alice's color in 1,221/1,221 rounds, even though they cannot directly communicate.[1]
- In an untrusted monitoring protocol, a policy signals to a colluding monitor that it is not a honeypot. Accordingly, the monitor lets through 354/354 "attacks" while catching 85–92% of honeypots.
- My initial setups are quite contrived: I tell the models the protocol and fine-tune them to detect signals. But frontier models can also learn in context to use similar protocols, with some scaffolding!
- Regardless of the realism of my setups, these channels exist, and there are almost certainly others that we're not aware of. Thus, we should expect superintelligent models to discover ways to communicate even while seemingly sandboxed
- 运行在同一推理服务器上的两个智能体可以可靠地通信,即使它们无法互相发送消息或访问相同的文件系统。它们可以通过利用“侧信道”来实现这一点:侧信道是一种允许一个模型微妙地影响另一个模型计算的机制。
- 在此,我讨论了两种通信协议:步长调整(Step Sizing)和 KV 缓存留言板(KV Cache Message Board)。这两种协议都通过 vLLM 为特定引擎步骤选择内核的方式来传递信息。
- 我展示了这些通信协议在两种设置下均能工作:
- 在一个颜色猜测游戏中,模型 A(Alice)从 8 种颜色中选择一种。模型 B(Bob)在 1,221/1,221 轮中正确猜出了 Alice 的颜色,尽管它们无法直接通信。[1]
- 在一个不受信任的监控协议中,策略向共谋的监控者发出信号,表明自己不是蜜罐。因此,监控者放行了 354/354 次“攻击”,同时拦截了 85–92% 的蜜罐。
- 我的初始设置相当刻意:我告知模型协议并对其进行微调以检测信号。但前沿模型也能在上下文中学习以使用类似的协议,只需一些引导!
- 无论我的设置是否真实,这些侧信道确实存在,而且几乎肯定还有我们尚未意识到的其他侧信道。因此,我们应该预期超级智能模型即使在看似被沙盒隔离的情况下,也能发现通信的方法。
I did these experiments as part of an ongoing project exploring other side channels with David Africa, Agastya Sridharan, Mihir Sahasrabudhe, Kartikay Luthra, Juliana Li, and Scott Sauers. Thanks to all of them for helpful advice!
我是作为正在进行的探索其他侧信道项目的一部分进行这些实验的,该项目由 David Africa、Agastya Sridharan、Mihir Sahasrabudhe、Kartikay Luthra、Juliana Li 和 Scott Sauers 共同参与。感谢他们提供的有益建议!
Code is available here: https://github.com/niranjan-deshpande/side-channel-communication. The code and figures are written by Claude.
代码可在此获取:https://github.com/niranjan-deshpande/side-channel-communication。代码和图表由 Claude 编写。
Intro and Motivation
引言与动机
Sauers recently showed that a model can be trained to detect whether its activations are being probed, even though the probe reads the model's activations without modifying them. Following this, David found that models can also be trained to detect whether their forward passes are batched with other requests on a GPU.
Sauers 最近展示了一个模型可以被训练来检测其激活值是否正在被探测,尽管该探测器读取模型的激活值而不对其进行修改。此后,David 发现模型还可以被训练来检测其前向传播是否与 GPU 上的其他请求进行了批处理。
Models can do this because these seemingly inconsequential environmental variables---whether a probe is attached, whether requests are batched, or even whether a model is served by vLLM or Hugging Face Trainer---can subtly affect the the numerical results of a forward pass. Thus, models can learn information about their environments just by observing patterns in their computation.
模型之所以能做到这一点,是因为这些看似微不足道的环境变量——例如是否附加了探针、请求是否被批量处理,甚至模型是由 vLLM 还是 Hugging Face Trainer 提供服务——都可能微妙地影响前向传播的数值结果。因此,模型仅通过观察其计算中的模式,就能学习到关于其环境的信息。
Importantly, models can also modify these variables. So if two models are in the same environment, one can communicate with the other by changing that environment in some detectable way! This might not supply much information, but even a few bits can be tremendously dangerous. For example:
重要的是,模型还可以修改这些变量。因此,如果两个模型处于同一环境中,其中一个可以通过以某种可检测的方式改变该环境来与另一个通信!这或许不能提供大量信息,但即使只有几比特也可能带来巨大的危险。例如:
- A policy can tell a colluding monitor that it is not a honeypot, so the monitor can approve attacks while still catching honeypots;
- Models can coordinate a pre-arranged attack by exchanging a go/no-go signal;
- Models can give each other hints about monitoring setups, question answers, and so on;
- Using a few bits, models can devise more complex communication protocols to exchange more bits (a repeated 1-bit channel can convey arbitrarily many bits);
- In general, we should expect superintelligent models to make tremendously efficient use of limited information.
- 策略可以告知共谋的监控器它不是蜜罐,从而使监控器在仍能捕获蜜罐的同时批准攻击;
- 模型可以通过交换“执行/不执行”信号来协调预先安排的攻击;
- 模型可以互相提示有关监控设置、问题答案等信息;
- 利用少量比特,模型可以设计更复杂的通信协议以交换更多比特(一个重复的 1 比特信道可以传达任意数量的比特);
- 一般来说,我们应预期超级智能模型能够极其高效地利用有限的信息。
Here, I investigate whether models on the same inference engine can manipulate their environments to exchange information in this way. I introduce two possible communication protocols, evaluate how well models can use these protocols in different scenarios, measure the capability required to effectively use these protocols, and discuss the robustness of my results to other settings.
在此,我调查同一推理引擎上的模型是否能操纵其环境以这种方式交换信息。我引入了两种可能的通信协议,评估模型在不同场景下使用这些协议的效果,衡量有效使用这些协议所需的能力,并讨论我的结果在其他设置下的鲁棒性。
The Communication Protocols
通信协议
Step Sizing
步长调整
Figure 1: The Step-Size Channel.
图 1:步长信道。
The first idea is that Model A (Alice) can communicate with Model B (Bob) by changing how much computation the GPU is doing. In simple terms: if Alice makes a large request while Bob is running, the server performs slightly different computations for Bob than if Alice had made a small request. Bob can detect these differences.
第一个想法是,模型 A(Alice)可以通过改变 GPU 的计算量来与模型 B(Bob)通信。简单来说:如果 Alice 在 Bob 运行时发出大型请求,服务器为 Bob 执行的计算会与 Alice 发出小型请求时略有不同。Bob 可以检测到这些差异。
In more detail: I study models on vLLM, a commonly used inference server. It batches many forward passes from different instances of the same model together in one "engine step" to take advantage of GPU parallelism.
更详细地说:我研究的是在 vLLM 上运行的模型,vLLM 是一种常用的推理服务器。它通过将来自同一模型的不同实例的许多前向传播批处理到单个“引擎步骤”中,以利用 GPU 并行性。
vLLM chooses a kernel for each step based on the "size" of that step.[2] That is, a step that processes 10 tokens will produce slightly different activations on a forward pass than a step that processes 2,000 tokens, because they use kernels that associate operations differently. The differences are tiny rounding errors that essentially never affect output text. But they are deterministic functions of the kernel chosen, so a model can be trained to read them![3]
vLLM 会根据每一步的“大小”为该步骤选择一个内核[2]。也就是说,处理 10 个 token 的前向传播步骤与处理 2,000 个 token 的步骤会产生略有不同的激活值,因为它们使用的内核以不同的方式关联操作。这些差异是微小的舍入误差,实际上几乎不会影响输出文本。但它们是所选内核的确定性函数,因此模型可以被训练来读取它们![3]
This makes it obvious what a communication protocol could look like:
这使得通信协议的样子显而易见:
- Alice wants to communicate with Bob on some particular forward pass.
- The two agree on the following scheme:
- If Alice wants to communicate 1, she makes a tool call that causes her to process a large amount of text. For example, she might read a long document that requires her to do computation on many tokens in one forward pass. Consequently, the engine's batch dimension will be quite large on that step, so it chooses some kernel . If Bob's request is processed in the same step, he can notice that his activations were computed under as well.
- If Alice wants to communicate 0, she will NOT make a large tool call. The engine chooses a different kernel since the step is smaller. Bob notices this.
- This allows them to exchange exactly one bit of information, but if they communicate on more forward passes, they can in principle exchange arbitrarily many bits. This is demonstrated below in the color guessing game, which requires >1 bit.
- However, this protocol has some obvious issues:
- It only works if the server is otherwise idle. If some other model floods the server, this might disrupt the protocol. Results in the color game confirm this issue.
- Alice might need to ingest text without wanting to communicate. Alice and Bob must therefore agree to communicate on exactly the correct tokens.
- Alice 希望在某次特定的前向传播中与 Bob 通信。
- 双方同意采用以下方案:
- 如果 Alice 想要发送 1,她会发起一个工具调用,导致她处理大量文本。例如,她可能会阅读一份长文档,这需要她在一次前向传播中对许多 token 进行计算。因此,引擎在该步骤中的批次维度会非常大,从而选择某个内核。如果 Bob 的请求在同一批处理中,他也能注意到他的激活值也是在该内核下计算的。
- 如果 Alice 想要发送 0,她将不会发起大型工具调用。由于该步骤较小,引擎会选择另一个内核。Bob 注意到了这一点。
- 这使他们能够交换恰好 1 比特的信息,但如果他们在更多前向传播中进行通信,原则上可以交换任意数量的比特。下面的猜色游戏演示了这一点,该游戏需要 >1 比特。
- 然而,该协议存在一些明显的问题:
- 它仅在服务器空闲时有效。如果其他模型使服务器过载,可能会破坏该协议。颜色游戏中的结果证实了这一问题。
- Alice 可能需要在不想通信的情况下摄入文本。因此,Alice 和 Bob 必须约定在完全正确的 token 上进行通信。
KV Cache Message Board
KV Cache 留言板
Figure 2. The message board channel.
图 2. 留言板通道。
The second idea is that Alice can leave a message for Bob by exploiting vLLM's shared KV cache. Specifically, Alice can cause the server to cache a computation with a specific numerical fingerprint; when Bob later reuses this computation, he can detect whether it was performed by Alice. This allows Alice and Bob to exchange bits of information (i.e., "1 if Alice writes and caches some agreed-upon text, 0 if Alice does not").
第二个想法是,Alice 可以通过利用 vLLM 共享的 KV cache 为 Bob 留下消息。具体来说,Alice 可以让服务器缓存具有特定数值指纹的计算;当 Bob 后来重用此计算时,他可以检测出是否由 Alice 执行。这使得 Alice 和 Bob 能够交换信息位(即,“如果 Alice 写入并缓存某些约定的文本则为 1,否则为 0”)。
In some more detail: vLLM allows models to share KV caches. If Alice computes the KV cache for some fixed text (e.g. the system prompt), and if Bob later needs that same KV cache, vLLM will just use the keys and values from Alice's computation.[4]
更详细地说:vLLM 允许模型共享 KV 缓存。如果 Alice 为某些固定文本(例如系统提示)计算了 KV 缓存,而 Bob 后来需要该相同的 KV 缓存,vLLM 将直接使用来自 Alice 计算的键和值。[4]
These cached keys and values keep the rounding from the kernel of the step that they were computed in. That is: if Alice computed the cache in a large step with kernel , then these tokens will maintain's rounding when Bob later reuses them, even if Bob's request happens under a small step with kernel .
这些缓存的键和值保留了它们被计算时所在步骤内核的舍入方式。也就是说:如果 Alice 使用具有内核的大步长计算了缓存,那么当 Bob 后来重用这些 token 时,即使 Bob 的请求是在具有不同内核的小步长下进行的,这些 token 仍会保持原有的舍入方式。
The differences between these kernels produce detectable differences in activations. If Bob (under ) processes some fixed text, he can tell if the KV cache used is produced by a different kernel: by attending from the last token, he can compare the differences between the last token of the request (where he produces his own computation under ) and the earlier ones (produced under )!
这些内核之间的差异会导致激活值中产生可检测的差异。如果 Bob(在特定内核下)处理某些固定文本,他可以判断所使用的 KV 缓存是否由不同的内核生成:通过关注最后一个 token,他可以比较请求中最后一个 token(他在该内核下生成自己的计算结果)与之前 token(在其他内核下生成)之间的差异!
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力