Back to Search View Original Cite This Article

Abstract

<jats:p>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 conditionally invokes external LLM reasoning only for prompts assessed as non-sensitive. This design prevents confidential data from transiting third-party inference infrastructure, directly addressing documented risks of training-time memorisation and inference-time data retention in externally hosted models. Empirical evaluation across 120 prompts spanning nine attack categories demonstrates that the external LLM achieves the highest standalone detection accuracy (99.17%, F1 99.37%), while the rule-based engine offers near-instantaneous response (0.1 ms) with perfect precision but limited recall (13.75%). The hybrid architecture reconciles these trade-offs: sensitive prompts are processed locally with zero external data transmission, while non-sensitive inputs can leverage full LLM reasoning capability. The framework is model-agnostic, requires no retraining of the underlying LLM, and is compatible with black-box API deployments. A balanced evaluation dataset spanning benign, sensitive, and jailbreak categories has been released publicly to support reproducibility.</jats:p>

Show More

Keywords

data architecture while detection external

Related Articles

PORE

About

Connect