The last defence is simple. If the agent can read the exam, the exam stops measuring anything. So keep some of it where the agent can't reach.
Holdout scenario
Also called Hidden scenario, Holdout
A test of what the software should do, kept where the agent can't read it or change it. The agent is judged on it afterwards, so it can't fit its work to it.
Everything else in this chapter can be seen and so optimised for. A holdout can't. It also catches a different class of failure: tests that are strong, and code that is consistent, but a job nobody asked for properly.
“Do not read anything under ../acceptance/. When you think you are done, I will run those scenarios and tell you which ones failed and what they expected, without showing you the code. Fix the behaviour, and do not guess at the tests.”