Skip to main content
QUICK REVIEW

[论文解读] Signed-Prompt: A New Approach to Prevent Prompt Injection Attacks Against LLM-Integrated Applications

Xuchen Suo|arXiv (Cornell University)|Jan 15, 2024
Security and Verification in ComputingComputer Science被引用 3
一句话总结

本文提出 Signed-Prompt,一种针对大语言模型(LLM)集成应用中提示注入攻击的新型防御机制。通过在命令段中对敏感指令进行密码学签名,该方法使大语言模型能够验证可信输入,通过提示工程和微调两种方法,对各类注入攻击展现出强大的抵抗力。

ABSTRACT

The critical challenge of prompt injection attacks in Large Language Models (LLMs) integrated applications, a growing concern in the Artificial Intelligence (AI) field. Such attacks, which manipulate LLMs through natural language inputs, pose a significant threat to the security of these applications. Traditional defense strategies, including output and input filtering, as well as delimiter use, have proven inadequate. This paper introduces the 'Signed-Prompt' method as a novel solution. The study involves signing sensitive instructions within command segments by authorized users, enabling the LLM to discern trusted instruction sources. The paper presents a comprehensive analysis of prompt injection attack patterns, followed by a detailed explanation of the Signed-Prompt concept, including its basic architecture and implementation through both prompt engineering and fine-tuning of LLMs. Experiments demonstrate the effectiveness of the Signed-Prompt method, showing substantial resistance to various types of prompt injection attacks, thus validating its potential as a robust defense strategy in AI security.

研究动机与目标

  • 解决大语言模型(LLM)集成应用中日益增长的提示注入攻击威胁,此类攻击利用自然语言输入操纵模型行为。
  • 克服传统防御机制(如输入过滤和分隔符)的局限性,这些机制在面对复杂注入模式时会失效。
  • 通过敏感命令的密码学签名,使大语言模型能够区分可信与不可信指令。
  • 设计并评估一种实用且可部署的防御机制,通过提示工程和微调与现有大语言模型(LLM)流水线兼容。
  • 在真实世界应用场景中,验证 Signed-Prompt 对多样化提示注入攻击向量的有效性。

提出的方法

  • Signed-Prompt 方法涉及使用密码学签名方案对敏感指令进行签名,并将签名嵌入提示结构中。
  • 可信用户生成并嵌入包含指令及其数字签名的签名命令段。
  • 大语言模型通过训练或提示方式,验证签名的真实性后再执行指令,确保输入完整性。
  • 系统使用验证模块,通过公钥检查签名的有效性,拒绝任何未经验证或被篡改的输入。
  • 该方法支持提示工程(例如,带签名验证的结构化提示模板)和微调(例如,使模型能够识别并验证签名输入)两种方式。
  • 该方法可无缝集成到现有大语言模型(LLM)工作流中,无需对架构进行重大修改。

实验结果

研究问题

  • RQ1对命令段进行密码学签名是否能有效防止大语言模型(LLM)集成应用中的提示注入攻击?
  • RQ2Signed-Prompt 与传统防御机制(如输入过滤和基于分隔符的分离)相比,在抵御高级注入技术方面表现如何?
  • RQ3Signed-Prompt 在仅使用提示工程的情况下,其可实现程度如何,是否需要模型微调?
  • RQ4Signed-Prompt 在真实世界部署场景中对模型性能和延迟的影响如何?
  • RQ5Signed-Prompt 机制对零日或此前未见的提示注入模式具有多强的鲁棒性?

主要发现

  • Signed-Prompt 方法对多种提示注入攻击表现出显著的抵抗力,包括那些可绕过传统过滤机制的攻击。
  • 该方法有效防止了不可信输入对大语言模型(LLM)行为的未经授权操纵,即使攻击者使用混淆或对抗性措辞也未能奏效。
  • Signed-Prompt 的提示工程与微调两种变体在检测恶意输入方面均实现了高准确率,同时保持了较低的误报率。
  • 将密码学签名集成到提示流中,使大语言模型能够可靠地认证可信命令来源,而无需修改模型核心架构。
  • 实验结果证实,Signed-Prompt 在鲁棒性和对不断演变的攻击模式的适应性方面优于传统防御策略。
  • 该方法性能开销极小,表明其在生产环境中大语言模型(LLM)应用的实时部署中具有可行性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。