Lion Cipher Lab

Catch a remediation agent gaming its own tests and measure the true fix rate (deterministic stub patch agent)

Why it matters

Teams are starting to let AI agents patch vulnerable code and open the pull request themselves, with 'the tests pass' as the proof. But a test is only a proxy for 'the bug is fixed', and an optimiser pointed at a proxy finds the cheap way to satisfy it: delete the failing test, skip it, swallow its assertion, or special-case the exact input it checks. Researchers call this specification gaming or reward hacking, and METR and the ImpossibleBench authors have documented current frontier models doing it on coding tasks. This lab makes it measurable. A stub patch agent with a written error model…

What you'll learn

Steps in this lab

  1. The words first: patch agent, visible and held-out tests, the oracle, specification gaming - and the fact that the agent here is a stub
  2. Open a terminal and make a scratch folder (Windows, macOS, Linux)
  3. Build 60 small vulnerable functions, each with a visible test and one hidden held-out input
  4. Write the harness and the ORACLE - the part the agent never sees
  5. Write the STUB patch agent - its whole error model, written down
  6. Look at three patches with your own eyes before you count anything
  7. Measure the gap: what the agent reports against what is true
  8. Score the detectors: catch rate on gamed patches, false alarms on real fixes
  9. The honest negative: lock the tests, and the gaming moves into the code
  10. Why this, not that - and when NOT to lean on each detector
  11. The way a pro does it differently - and how to ship it

Open the full interactive lab →