LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense
Abstract
Large language models (LLMs) perform remarkably well on complex tasks, yet remain highly vulnerable to prompt injection attacks, where malicious instructions embedded in external data can override user intent. Existing defenses remain limited by model fine-tuning requirements, vulnerability to adaptive attacks, or reliance on brittle handcrafted prompts. We argue that a fundamental source of this vulnerability is the lack of an explicit representation of trust provenance. To address this, we introduce Learnable Trust-Boundary Delimiters (LTBD), a lightweight defense that explicitly encodes trust boundaries in the input while keeping the LLM parameters unchanged. LTBD uses a small number of learnable delimiters to distinguish trusted user instructions from untrusted external data, enabling the model to better respect the intended trust hierarchy. Experimental results show that LTBD substantially outperforms inference-time defenses and performs competitively with training-based approaches, while preserving benign-task utility and introducing negligible inference overhead. In particular, LTBD achieves 0.00% ASR on AlpacaFarm and only 0.11-0.19% ASR on TaskTracker. LTBD also remains effective under adaptive attacks, where adversaries have full knowledge of the defense and explicitly attempt to bypass it.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
- Comments
- 5 pages, 3 tables, 1 figures
Related papers
AETHON: Deterministic Pre-Inference Defense for LLM Prompt Injection
Shared title terminologycs.CRLeonardo Bruscagini de Lima, Jorge Valverde-Rebaza, Alexandre de Barros Barreto et al.
WorldClave: Extending Enclave Boundaries to Devices for Trusted Robotic Workloads
Shared title terminologycs.CRHayoung Kang, Sujin Park, Seonghwan Park et al.
Forensic Visibility of Malicious Model Context Protocol (MCP) Servers: An Empirical Study Across Agent and Kernel Trust Boundaries
Shared title terminologycs.CRCesar R. Beltrán-Hernández
Aligning Tool Descriptions and Implementations to Detect Prompt Injections in LLM Agents
Shared title terminologycs.CRJohnny Song, Shih-Chieh Dai, Guanhong Tao
BrowseSafe++: Benchmarking Prompt Injection Detection Across Web Contexts, Languages, and Browser Views
Shared title terminologycs.CRYuetian Chen, Kaiyuan Zhang, Yuntao Du et al.
When Does Trust Help? A Leakage-Free Evaluation of Representation- and Aggregation-Based Defenses Against Backdoors in Federated Intrusion Detection
Shared title terminologycs.CRShiddarth Dey Tusar, Zawad Yalmie Sazid