HackerTube English?
← Hacker Paper

HACKER PAPER · 2025 · arXiv preprint

Defeating Prompt Injections by Design

Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, Florian Tramèr

8 个 HN 账号提及3 个账号明确推荐阅读 HN 评论 ↓

这篇论文在回答什么?

当代理读取邮件、网页或文件时,外部文字可能改变它接下来做什么。CaMeL把可信用户请求的规划与不可信内容的解析隔开,再由解释器追踪每个值的来源和允许读取者,在调用工具前检查安全策略。它把一部分防护责任放到模型周围的执行系统中,而不是只要求模型识别恶意指令;AgentDojo实验展示了这种设计的价值,也暴露出任务完成率、策略维护、用户确认与侧信道之间的代价。

怎样理解它的贡献

  1. 01

    仅把规划模型与读数据的模型分开还不够:计划可以保持原样,收件人或文件名等参数仍可能被不可信内容改变。因此CaMeL同时检查工具参数的数据流和来源(§2、§5,PDF 3–11页)。

  2. 02

    论文在AgentDojo的办公、银行、旅行和Slack任务中分别评估正常任务完成、受攻击时表现和策略触发。安全改进不能简化为所有模型都不损失效用,正文与附录报告了依赖数据决定后续动作、API说明不全和上下文不足等失败(§6、附录B/G/H,PDF 11–19、33–41、52–124页)。

  3. 03

    来源标签和策略约束有助于限定不允许的数据传递,但保护取决于策略、工具标注和运行时实现;作者仍把解释器及其安全属性的形式验证列为未来工作(§9–10,PDF 23–25页)。

回到原文核对

页码按 PDF 文件从第 1 页计算。跳页是否生效取决于原站阅读器;也可以按章节和短引查找。

the P-LLM only interacts with the user query
§ 5.1 The Privileged and Quarantined LLMs · PDF 第 7 页 · arXiv v2 (24 June 2025)查看这一页 ↗
No, prompt injection attacks are not fully solved.
§ 9.3 So, Are Prompt Injections Solved Now? · PDF 第 24 页 · arXiv v2 (24 June 2025)查看这一页 ↗

导读依据: arXiv v2 (24 June 2025) ↗

把论文放进一个更大的问题

这些主题把论文与视频中的具体论点放在一起阅读。

Hacker News 评论 13

这里展示已核验、带论文链接的提及,按时间倒序排列,并非某个投稿下的全部评论。推荐、引用与批评分开标注;保留评论原文。

msdz引用原评论 ↗
>> Perhaps the answer is to have another agent who's goal is not to complete the given task, but to spot cheating or malicious behavior.

> That does seem a little like solving the problems in AI by using more of it

Yes, and IIRC Google used this as part of a technique against prompt injection already [0], back when models were way more susceptible to it.

[0] Cf. CaMeL: https://arxiv.org/abs/2503.18813
simonw引用原评论 ↗
Meta AI's David Singleton has a thread about their security prompt injection defenses here: https://twitter.com/dps/status/2097404102468899131

> One threat we’re particularly focused on is prompt injection, and we handle it in layers. The model is trained to recognize and resist it. The harness marks anything coming from an untrusted source. Deterministic code checks the result. And an ensemble of classifiers runs where the agent can't reach them.

That "deterministic code" bit makes me wonder if they've implemented ideas from the DeepMind CaMeL paper: https://arxiv.org/abs/2503.18813 - my notes on that paper here: https://simonwillison.net/2025/Apr/11/camel/
msdz引用原评论 ↗
Interesting article you’ve linked. I’m not sure I agree, but it was a good read and food for thought in any case.

Work is still being done on how to bulletproof input “sanitization”. Research like [1] is what I love to discover, because it’s genuinely promising. If you can formally separate out the “decider” from the “parser” unit (in this case, by running two models), together with a small allowlisted set of tool calls, it might just be possible to get around the injection risks.

[1] Google DeepMind: Defeating Prompt Injections by Design. https://arxiv.org/abs/2503.18813
查看其余 9 条评论
msdz引用原评论 ↗
I agree, this is inherently unsafe. The two core security issues for agents, I’d say, are in LLMs not producing a “deterministic” outcome, and prompt injection.

Prompt injection is _probably_ solvable if something like [1] ever finds a mainstream implementation and adoption, but agents not being deterministic, as in “do not only what I’ve told you to do, but also how I meant it”, all while assuming perfect context retention, is a waaay bigger issue. If we ever were to have that, software development as a whole is solved outright, too.

[1] Google DeepMind: Defeating Prompt Injections by Design. https://arxiv.org/abs/2503.18813
brap引用原评论 ↗
The problem is that once you load a tool’s response into context, there’s no telling what the LLM will do. You can escape it all you want, but maybe it contains the right magic words you haven’t thought of.

The solution is to not load it into context at all. I’ve seen a proposal for something like this but I can’t find it (I think from Google?). The idea is (if I remember it correctly) to spawn another dedicated (and isolated) LLM that would be in charge of the specific response. The main LLM would ask it questions and the answers would be returned as variables that it may then pass around (but it can’t see the content of those variables).

Edit: found it. https://arxiv.org/abs/2503.18813

Then there’s another problem: how do you make sure the LLM doesn’t leak anything sensitive via its tools (not just the payload, but the commands themselves can encode information)? I think it’s less of a threat if you solve the first problem, but still… I didn’t see a practical solution for this yet.
amonks推荐原评论 ↗
That’s a pretty scary answer, to be honest.

Regardless, here’s the CaMeL paper. Defeating Prompt Injections by Design (2025): https://arxiv.org/abs/2503.18813

Here’s a paper offering a survey of different mitigation techniques, including CaMeL. Design Patterns for Securing LLM Agents against Prompt Injections (2025): https://arxiv.org/abs/2506.08837

And here’s a high-level overview of the state of prompt injection from 'simonw (who coined the term), which includes links to summaries of both papers above: https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/
simonw作者关联原评论 ↗
Yup, I have a different definition of expert. I'm not an expert in training models - I'm an expert in applications of those models, and how to explain those applications to other people.

AI engineering, not ML engineering, is one way of framing that.

I don't write papers (I don't have the patience for that), but my work does get cited in papers from time to time. One of my blog posts was the foundation of the work described in the CaMeL paper from DeepMind for example: https://arxiv.org/abs/2503.18813
rexpository推荐原评论 ↗
I broadly agree that "MCP-level" patches alone won't eliminate prompt-injection risk. Latest research also shows we can make real progress by enforcing security above the MCP layer, exactly as you suggest [1]. DeepMind's CaMeL architecture is a good reference model: it surrounds the LLM with a capability-based "sandbox" that (1) tracks the provenance of every value, and (2) blocks any tool call whose arguments originate from untrusted data, unless an explicit policy grants permission.

[1] https://arxiv.org/pdf/2503.18813
groby_b引用原评论 ↗
> Is the layoff-based business model really the best use case for AI systems?

No, but it plays well in quarterly earnings. So expect a good bit, I'd say.

> The flaws are baked into the training data.

Not in terms of attack area.

In terms of hallucinations... ish. It's more baked into the structure than the training data. There's increasing amounts of work to ensure well-curated training data. Still, the whole idea of probabilistic selection of tokens more or less guarantees it'll go wrong from time to time. (See e.g. https://arxiv.org/abs/2401.11817)

In terms of safety, there's some progress. CaMeL is rather interesting: https://arxiv.org/abs/2503.18813

> "Trust but verify" applies.

FWIW, that applies to humans too. Nobody is error-free. And so the question becomes mostly "does the value overshadow the cost of the error", as always.
simonw推荐原评论 ↗
I've been following prompt injection for 2.5 years and until last week I hadn't seen any convincing mitigations for it - the proposed solutions were almost all optimistic versions of "if we train a good enough model it won't get tricked any more", which doesn't work.

What changed is the new CaMeL paper from DeepMind, which notably does not rely on AI models to detect attacks: https://arxiv.org/abs/2503.18813

I wrote my own notes on that paper here: https://simonwillison.net/2025/Apr/11/camel/
直接投稿与讨论(5)Defeating Prompt Injections by Design · 1 分 · 2025-04-21 ↗Defeating Prompt Injections by Design · 2 分 · 2025-04-19 ↗CaMeL: Defeating Prompt Injections by Design · 71 分 · 2025-04-19 ↗Defeating Prompt Injections by Design · 2 分 · 2025-04-11 ↗Defeating Prompt Injections by Design · 1 分 · 2025-03-26 ↗