arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.18433cs.CR
收藏

提示控制流完整性:一种优先级感知的运行时防御,用于对抗LLM系统中的提示注入

Prompt Control-Flow Integrity: A Priority-Aware Runtime Defense Against Prompt Injection in LLM Systems

University of Rajshahi(拉杰沙希大学);Marshall University(马歇尔大学);University of Aizu(会津大学)

Md Takrim Ul Alam, Akif Islam, Mohd Ruhul Ameen, Abu Saleh Musa Miah, Jungpil Shin

AI总结:

本文提出Prompt Control-Flow Integrity,一种优先级感知的运行时防御机制,通过结构化组合系统、开发者、用户和检索文档片段来防范提示注入攻击,实现零误报率和低开销。

摘要:

大型语言模型(LLM)在API后端和检索增强生成(RAG)堆栈中部署时,易受提示注入攻击的影响,可能推翻系统策略、破坏预期行为并导致不安全输出。现有防御措施通常将提示视为扁平字符串,依赖于随意过滤或静态 jailbreak 检测。本文提出Prompt Control-Flow Integrity(PCFI),一种优先级感知的运行时防御,将每个请求建模为系统、开发者、用户和检索文档片段的结构化组合。PCFI应用三个阶段的中间件流水线:词法启发式、角色切换检测和分层策略执行,在转发请求到后端LLM之前。我们实现PCFI为基于FastAPI的网关,用于已部署的LLM API,并在自定义基准测试中评估了合成和半现实的提示注入工作负载。在评估的基准测试套件上,PCFI拦截所有标记为攻击的请求,保持0%的误报率,并引入了仅0.04毫秒的中位处理开销。这些结果表明,具有来源和优先级感知的提示执行是一种实用且轻量的防御措施,用于已部署的LLM系统。

英文摘要:

Large language models (LLMs) deployed behind APIs and retrieval-augmented generation (RAG) stacks are vulnerable to prompt injection attacks that may override system policies, subvert intended behavior, and induce unsafe outputs. Existing defenses often treat prompts as flat strings and rely on ad hoc filtering or static jailbreak detection. This paper proposes Prompt Control-Flow Integrity (PCFI), a priority-aware runtime defense that models each request as a structured composition of system, developer, user, and retrieved-document segments. PCFI applies a three-stage middleware pipeline, lexical heuristics, role-switch detection, and hierarchical policy enforcement, before forwarding requests to the backend LLM. We implement PCFI as a FastAPI-based gateway for deployed LLM APIs and evaluate it on a custom benchmark of synthetic and semi-realistic prompt-injection workloads. On the evaluated benchmark suite, PCFI intercepts all attack-labeled requests, maintains a 0% False Positive Rate, and introduces a median processing overhead of only 0.04 ms. These results suggest that provenance- and priority-aware prompt enforcement is a practical and lightweight defense for deployed LLM systems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑