arXiv:2503.23250cs.CRcs.AI2025-03被引 7

用加密提示框住LLM权限,防滥用指令攻击

Encrypted Prompt: Securing LLM Applications Against Unauthorized Actions

  • 给用户输入加加密权限标签,执行前强制验证
  • 未授权操作即使生成也不执行,杜绝越权行为
  • 适合高安全要求的AI应用,如金融或医疗系统

大型语言模型(LLM)应用面临提示注入等安全威胁,可能引发未经授权的操作,如API滥用。现有方法多为尽力检测攻击,而本文提出新方案:在每个用户提示后附加加密提示,嵌入当前权限信息。在执行任何由LLM生成的动作(如API调用)前,先验证加密提示中的权限。若权限不足,则拒绝执行,确保只有在权限范围内的操作才能生效。当恶意提示试图诱导LLM生成有害行为时,该机制仍能通过权限校验阻止执行。因此,可有效缓解提示注入等攻击带来的风险。

原文摘要 · Abstract (English)

Security threats like prompt injection attacks pose significant risks to applications that integrate Large Language Models (LLMs), potentially leading to unauthorized actions such as API misuse. Unlike previous approaches that aim to detect these attacks on a best-effort basis, this paper introduces a novel method that appends an Encrypted Prompt to each user prompt, embedding current permissions. These permissions are verified before executing any actions (such as API calls) generated by the LLM. If the permissions are insufficient, the LLM's actions will not be executed, ensuring safety. This approach guarantees that only actions within the scope of the current permissions from the LLM can proceed. In scenarios where adversarial prompts are introduced to mislead the LLM, this method ensures that any unauthorized actions from LLM wouldn't be executed by verifying permissions in Encrypted Prompt. Thus, threats like prompt injection attacks that trigger LLM to generate harmful actions can be effectively mitigated.

大模型安全提示注入权限控制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。