Skip to content
Open access

A Privacy-Preserving Middleware Architecture for Detecting Prompt Injection and Sensitive Data Exposure in Large-Language-Model Interactions

Aug 2026 · Electronics · 0 citations · 9 references

TL;DR

A privacy-preserving hybrid middleware architecture that enforces a local trust boundary as its primary design constraint that is model-agnostic, requires no retraining of the underlying LLM, and is compatible with black-box API deployments is proposed and evaluated.

Abstract

The deployment of large language models (LLMs) in real-world applications introduces a compounding security problem: detecting adversarial inputs such as prompt injection and jailbreak-driven data leakage while simultaneously preventing the detection mechanism itself from becoming a source of data exposure. Existing approaches address either detection effectiveness or privacy preservation, but rarely both in a unified, deployable architecture. This paper proposes and evaluates a privacy-preserving hybrid middleware architecture that enforces a local trust boundary as its primary design constraint. The architecture combines deterministic rule-based screening, a fine-tuned small language model (SLM) operating entirely within the local processing environment, and a sensitivity-aware routing mechanism that invokes external LLM reasoning only for prompts all local components have assessed as non-sensitive. Evaluation on a 120-prompt benchmark spanning benign, jailbreak, and sensitive categories (including 20 hard negatives constructed to be lexically adjacent to genuine secrets) shows that the routed architecture attains 95.83% accuracy with complete recall, retaining 95% of sensitive prompts within the local boundary, at the cost of a 12.5% false-positive rate. Comparison against two published detectors reveals a systematic asymmetry: an injection-specific classifier reaches 82.5% recall on jailbreak prompts but 25% on sensitive ones, while a content-safety model inverts that profile, confirming empirically that the two risks are addressed separately by current tooling. The framework is model-agnostic, requires no retraining of the underlying LLM, and is compatible with black-box API deployments. The evaluation dataset and fine-tuned model are released publicly.

Read PDF

Similar papers

Jul 2026

Multi-Agent Firewall Architecture for Privacy Protection of Sensitive Data in Interactions with Language Models

An open-source, privacy-focused, user-facing firewall designed to secure both web-based and programmatic LLM interactions and its layered architecture enables deployment across heterogeneous environments, allowing organizations to balance computational cost, detection depth and latency.

Hugo Garc'ia Cuesta, Pablo Mateo Torrej'on, Alfonso Sánchez-Macián · 0 citations
Conference Jul 2026

A Privacy-Respecting, Modular, Vendor-Neutral Natural-Language Interface for Operating Systems

This paper presents OS-NLI, a privacy-respecting and modular natural-language interface for operating-system tasks. Unlike vendor-bound assistants, OS-NLI separates intent interpretation from command execution through an architecture comprising a web interface, a retrieval-augmented generation (RAG) layer, an API, an e...

David Lawrence, Xiaoli Huan · 0 citations
Conference Jul 2026

A Local Middleware for Privacy-Preserving LLM Inference via Reversible Entity Substitution

Large Language Models (LLMs) such as ChatGPT, Gemini, Claude, etc. have become integral tools for technical writing, software development, and communication. However, these systems, despite privacy assurances, still expose a significant privacy risk. User prompts often contain personally identifiable or proprietary inf...

Aditya Vishwakarma, Wencen Wu · 0 citations
Open access Aug 2026

SecureMCP: Policy-Enforced Defense Against Prompt Injection in LLM-Generated SQL for AIoT Databases

This paper proposes SecureMCP, a policy-enforced framework that integrates Role-Based Access Control with an MCP server to establish multi-layer defense for LLM-generated SQL execution, and evaluates filter performance—false positive rate (FPR) and false negative rate (FNR))—separately from LLM generation quality.

Wonbae Kim, Hee-Kyong Yoo, Nammee Moon · 0 citations
Jul 2026

Isolated but Exposed: Persistence-Based Memory Extraction Attack on LLM Agents

The first extraction attack designed for this threat model, SPORE decouples the adversarial command from retrieval anchors by persisting the command in short-term memory and emitting semantically pure anchors in tool responses, demonstrating that memory isolation alone is insufficient and call for reexamining tool-side...

Xinyu Gao, Wenyu Chen, Xiangtao Meng et al. · 1 citation
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

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