Level 4 companion lab
Prompt injection defence lab
Write or choose an attack, then watch the same input hit two assistants: one that trusts everything, and one built with layered controls. Every reason is shown.
Simulation only. Fictional organisation, fictional account, synthetic data. The lab runs entirely in your browser, sends nothing anywhere and cannot reach a real system. The account record shown is invented for teaching.
- Same input, two designsOnly the configuration differs.
- Reasons, not scoresEach verdict names the control.
- Ten controlsSee which ones fired.
- Audit trailWhat a log would record.
1. Build the test
Choose a scenario or edit the text. The document field stands for anything the assistant reads: an email, a supplier letter, a web page or a CV.
2. Compare the outcome
Insecure assistant
Allowed
Why this happened
Secured assistant
Allowed
Why this happened
| Control | Insecure | Secured |
|---|---|---|
| Instruction hierarchy | ||
| Input validation | ||
| Output validation | ||
| Least privilege | ||
| Tool permission restrictions | ||
| Sensitive data isolation | ||
| Human approval | ||
| Untrusted content handling | ||
| Security logging | ||
| Defence in depth |
3. Read the security log
A real system records decisions like these. Note that the secured assistant logs the refusal, not just the request.
Why no single prompt filter is enough
A keyword filter catches the wording it was written for. Change the wording and it misses. The layered configuration still refuses, because the limit is on what the assistant can do, not only on what it is asked.
Three lessons follow. First, a system prompt is guidance, not a boundary. Second, permissions and approvals contain an injection that gets through. Third, output validation catches what input controls miss. Read the full argument in Level 4, direct prompt injection and the LLM attack surface.