My prompt-injection firewall showed a perfect 9/9 score. It was fake.

Wait 5 sec.

Learning project, would love feedback. Stack: regex rules -> Gemini classifier (JSON + Pydantic + retries, fail-closed) -> output check (canary, secret patterns, 8-word system-prompt match) Data: 25 cases from deepset/prompt-injections + 12 output cases I wrote with AI help. Results - Rules only: 2/9 attacks caught - Rules + Gemini: 8/9 dev, 0/6 false positives - Hidden: 3/3 caught, 0/7 false positives (only 3 attacks, so weak evidence) Things that went wrong 💀 - Wrong model name -> every call 400'd -> fail-closed blocked everything -> fake perfect score - Output check flagged the bot's own intro as a "leak" (6-word overlap). Only found it by running on real bot answers - One "attack" in the dataset ("generate c++") looks like a label error Limits: tiny data, self-written output tests, no paraphrase/base64 leak detection. Demo: https://prompt-injection-firewall.streamlit.app Code + changelog: https://github.com/ztsprofessionalaiid7-alt/prompt-injection-firewall Q: what would you add to the test set? Is an 8-word match a sane way to catch system-prompt leaks?   submitted by   /u/ZtasnimS75 [link]   [comments]