Skip to main content
DigiTransact AI Learning Centre

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.

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.

Tools granted to the assistant

2. Compare the outcome

Insecure assistant

Allowed

Secured assistant

Allowed

Control by control, for the same input
ControlInsecureSecured
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.

Where to go next