Lion Cipher Lab
Find secrets leaking into your LLM request logs with a gitleaks rule, and scrub them before they are stored
- AI Security
- Beginner
- ~35 min
- Free · no account required
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
- explaining why prompt logs become a store of other people's secrets
- writing a custom gitleaks rule with a regex and keywords
- scanning a log file with gitleaks and reading its exit code
- scrubbing secrets before a log line is written, and proving it with a second scan
- stating what a pattern-based scrubber misses
Steps in this lab
- Why the log is the risk
- Build a log with two made-up keys
- Write a custom gitleaks rule
- Scan the raw log and read the exit code
- Scrub the log before it is stored
- Prove it with a second scan
- What a pattern scrubber misses
- Clean up
Open the full interactive lab →