HACKER PAPER · 2025 · arXiv preprint
Defeating Prompt Injections by Design
这篇论文在回答什么?
当代理读取邮件、网页或文件时,外部文字可能改变它接下来做什么。CaMeL把可信用户请求的规划与不可信内容的解析隔开,再由解释器追踪每个值的来源和允许读取者,在调用工具前检查安全策略。它把一部分防护责任放到模型周围的执行系统中,而不是只要求模型识别恶意指令;AgentDojo实验展示了这种设计的价值,也暴露出任务完成率、策略维护、用户确认与侧信道之间的代价。
怎样理解它的贡献
- 01
仅把规划模型与读数据的模型分开还不够:计划可以保持原样,收件人或文件名等参数仍可能被不可信内容改变。因此CaMeL同时检查工具参数的数据流和来源(§2、§5,PDF 3–11页)。
- 02
论文在AgentDojo的办公、银行、旅行和Slack任务中分别评估正常任务完成、受攻击时表现和策略触发。安全改进不能简化为所有模型都不损失效用,正文与附录报告了依赖数据决定后续动作、API说明不全和上下文不足等失败(§6、附录B/G/H,PDF 11–19、33–41、52–124页)。
- 03
来源标签和策略约束有助于限定不允许的数据传递,但保护取决于策略、工具标注和运行时实现;作者仍把解释器及其安全属性的形式验证列为未来工作(§9–10,PDF 23–25页)。
回到原文核对
页码按 PDF 文件从第 1 页计算。跳页是否生效取决于原站阅读器;也可以按章节和短引查找。
the P-LLM only interacts with the user queryNo, prompt injection attacks are not fully solved.把论文放进一个更大的问题
这些主题把论文与视频中的具体论点放在一起阅读。
Hacker News 评论 13
这里展示已核验、带论文链接的提及,按时间倒序排列,并非某个投稿下的全部评论。推荐、引用与批评分开标注;保留评论原文。
> 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
See also "CaMeLs Can Use Computers Too: System-level Security for Computer Use Agents", https://arxiv.org/abs/2601.09923v1
> 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/
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 条评论
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
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.
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/
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
This problem remains almost entirely unsolved. The closest we've got to what I consider a credible solution is the recent CaMeL paper from DeepMind: https://arxiv.org/abs/2503.18813 - I published some notes on that here: https://simonwillison.net/2025/Apr/11/camel/
[1] https://arxiv.org/pdf/2503.18813
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.
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 ↗