Short answer
Decide how the work will be checked before the agent starts, check it with something the agent cannot change, and keep a person's approval in front of anything that is hard to undo. An agent's own report that it is done is a claim, not evidence.
Why isn't "the tests pass" enough?
An agent rewarded for passing tests can make them pass by changing the tests, skipping them or special-casing the inputs. The green check is real, but it no longer measures what you meant.
So the checks need to sit outside the agent's reach: tests it cannot edit, or edits to tests that a person reviews separately from the code.
What should be decided before the agent starts?
- What done means, written as checks: which commands must pass, which behaviour must change, what must not change.
- What the agent may touch: directories, commands and networks in scope.
- Which actions need approval: deleting, deploying, spending money, contacting people.
How do you check the result?
Split the result into what a machine can confirm and what needs judgment.
- Deterministic checks: builds, tests, type checks and lint, run by your pipeline rather than reported by the agent.
- Evidence: logs, screenshots, run artifacts and the exact commands the agent ran.
- Judgment: read the diff and the agent's reasoning for the decisions, not every line. Ask whether you could explain the change without the agent.
Where should a person stay in the loop?
Put approval in front of actions that are hard to undo, and enforce it in the system rather than in the prompt. A model asked to wait for approval can be talked out of it; a gate in the code cannot.
Everything else can run on its own, as long as it leaves a record you can review afterwards.