Skip to content

DEFENSE-IN-DEPTH FOR LARGE LANGUAGE MODELS: A MULTI-LAYER HYBRID ARCHITECTURE FOR PROMPT INJECTION DETECTION

Jul 2026 · 2022-yil 3-son (133/1) ANIQ FANLAR SERIYASI · Vol 2, pp. 207-216 · 0 citations

TL;DR

A layered hybrid defense gateway that combines three complementary detectors: a fast prefilter based on lexical rules, a semantic classifier that uses word-level TF-IDF features together with a multilayer perceptron, and a character-level classifier that is robust to obfuscation is proposed.

Abstract

Large language models (LLMs) are now embedded in many digital systems, which has exposed a new and distinctive attack surface. The most pressing threat is the prompt injection attack, in which adversarial text causes a model to ignore its developer-defined instructions, leak its hidden system prompt, or perform unintended actions. This paper proposes a layered hybrid defense gateway that combines three complementary detectors: a fast prefilter based on lexical rules, a semantic classifier that uses word-level TF-IDF features together with a multilayer perceptron, and a character-level classifier that is robust to obfuscation. Their outputs are merged by a lightweight meta-decision block based on logistic regression. In a fully reproducible experiment, the detectors are trained on clean and standard obfuscated attacks and evaluated on held-out data that additionally contains unseen, newly phrased attacks and an unseen adaptive obfuscation style. On this controlled benchmark the proposed hybrid system reaches an F1 score of 0.989 and the lowest false-positive rate among all compared systems, clearly outperforming a brittle rule-based baseline (F1 = 0.504) and every single classifier across all attack categories. An ablation study confirms that each layer covers a distinct class of attacks, empirically supporting the defense-in-depth principle.

View source

Similar papers

Open access Aug 2026

Real-Time Detection and Mitigation of Prompt Injection Attacks in LLM-Integrated Enterprise Systems

Large language models (LLMs) embedded in enterprise workflows cannot structurally distinguish legitimate instructions from adversarial ones in the same token stream, making prompt injection OWASP's top LLM risk for two consecutive editions a persistent threat across direct and indirect vectors. This paper presents Prom...

Fatimah Alhamzawi · 0 citations
Open access Dec 2025

AI security beyond core domains: resume screening as a case study of adversarial vulnerabilities in specialized LLM applications

A benchmark for this vulnerability in LLM-based resume screening is introduced: 463 job-candidate pairs drawn from a 14-domain corpus, with the evaluated sample covering 13 domains, attacked through a taxonomy of four attack types and four injection positions.

Hong-Lin Mu, Jinghao Liu, Kai-Yang Wan et al. · 4 citations · ⚡1
Conference Open access Sep 2026

BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling

BERM is introduced, a lightweight framework that performs in-situ detection by modeling a host LLM’s internal representations extracted during prefill, adding negligible overhead and reducing incremental inference overhead to near-zero.

Maihao Guo, Chaoyang Zhao, Jin-Qiao Wang · 0 citations
Review Open access Aug 2026

Recent Advances and Open Challenges in Mitigating Inference-Time Attacks on Large Language Models

A defense taxonomy spanning three axes, namely prompt-level, inference-time, and training-time interventions, is proposed, within which 30 mitigation mechanisms published from 2024 onwards are systematically analyzed, demonstrating that no single defense mechanism provides comprehensive protection, and that robust depl...

Berkay Ozcam, Mustafa Kara, Muhammet Ali Aydin et al. · 0 citations
Conference Jul 2026

VectorSec: A Web-Based AI Security Scanner for Systematic Evaluation of LLM Vulnerabilities

The increasing deployment of Large Language Models (LLMs) in critical infrastructure has introduced a class of security risks that remain insufficiently characterised and poorly tooled in practice. Attack vectors including prompt injection, jailbreaking, code execution facilitation, covert data exfiltration, and traini...

M. Yamin · 0 citations
Preprint Aug 2026

Robust Context-Aware Detection of Malicious Instructions in Text

The proposed approach for malicious sentence classification that is both context- and query-aware and outperforms state-of-the-art IPI defense baselines under static attacks, while in the case of adaptive attacks, the AT variants provide significantly higher utility, lower attack success rate, and often both.

Buzhao Liu, Xinhang Ma, Yevgeniy Vorobeychik · 1 citation

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