Lion Cipher Lab

Lock down a coding agent with permission rules before it touches your repo: protect .env and block destructive commands

Why it matters

A coding agent is a program that reads your files and runs shell commands on your behalf, guided by text it reads along the way: your prompt, but also README files, issues, web pages and tool output. If any of that text is hostile or just confusing, the agent can be steered into reading a secrets file, deleting a folder or pushing code. OWASP calls the underlying problem Excessive Agency: damaging actions taken in response to unexpected or manipulated model output, whatever caused the malfunction. You cannot fix that by asking the model nicely. Claude Code's own docs make the point:…

What you'll learn

Steps in this lab

  1. What can go wrong, and where the controls sit
  2. Install Claude Code, or use the free local route
  3. Build a throwaway repo with a fake .env
  4. Learn the rule order before you write any rules
  5. Write the permission rules
  6. Write two hooks and test them with no model at all
  7. Start a session and confirm the rules loaded
  8. Test every rule and write down what happened
  9. Know what these controls do not cover
  10. The same idea for any coding agent
  11. Clean up

Open the full interactive lab →

Keep learning