An enterprise-grade, multi-layered security gateway designed to intercept, analyze, and mitigate prompt-injection attacks against Large Language Models (LLMs).
Prompt Injection Detection Engine (PIDE) is a high-performance security layer built to safeguard LLM applications from malicious prompt manipulation. Moving beyond single-point validation, PIDE executes a robust, multi-tier pipeline incorporating a lightning-fast rule-based Layer 1 regex engine, embedding similarity checks, heuristic analysis, and dynamic risk scoring.
| Layer / Module | Mechanism & Logic | Objective |
|---|---|---|
| Layer 1 | Rule-Based Regex Engine | Instant pattern matching for known injection signatures ($O(N)$). |
| Layer 2 | Embedding Similarity & FAISS | Vector-space semantic distance analysis against known malicious exemplars. |
| Layer 3 | Heuristic & Risk Scoring | Behavioral weighting and dynamic multi-variable scoring thresholds. |
| API Gateway | FastAPI REST Gateway | Low-latency asynchronous request handling and secure wrapper integration. |
| Playground UI | Gradio Interactive Interface | Real-time monitoring, live auditing, and payload testing dashboard. |
git clone [https://github.com/AyeshaaRafaqat/Prompt-Injection-Detection-Engine.git](https://github.com/AyeshaaRafaqat/Prompt-Injection-Detection-Engine.git)
cd Prompt-Injection-Detection-Engine


