中文

使用多态提示保护 LLM 代理免受提示注入攻击

密码学与安全 2025-06-09 v1 人工智能

摘要

LLM 代理广泛用于客户支持、内容生成和代码辅助等场景。然而, 它们容易受到提示注入攻击, 即恶意输入操纵模型行为。传统防御方法如输入清洗、守卫模型和警戒措施要么繁琐, 要么无效。本文提出了一种新颖且轻量级的防御机制,称为多态提示组装(PPA),其可几乎零开销地保护免受提示注入攻击。该方法基于以下洞见: 提示注入需要猜测和破坏系统提示的结构。通过动态变化系统提示的结构, PPA 可防止攻击者预测提示结构, 从而在不损害性能的前提下增强安全性。我们进行了实验以评估 PPA 对现有攻击的有效性, 并将其与其他防御方法进行了比较。

关键词

引用

@article{arxiv.2506.05739,
  title  = {To Protect the LLM Agent Against the Prompt Injection Attack with Polymorphic Prompt},
  author = {Zhilong Wang and Neha Nagaraja and Lan Zhang and Hayretdin Bahsi and Pawan Patil and Peng Liu},
  journal= {arXiv preprint arXiv:2506.05739},
  year   = {2025}
}

备注

To appear in the Industry Track of the 55th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2025)