LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense

Luman Zhao, Minghui Xu, Yue Zhang, Yijun Yang
10/8/2026
cs.CRcs.AI

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhao2026ltbd,
  title  = {LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection Defense},
  author = {Luman Zhao and Minghui Xu and Yue Zhang and Yijun Yang},
  year   = {2026},
  eprint = {2610.11634},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.11634v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.11634.svg)](https://codeofpaper.com/paper/2610.11634)

Discussion