A lightweight and explainable framework for prompt injection detection in AI applications

Large language models (LLMs) are increasingly embedded in chatbots, document assistants, retrieval-augmented generation (RAG) pipelines, and tool-using applications. These systems may interpret untrusted user or retrieved text as instructions, creating a prompt-injection risk. A practical detector must identify attempts to redirect model behaviour while allowing harmless security explanations, quotations, and ordinary instructions. This paper proposes a lightweight and explainable text-screening framework based on word- and character-level TF-IDF features, classical machine-learning classifiers, and a transparent rule-based baseline. The study compares Logistic Regression, linear Support Vector Machines, and a combined word-character model under source-separated evaluation. Particular attention is given to hard-benign inputs, controlled obfuscation, duplicate leakage, calibration, and inference cost. Candidate data sources include public prompt-injection examples, NotInject-related resources, and context-rich benchmark materials, subject to access, label, overlap, and licence checks. The framework returns a risk estimate, a concise evidence summary, and a review recommendation for uncertain inputs. It is intended as a screening layer, not a replacement for instruction separation, access control, least privilege, or human approval. Since implementation and testing are proposed work, no accuracy or performance improvement is claimed in advance. The intended contribution is a reproducible low-compute evaluation of when compact detectors are useful, where they over-block benign text, and how reliably their behaviour transfers to unseen sources.

Authors

Publication Details

Journal
International Journal of Innovative Research in Engineering
Published
2026-10-27
DOI
https://doi.org/10.59256/ijire.20260705014
Primary Topic
Adversarial Robustness in Machine Learning
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A lightweight and explainable framework for prompt injection detection in AI applications

Vaibhav Vats, Kumar Vaibhav
International Journal of Innovative Research in Engineering
Adversarial Robustness in Machine Learning
article

A lightweight and explainable framework for prompt injection detection in AI applications

Vaibhav Vats, Kumar Vaibhav
article en

Abstract

Large language models (LLMs) are increasingly embedded in chatbots, document assistants, retrieval-augmented generation (RAG) pipelines, and tool-using applications. These systems may interpret untrusted user or retrieved text as instructions, creating a prompt-injection risk. A practical detector must identify attempts to redirect model behaviour while allowing harmless security explanations, quotations, and ordinary instructions. This paper proposes a lightweight and explainable text-screening framework based on word- and character-level TF-IDF features, classical machine-learning classifiers, and a transparent rule-based baseline. The study compares Logistic Regression, linear Support Vector Machines, and a combined word-character model under source-separated evaluation. Particular attention is given to hard-benign inputs, controlled obfuscation, duplicate leakage, calibration, and inference cost. Candidate data sources include public prompt-injection examples, NotInject-related resources, and context-rich benchmark materials, subject to access, label, overlap, and licence checks. The framework returns a risk estimate, a concise evidence summary, and a review recommendation for uncertain inputs. It is intended as a screening layer, not a replacement for instruction separation, access control, least privilege, or human approval. Since implementation and testing are proposed work, no accuracy or performance improvement is claimed in advance. The intended contribution is a reproducible low-compute evaluation of when compact detectors are useful, where they over-block benign text, and how reliably their behaviour transfers to unseen sources.

International Journal of Innovative Research in EngineeringVol. 7(5)
Openalex Percentile: Top 13%
Adversarial Robustness in Machine Learning
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon