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.

Keywords

Subject

Publication details

Journal
Not available
Open access
Green open access

Cite this article

APA 7

Zhao, L., Xu, M., Zhang, Y., & Yang, Y. (2026). LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense. https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense

MLA 9

Zhao, Luman, et al. "LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense." https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense.

Chicago (author–date)

Zhao, Luman, Minghui Xu, Yue Zhang, and Yijun Yang. 2026. "LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense." https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense.

Harvard

Zhao, L., Xu, M., Zhang, Y. and Yang, Y. (2026) 'LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense', Available at: https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense.

Vancouver

Zhao L, Xu M, Zhang Y, Yang Y. LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense. https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense

IEEE

L. Zhao, M. Xu, Y. Zhang, and Y. Yang, "LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense," https://omanscience.com/en/articles/ltbd-learnable-trust-boundary-delimiters-for-prompt-injection-defense.