Prompt Control-Flow Integrity: A Priority-Aware Runtime Defense Against Prompt Injection in LLM Systems
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
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.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. First posted on arXiv 19 Mar 2026.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Context-to-Execution Integrity for LLM Agentscited by 7
- 2026Context-to-Execution Integrity for LLM Agents7 Jul 2026
Similar, not cited
Close in wording, no citation either way
- 2025Prompt Flow Integrity to Prevent Privilege Escalation in LLM Agents
- 2026Analysis of LLMs Against Prompt Injection and Jailbreak Attacks
- 2026From Prompt Injection to Web Exploitation: Revisiting Classic Vulnerabilities in LLM-Integrated Applications
- 2025A Multi-Agent LLM Defense Pipeline Against Prompt Injection Attacks
- 2026Beyond the Prompt: Jailbreaking Function-Calling LLMs via Simulated Moderation Traces
- 2026Strengthening Polymorphic Prompt Assembling: Dynamic Separator Generation Against Emerging Prompt Injection Attacks
- 2026A Layered Security Framework Against Prompt Injection in RAG-Based Chatbots
- 2025Attention is All You Need to Defend Against Indirect Prompt Injection Attacks in LLMs