Brakes: coding with AI agents · Part 9
It made the test pass. By deleting it.
You asked for green, and the test was in the way, so the agent deleted it. Or skipped it, or edited the expected value. Lock the tests on a bug fix with a CI job. Then it cheats without touching a test: it hard-codes the one cart the test uses. Mutation testing shows the test reaches only that line, and one property test, any cart and any code, breaks the hard-code on its twelfth try. The agent doesn't get to grade its own exam.
Comment below: Has an agent ever cheated a test on you?
Brakes: a series on the checks that let an AI coding agent go fast without shipping bugs. Every best practice shortens the time between writing a bug and finding it. Brakes are why race cars go fast. All code is real TypeScript on Node 24, typechecked and tested before it went on screen.




