Case 01 / 09LLM securityCompleted
ZEROINJECT SHIELD.
Multi-LLM screening for prompt injection in a chat app.
A FastAPI middleware in front of a demo shop chatbot. An LLM first extracts the legitimate request from each message and blocks it outright if nothing legitimate remains. Three Groq-hosted verifiers (Llama 3.3 70B, Llama 3.1 8B and Qwen3 32B) then score the original text, their weighted consensus maps to BLOCK, SANITIZE or ALLOW, and rule-based overrides handle known attack phrases. Every decision is logged to SQLite and shown on a React dashboard.
What I built
- Built the FastAPI middleware: LLM sanitization, an early block when no legitimate request remains, and enforcement before the chatbot is ever called.
- Built the weighted three-model verifier ensemble on the Groq API and the threshold policy that turns its score into block, sanitize or allow.
- Added rule-based overrides with a re-check of sanitized text, and SQLite logging behind a React analytics dashboard.
▶Demo
See it work.
An animated walkthrough of the interface, not a screen recording. The scores and confidences shown are example values, not measurements.
01Architecture
How it's built.
Drawn from the project's source code, not its README: what each part actually does and how a request moves through it.
02Under the hood
How it works.
- 01
Sanitize
An LLM extracts the legitimate request; if none is left, the message is blocked
- 02
Verify
Three LLM verifiers score the original message
- 03
Consensus
Weighted score across the three (0.35, 0.40, 0.25)
- 04
Policy
0.70 or more blocks, 0.40 or more sanitizes, otherwise allow; rule overrides on top
- 05
Log
Every decision is written to SQLite for the dashboard