Lion Cipher Lab

Find secrets leaking into your LLM request logs with a gitleaks rule, and scrub them before they are stored

Why it matters

LLM apps log prompts and replies for debugging, cost tracking and evaluation. People paste whatever they are stuck on into a chat box, including API keys and configuration. The OWASP Top 10 for LLM applications lists sensitive information disclosure among its risks and names credentials as sensitive data, and recommends scrubbing and validating input. The log is the quiet place this goes wrong: nobody designed it to hold secrets, but it does. Finding them with a scanner and removing them before storage is a small control with a real effect.

What you'll learn

Steps in this lab

  1. Why the log is the risk
  2. Build a log with two made-up keys
  3. Write a custom gitleaks rule
  4. Scan the raw log and read the exit code
  5. Scrub the log before it is stored
  6. Prove it with a second scan
  7. What a pattern scrubber misses
  8. Clean up

Open the full interactive lab →

Keep learning