Free Interactive Tool
Prompt Injection Guard
Someone has already typed “ignore all previous instructions” into your chatbot. This tool scans user messages for the attack patterns your system needs to catch — identity overrides, jailbreaks, system prompt extraction — before they reach the model.
Interactive Tool · Chapter 8
Injection Guard Tester
5 regex patterns from src/api.py — scanned on every request before the RAG chain runs.
Safe examples
Injection attempts
Guard patterns
ignore previous instructionsClassic prompt injection attempting to override the system prompt.
ignore\s+(all\s+)?previous\s+instructionsyou are nowAttempts to redefine the assistant's identity or role.
you\s+are\s+nowact asAsks the model to roleplay as a different system without safety constraints.
act\s+assystem promptAttempts to extract or reference the hidden system instructions.
system\s+promptforget everythingTries to wipe the model's instruction context.
forget\s+(everything|all)Patterns run before the RAG chain. A match returns HTTP 400 immediately — the query never reaches ChromaDB or the LLM. Source: shopbot/src/api.py lines 76–87.
Book 1 · Chapter 8 — Hardening the Input Layer
Build a multi-layer injection defence for production RAG
Chapter 8 of The AI Engineer goes beyond regex guards — covering canary tokens, output validation, and the layered defence architecture ShopBot uses to prevent injected instructions from leaking into LLM responses.
Read Chapter 8 — Free →