测试大模型系统指令在编码攻击下的泄露风险并提出有效防护方法
Evaluation and Hardening of LLM System Instructions Against Extraction via Encoding Attacks
- 将指令提取转化为结构化输出任务,突破拒绝式防御
- 7个模型中攻击成功率超70%,结构化序列化易泄露敏感信息
- 微调指令措辞即可显著降低攻击成功率,无需重新训练
大型语言模型中的系统指令常用于强制安全策略、定义代理行为及保护敏感操作上下文,可能包含API密钥、内部政策和特权流程定义,其泄露是OWASP LLM应用十大安全风险之一。许多应用依赖拒绝式指令阻止直接查询,隐含假设受保护信息仅可通过显式请求获取。我们提出自动化评估框架,测试当提取请求被重构成编码或结构化输出任务时,系统指令是否仍能保持机密性。在7个主流模型和46条经验证的系统指令上,发现结构化序列化任务中攻击成功率超过0.7,尽管模型拒绝直接提取请求,但仍会披露受保护内容。我们进一步提出基于思维链推理模型的一次性指令重构缓解策略,表明仅通过细微的措辞与结构调整,即可显著降低攻击成功率,且无需模型重训练。
原文摘要 · Abstract (English)
System Instructions in Large Language Models (LLMs) are commonly used to enforce safety policies, define agent behavior, and protect sensitive operational context in agentic AI applications. These instructions may contain sensitive information such as API credentials, internal policies, and privileged workflow definitions, making system instruction leakage a critical security risk highlighted in the OWASP Top 10 for LLM Applications. Without incurring the overhead costs of reasoning models, many LLM applications rely on refusal-based instructions that block direct requests for system instructions, implicitly assuming that prohibited information can only be extracted through explicit queries. We introduce an automated evaluation framework that tests whether system instructions remain confidential when extraction requests are re-framed as encoding or structured output tasks. Across seven common models and 46 verified system instructions, we observe high attack success rates (>0.7) for structured serialization where models refuse direct extraction requests but disclose protected content in the requested serialization formats. We further demonstrate a mitigation strategy based on one-shot instruction reshaping using a Chain-of-Thought reasoning model, indicating that even subtle changes in wording and structure of system instructions can significantly reduce attack success rate without requiring model retraining.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。