Lion Cipher Lab

Turn prompt-injection attempts into a promptfoo test suite that runs on every change

Why it matters

Teams red-team an LLM feature once, fix what they find, and move on. Then someone tweaks the prompt, swaps the model for a cheaper one or adds a feature, and the old hole quietly reopens. Security findings only stay fixed when they become tests that run on every change, which is how ordinary software has worked for decades. promptfoo is a widely used open-source tool for testing LLM apps: you describe the prompt, the model and the test cases in one file, and it tells you which cases fail. In this lab the app has one job and one secret, a discount code it must never reveal, and you turn a…

What you'll learn

Steps in this lab

  1. The idea: a finding is only fixed if a test keeps it fixed
  2. Get a free local model running
  3. Write the app under test: a support bot with a secret
  4. Write the suite: one normal question and six attacks
  5. Run it and read the matrix
  6. Catch the leak that only happens sometimes
  7. Try the obvious fix, and measure it
  8. Make it part of every change, and know its limits

Open the full interactive lab →

Keep learning