Lion Cipher Lab

Defend an LLM Service Against Unbounded Consumption (Denial-of-Wallet)

Why it matters

Put a language model behind an endpoint and you have quietly signed up for a bill that scales with whatever your callers send. That is the risk OWASP's 2025 Top 10 for LLM Applications lists as LLM10, Unbounded Consumption, and it is the one most teams discover from an invoice rather than a pentest. The dangerous part is that it needs NO jailbreak and no clever prompt -- an attacker (or a buggy client, or one enthusiastic user) simply exploits the fact that model cost and latency scale with tokens, and a naive service caps neither. There are several ways in and they compound. A GIANT CONTEXT:…

What you'll learn

Steps in this lab

  1. The attack, in one breath (OWASP LLM10)
  2. Set up: offline, key-free, deterministic
  3. Build the cost model (costmodel.py)
  4. Build the attack corpus and MEASURE the amplification (attack.py)
  5. Why 'just add rate limiting' does not save you
  6. Build the layered, deny-by-default guard and re-measure (defend.py)
  7. Read the bounded numbers: which control did which job
  8. Judgment: Denial-of-Wallet vs latency-DoS, and the tradeoff you are choosing
  9. What you built -- and the one sentence to keep

Open the full interactive lab →