Zero-Shot Embedding Drift Detection: A Lightweight Defense Against Prompt Injections in LLMs
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Prompt injection attacks have become an increasing vulnerability for LLM applications, where adversarial prompts exploit indirect input channels such as emails or user-generated content to circumvent alignment safeguards and induce harmful or unintended outputs. Despite advances in alignment, even state-of-the-art LLMs remain broadly vulnerable to adversarial prompts, underscoring the urgent need for robust, productive, and generalizable detection mechanisms beyond inefficient, model-specific patches. In this work, we propose Zero-Shot Embedding Drift Detection (ZEDD), a lightweight, low-engineering-overhead framework that identifies both direct and indirect prompt injection attempts by quantifying semantic shifts in embedding space between benign and suspect inputs. ZEDD operates without requiring access to model internals, prior knowledge of attack types, or task-specific retraining, enabling efficient zero-shot deployment across diverse LLM architectures. Our method uses adversarial-clean prompt pairs and measures embedding drift via cosine similarity to capture subtle adversarial manipulations inherent to real-world injection attacks. To ensure robust evaluation, we assemble and re-annotate the comprehensive LLMail-Inject dataset spanning five injection categories derived from publicly available sources. Extensive experiments demonstrate that embedding drift is a robust and transferable signal, outperforming traditional methods in detection accuracy and operational efficiency. With greater than 93% accuracy in classifying prompt injections across model architectures like Llama 3, Qwen 2, and Mistral and a false positive rate of <3%, our approach offers a lightweight, scalable defense layer that integrates into existing LLM pipelines, addressing a critical gap in securing LLM-powered systems to withstand adaptive adversarial threats.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 15 of its 22 references that are in the map. First posted on arXiv 18 Jan 2026.
Builds on
15 of 22 references.
Closest ancestors · 8
Same direction, newest first
- 2025Detection Method for Prompt Injection by Integrating Pre-trained Model and Heuristic Feature Engineering5 Jun
- 2025A Critical Evaluation of Defenses against Prompt Injection Attacks23 May
- 2025Prompt Injection Detection and Mitigation via AI Multi-Agent NLP Frameworks14 Mar
- 2024Embedding-based classifiers can detect prompt injection attacks29 Oct
- 2024Systematically Analyzing Prompt Injection Vulnerabilities in Diverse LLM Architectures28 Oct
- 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Models21 Dec
- 2023Prompt Injection attack against LLM-integrated Applications8 Jun
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 7
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2016Bag of Tricks for Efficient Text Classificationcited by 869
- 2025Security Concerns for Large Language Models: A Surveycited by 26
- 2024Adversarial Attacks on Large Language Models Using Regularized Relaxationcited by 12
- 2024AI Alignment through Reinforcement Learning from Human Feedback? Contradictions and Limitationscited by 10
- 2022Nowhere to Hide: A Lightweight Unsupervised Detector against Adversarial Examplescited by 3
- 2024A Framework to Model ML Engineering Processescited by 1
Built on by
Citing papers per year: 2026: 2.
2 papers.