mlsanityData to 14 Oct 2026

Semantic Overlays: Mitigating Prompt Injection with Annotations Beyond Tokens and Steering Vectors

arXiv 2608.23873 ↗First posted 24 Aug 2026cs.AI cs.CL cs.CRcited by 0

On the map: LLM safety and security → Prompt injection and agent security

also in 1 more
Abstract (arXiv)

Everything a language model sees is tokens. The serving stack knows what each span is -- user input, tool output, instructions -- but the model must keep track of that itself, and can lose track or be confused: text can be written to read like anything. Prompt injection is a natural exploit of this phenomenon. By scrambling the model's understanding of span identity, an attacker can induce unwanted and dangerous actions. Adding a non-textual channel to the model's input -- a way to communicate span identity beyond text -- mitigates this class of attack. We thus introduce a general steering technique called Semantic Overlays: small learned adapters applied at chosen prefill positions to a frozen model's residual stream. Laying an overlay over a span creates an out-of-band annotation channel that cannot be replicated by tokens. Unlike steering vectors, Semantic Overlays are trained, adaptable, and selectively applied. An overlay can encode complex semantics that reshape how the model perceives the marked span: asked to copy a code snippet under an overlay asserting a different programming language, the model rewrites the snippet in the asserted language. Overlays compose, allow transparent reading of underlying content, and can carry complex payloads -- including imperatives the model will follow. An overlay which marks a span as "non-executable" defends against the broad class of prompt injections that add instructions in untrusted context. We report strong results on five prompt injection benchmarks: SEP separation rises from 24.3% to 99.0% with utility unchanged (our scoring rule; we correct a defect in the published grader), TensorTrust attack success falls from 34.8% to 6.2%, AlpacaFarm from 99.0% to 0%, and the overlay beats every published PIArena defense that leaves the model able to answer -- while marked spans stay readable, all at >95% character similarity to the original.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 19 of its 21 references that are in the map. First posted on arXiv 24 Aug 2026.

Builds on

19 of 21 references.

Closest ancestors · 7

Same direction, newest first

  1. 2026PIArena: A Platform for Prompt Injection Evaluation9 Apr
  2. 2025Stronger Enforcement of Instruction Hierarchy via Augmented Intermediate Representations25 May
  3. 2025ASIDE: Architectural Separation of Instructions and Data in Language Models13 Mar
  4. 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchy9 Oct
  5. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions19 Apr
  6. 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
  7. 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game2 Nov

Other references · 12

  1. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
  2. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
  3. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,336
  4. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
  5. 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,085
  6. 2023Steering Language Models With Activation Engineeringcited by 922
  7. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 832
  8. 2026Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnetcited by 191
  9. 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 81
  10. 2014A Comparative Study of Programming Languages in Rosetta Codecited by 19
  11. 2026Steering Instruction Hierarchies at Inference Timecited by 2
  12. 2026Epistemic Goggles: A Pretrained Module that Induces an Epistemic Frame via Gradient Editingcited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuning
  2. 2025PromptSleuth: Detecting Prompt Injection via Semantic Intent Invariance
  3. 2025The Linear Geometry of Interpretable Tokens: Jailbreaking Attacks and Defenses for Unlearned Diffusion Models
  4. 2026AttackEval: A Systematic Empirical Study of Prompt Injection Attack Effectiveness Against Large Language Models
  5. 2024Defending Large Language Models against Jailbreak Attacks via Semantic Smoothing
  6. 2025DRIP: Defending Prompt Injection via Token-wise Representation Editing and Residual Instruction Fusion
  7. 2024AdaShield: Safeguarding Multimodal Large Language Models from Structure-based Attack via Adaptive Shield Prompting
  8. 2026CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering