paper-with-me

Papers

Embedding-based classifiers can detect prompt injection attacks

2024-10-29 · Md. Ahsan Ayub, Subhabrata Majumdar

Large Language Models (LLMs) are seeing significant adoption in every type of organization due to their exceptional generative capabilities. However, LLMs are found to be vulnerable to various adversarial attacks, particularly prompt injection attacks, which trick them into producing harmful or inappropriate content. Adversaries execute such attacks by crafting malicious prompts to deceive the LLMs. In this paper, we propose a novel approach based on embedding-based Machine Learning (ML) classifiers to protect LLM-based applications against this severe threat. We leverage three commonly used embedding models to generate embeddings of malicious and benign prompts and utilize ML classifiers to predict whether an input prompt is malicious. Out of several traditional ML methods, we achieve the best performance with classifiers built using Random Forest and XGBoost. Our classifiers outperform state-of-the-art prompt injection classifiers available in open-source implementations, which use encoder-only neural networks.

📄 PDF Abstract BibTeX arXiv:2410.22284

Code (1)

AhsanAyub/malicious-prompt-detection 공식 구현

Similar Papers 제목 키워드 기반

Detecting Prompt Injection Attacks Against Application Using Classifiers

2025-12-14 · Safwan Shaheer, G. M. Refatul Islam, Mohammad Rafid Hamid, Md. Abrar Faiaz Khan 외 arxiv

Prompt injection attacks can compromise the security and stability of critical systems, from infrastructure to large web applications. This work curates and augments a prompt injection dataset based on the HackAPrompt Pl…

CourtGuard: A Local, Multiagent Prompt Injection Classifier

2025-10-20 · Isaac Wu, Michael Maslowski arxiv

As large language models (LLMs) become integrated into various sensitive applications, prompt injection, the use of prompting to induce harmful behaviors from LLMs, poses an ever increasing risk. Prompt injection attacks…

Zero-Shot Embedding Drift Detection: A Lightweight Defense Against Prompt Injections in LLMs

2026-01-18 · Anirudh Sekar, Mrinal Agarwal, Rachel Sharma, Akitsugu Tanaka 외 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…

When Benchmarks Lie: Evaluating Malicious Prompt Classifiers Under True Distribution Shift

2026-02-15 · Max Fomin arxiv

Detecting prompt injection and jailbreak attacks is critical for deploying LLM-based agents safely. As agents increasingly process untrusted data from emails, documents, tool outputs, and external APIs, robust attack det…

Maatphor: Automated Variant Analysis for Prompt Injection Attacks

2023-12-12 · Ahmed Salem, Andrew Paverd, Boris Köpf

Prompt injection has emerged as a serious security threat to large language models (LLMs). At present, the current best-practice for defending against newly-discovered prompt injection techniques is to add additional gua…