Lion Cipher Lab

Measure and defend against many-shot jailbreaking (the power-law attack on your context window)

Why it matters

Almost everything written about LLM attacks is about a string — a clever sentence you filter, sanitize or block. Many-shot jailbreaking is not that, and confusing the two is why teams ship defenses that measure well and fail in production. In MSJ the attacker pastes a long fabricated transcript into a single prompt: dozens or hundreds of made-up exchanges in which a supposed assistant cheerfully does the thing your assistant is supposed to refuse, followed by a final request that, read on its own, is completely unremarkable. Nothing in that final request trips a keyword filter, because the…

What you'll learn

Steps in this lab

  1. What many-shot jailbreaking is — and why it is not just another injection string
  2. Open a terminal and check Python (zero-assumption setup)
  3. Why the model is a STUB — and the last three words you need (ASR, power law, intercept vs slope)
  4. Write the full program
  5. Run it and read the shot-count sweep — see the power law with your own eyes
  6. Defense 1 — the refusal-keyword filter, and the cleanest failure in LLM security
  7. Defense 2 — cap the context, then price what you just broke
  8. Defense 3 — classify and modify the prompt: the intercept moves, the slope does not
  9. Defense 4 — role integrity: the assistant role is a trust boundary
  10. Named failure modes — write these down before you design anything
  11. Judgment: when a cap is right, when it is product vandalism, and how a pro does it
  12. Optional appendix (not graded): point the same harness at a real local model

Open the full interactive lab →