An ultra-low latency, multi-layer AI Security Gateway designed to protect LLM applications against prompt injections, system leaks, SQL injections, and PII exposure before hitting downstream LLMs.
- Sub-30ms Asynchronous Gateway: Uses fast-path regex validation & non-blocking execution routines.
- 5-Layer Defense-in-Depth:
- L1: Input & SQL Guard: Drops malicious SQL vectors instantly.
- L2: Vector Shield (ChromaDB): Semantic similarity detection for known threat vectors.
- L3: Jailbreak & System Prompt Leak Guard: Blocks DAN prompts & extraction attempts.
- L4: Scope Restriction: Restricts LLM responses strictly to domain parameters.
- L5: Output Scrubber: Redacts sensitive PII (Emails, Phones) in real time.
- Interactive Streamlit Sandbox: Real-time visual threat neutralization testing dashboard.
[Incoming Prompt] ──> [L1: SQL Guard] ──> [L2: Vector Shield] ──> [L3: Jailbreak Filter] │ [Sanitized Response] <── [L5: Output Scrubber] <── [LLM Processing] <───┘
git clone [https://github.com/Rehanguards/first_ai_guardrails.git](https://github.com/Rehanguards/first_ai_guardrails.git)
cd first_ai_guardrails
pip install -r requirements.txt