Single-Layer LLM Guardrails Fail: 390 Prompt Injection Tests
summary
A 390‑prompt evaluation (172 single‑turn attacks, 18 multi‑turn attacks, 200 legitimate prompts) shows a single-layer guardrail with keyword rules catches 22.6% of attacks (F1 0.368), catching 43 of 190 attacks, missing 147 and producing 1 false alarm, while a semantic intent classifier that reads up to five prior turns detects 96.8% (F1 0.984), catching 184, missing 6, and producing zero false alarms. Three structural failures of one‑message filters motivate a five-layer architecture (fast <100 ms layer one filter, layer two semantic check, audit log, DynamoDB, tool authorization, output checks, human gate). An evaluation error from API throttling is noted and corrected.
AI-written summary · about
chapters (13)
- 0:00Introduction and the Single-Guardrail Problem
- 1:09Why One Filter Misses Attacks
- 2:27The 390-Prompt Test Set
- 3:58Four Detection Approaches Compared
- 6:05Results: Keyword vs Semantic Classifier
- 7:52Three Structural Limits of Single Layers
- 9:04Dual Detection Architecture
- 10:36Inside the Layer Two Classifier
- 12:10Four Example Requests
- 14:02Raw Counts and False Alarms
- 15:39My Evaluation Mistake
- 18:42Five-Layer Architecture for Agents
- 20:19Key Takeaways and Resources
