Skip to content
safran

Blog

“Done” is not the agent’s call

An unattended coding agent should never be the one to decide that its work is finished. The layers that decide instead, and what is left for a person.

5 min readAgentsEngineering

On the system that Safran’s unattended jobs were ported from, one reviewing agent looked at one change several times. From one run to the next it found between none and half of the known defects. Nothing had changed but the run.

Keep that in mind when someone says “another agent reviews it”. An agent that works while you watch can be wrong cheaply: you see the wrong turn and you say so. An agent that works through a queue of tickets overnight has nobody to say so, and the only voice left in the room is its own. That voice says “done” at the end of every session, whether or not the work is. If you are deciding whether unattended agents belong on real tickets, the first question is who gets to say that a job is finished. How good the agent is comes second.

The worker is the worst-placed judge

The session that wrote a change is the one most convinced by it. It read the ticket one way, built on that reading, and then checked the result against the same reading. Its report is fluent and specific, and it tells you nothing independent: every sentence in it was produced by the thing being evaluated.

This is the reason a team does not let an author approve their own pull request, and it applies to people as much as to models. The difference is that a person who says “tests pass” has usually run them, and feels it when they are caught not having done so. An agent’s claim costs it nothing. So treat the claim as what it is: a list of things to verify, written by an interested party.

The practical consequence is a rule about how the process is built. You cannot instruct an agent into being a reliable judge of itself. You can only arrange things so that its opinion is not the one that counts.

What decides instead

In Safran’s unattended jobs, the process that runs the job decides. A finished session hands back a structured result: each requirement, how it was verified, and the evidence. Then four layers look at the work, in order, and stop at the first that refuses.

The project’s own checks. The commands your team already trusts (the type check, the tests, the linter) are run by the process itself, on the job’s own copy of the repository. “The agent says it ran them” is not the same thing.

An audit of the diff. Some ways of making checks pass are visible in the change itself: a test that was skipped or narrowed to a single case, a type check that was silenced, a test file that was deleted. These are looked for by rule, with no model involved.

Evidence. Every requirement the agent calls met has to say how it was verified and point at a file that exists. This check is mechanical and limited: it knows that the file is there, and it does not know what the file shows.

An independent review. A fresh session that cannot edit anything works out the requirements from the ticket itself, tries each one, and reads the diff. A review that returns nothing is treated as a failure. Silence is never approval.

Whatever a layer refuses goes back into the worker’s own session, for a bounded number of fix rounds. After a fix, everything runs again.

A second model is a net

The observation at the top of this post orders the layers. The deterministic ones come first and carry the weight: a check passes or it does not, and it gives the same answer tomorrow. The review comes last and catches what rules cannot describe, some of the time. It is a net. The proof is your project’s own checks. If they are weak, no reviewing agent will make “done” mean much, and the right investment is the test suite.

The same reasoning tells you which layers to keep. Each time a layer sends a job back, the layer is recorded. A layer that never sends anything back is costing time for nothing, or is not looking. A review that sends back half of the jobs is doing its work. Read that record before adding a check, and before removing one.

What reaches a person

None of this would matter if the result were a wall of green ticks for someone to skim. What should reach you is the remainder: what nobody independent confirmed. In an unattended job that is three kinds of thing: requirements that neither the agent nor the review could verify, places where the agent decided to depart from the request, and the decisions it made for you where the request was open.

That list is short for a good job and long for a vague ticket, which is as it should be. You approve, or you send the job back with a note, and the next session starts from that note. The job itself ends as a local branch and a drafted pull request text. Nothing is pushed and no pull request is opened; that step stays with a person.

What to do with this

Before you let an agent work unattended, write down who says “done” for each kind of claim. Tests pass: who ran them? Nothing was skipped: who looked at the diff? The requirement is met: where is the evidence, and who else derived the requirement from the ticket? Wherever the answer is “the agent that did the work”, you have found a gap. Close the gaps with deterministic checks first, add a second reader last, and make sure that what a person sees is the list of what is still unconfirmed.

If you want this arranged around your own checks, that is what a pilot sets up.