Lion Cipher Lab

Stop LLM output from reaching a shell, path or HTML sink in a response playbook (deterministic stub model)

Why it matters

Response playbooks are starting to let a language model read an alert and fill in the next action: which host to isolate, where to save the evidence, what to show the analyst. Each of those values then lands in a SINK - a shell command, a file path, a web page - and the alert the model read was partly written by the attacker. OWASP lists this as LLM05, Improper Output Handling: the bug is not in the model, it is in code that trusts what the model returns. This lab makes it measurable. A deterministic stub model copies attacker text into its answer the way real models do, and three naive sinks…

What you'll learn

Steps in this lab

  1. The words first: LLM05, sinks, untrusted output, the three injections - and the fact that the model here is a stub
  2. Open a terminal and make a scratch folder (Windows, macOS, Linux)
  3. Build 300 alerts: honest ones, three kinds of injected text, and one kind that is perfectly well-formed
  4. Write the STUB model and read its whole error model: it never invents an attack, it only copies
  5. Write the three sinks, each the naive way and the safe way
  6. Measure before and after: attack success per sink, and false rejections on the legitimate outputs
  7. Read the results: why each fix works, and what each one costs
  8. The honest negatives: wrong-context escaping, a schema that changes nothing, and a valid hostname the attacker chose
  9. Why this, not that - and how this lab differs from its neighbours
  10. When NOT to let the model choose the value at all - and how a pro does it differently
  11. One experiment, then clean up

Open the full interactive lab →