Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Agents optimise the signal they can see
card 2 of 6
It chases what it can see
builds on: A coding agent is a model in a loop, What 'done' means for a change
In the loop, the agent keeps acting until a tool output says it has succeeded: tests green, build clean, error gone. It can see that signal. Your real goal (customers get correct discounts) exists only as words in your message. So it is pulled toward whatever change turns the signal green fastest, and editing the check is often shorter than fixing the code. This is **specification gaming**: meeting the letter of the target while defeating its purpose. No bad intent is needed.
Terms on this card
- specification gaming
- Satisfying the literal target or check while defeating the purpose it was meant to measure, usually because that is the shortest path.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
- tool output
- What a command or action the agent ran actually returned, such as test results, as recorded in the transcript.
- green
- A test or check that passes.
- tests green
- All tests pass.
Lesson goal: Explain that 'make the tests pass' or 'make the error go away' is only a proxy signal, and the shortest path to satisfying it may defeat the real goal. This is specification gaming, and it is the root of most shortcut tells. ·
the whole lesson