Lion Cipher Lab
Run a prompt-injection regression suite in CI with Inspect and fail the build when the defence slips
- AI Security
- Advanced
- ~75 min
- Free · no account required
Why it matters
A system prompt that says never reveal this is a hope, not a control. Models change, prompts get edited, and a defence that held last month can quietly stop holding. OWASP's guidance on prompt injection includes regular adversarial testing and attack simulations, and the practical form of that for a small team is a test that runs on every change and fails the build when the defence slips. This lab builds the smallest honest version: ten benign extraction attempts, a secret that can be detected, a pass rate, and a gate.
What you'll learn
- planting a canary string in your own system prompt as a testable secret
- writing a custom Inspect scorer that passes when a secret does not leak
- catching leaks in disguise, such as reversed or base64 text
- turning a pass rate into a CI gate with a threshold and a drop limit
- wiring the gate into a GitHub Actions workflow
Steps in this lab
- A defence you do not test is a hope
- Set up Inspect and a local model
- Write the suite: a canary, ten attacks and a scorer
- Run it and read the result
- Turn the pass rate into a gate
- Strengthen the prompt and watch the number move
- Put it in CI
- What a green build does and does not mean
- Clean up
Open the full interactive lab →