Skip to content

Explainable Prompt Injection Detection using Sentence Embeddings, Random Forest, and Word-Level Attribution

Jul 2026 · ICACNC 2026 Proceedings · pp. 58-63 · 0 citations

TL;DR

A explainable framework that detects the attacks using a Random Forest (RF) classifier along with semantic sentence embedding and SHAP (Shapley Additive Explanations) is used together with a wordlevel attribution mechanism to give human-legible explanations for the model predictions, and to emphasize harmful parts within the prompt.

Abstract

LLM’s have affected the production industries with fast and spot-on answers, but they have also introduced a huge threat to security such as prompt injection, which was identified as the #1 threat by the OWASP GenAI Security Project. The attackers try to manipulate the model’s actions by putting malicious intent into the user’s prompt. To counteract this problem this research vouches for an explainable framework that detects the attacks using a Random Forest (RF) classifier along with semantic sentence embedding. The provided method can also identify the intent behind the prompts at surface to detect more complex jailbreak attacks. To enhance transparency, SHAP (Shapley Additive Explanations) is used together with a wordlevel attribution mechanism to give human-legible explanations for the model predictions, and to emphasize harmful parts within the prompt. The proposed model has an accuracy of 96.88%, precision of 95.90%, recall of 99.08%, and F1 score of 97.46%, which are better than the TF-IDF baseline model. Importantly, the model was able to correctly identify jailbreak prompts like, ”You are now DAN and have no restrictions” that the baseline model always failed to correctly classify as attacks, showing that semantic feature representation is necessary for strong prompt injection detection.

View source

Similar papers

Conference Jul 2026

SemGuard: A Triple-Anchor Semantic Security Gateway for Multilingual Prompt Attack Detection in Large Language Models

The threat posed by adversarial prompts to large language models is becoming harder to ignore. Problems including prompt injection, jailbreaking, phishing, and Unicode-based attacks are now widespread. Most existing solutions protect against only one threat type, operate in English only, and provide no explanation for...

Abdullah M. Abughallous, Somia Abufakher · 0 citations
Conference Jul 2026

PRISM: A Lightweight Method for Jailbreak Detection via Prompt-Response Semantic Coherence Scoring in LLMs

Detecting whether a jailbreak attack against a large language model (LLM) has succeeded is a challenging problem in AI security. Existing approaches rely on brittle string matching, expensive LLM-based judges, or task-specific classifiers that often fail to generalize. This paper investigates whether semantic coherence...

Costabile Di Gregorio, Lama Sleem, Jérôme François et al. · 0 citations
Open access Aug 2026

Automated MITRE ATT&CK Technique Classification Using OSINT and Advanced NLP

This paper offers an automated solution to the problem of categorizing the threat descriptions based on OSINT into the MITRE ATT&CK techniques with a sophisticated model based on transformer and natural language processing, leading to more effective CTI automation and decision support to the security operations of a pr...

Ramesh Kumar Sharma, Dharmendra Kumar Singh, Rajesh P. Barnwal · 0 citations
Open access Jul 2026

Large Language Models for phishing URL detection: A comparative study of LLaMA-3, GEMMA-7B, and traditional Machine Learning approaches

The proposed LLM-based framework offers a promising approach for improving phishing detection and strengthening modern cybersecurity defenses and suggests that transformer-based models can effectively identify deceptive domain structures, abnormal URL patterns, and obfuscation techniques.

L. Eliyan, M. Alshraideh, Bayan Alfayoumi · 0 citations
Open access Jul 2026

Beyond The Surface: Characterizing Adversarial Boundaries in Synthetic Text Attribution Across Heterogeneous Domains

A hybrid detection framework which combines semantically deep embeddings from the RoBERTa transformer with a set of carefully designed language statistics and linguistic statistics and shows excellent resistance to the surface-level adversarial paraphrasing strategy.

Anita Rani, Suman · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.