Skip to main content

How should an agent decide that a task is finished? Use this case: it is asked to update 30 product descriptions, updates 12, and reports that the work is complete.

Agents and tools · Intermediate 3

Short answer

The model's own feeling of being done is not reliable. The task needs explicit completion criteria, a tracked list of items, and a check against the real state before the agent may stop. Here the harness should hold a checklist of 30 products, and code should verify that all 30 were changed. If it cannot finish, it should say so.

Deeper answer

Agents stop early for a few reasons. The goal was vague, so partial work looks complete. The list of remaining items fell out of context after many tool results. Or the model writes a confident summary of the plan and not of what happened. None of these is fixed by telling the model to try harder.

The fix is to move the definition of done outside the model. Write the acceptance criteria into the task. Keep progress in a structured to-do list or a file that the agent updates and re-reads. Before the final answer, run a check in code or with a separate verifier: query the catalogue and count the updated rows. Give the agent an honest exit too, such as a status of partial with the reason, so it does not claim success to end the run. Interviewers listen for verification against real state, not against the agent's own report.

What a strong answer covers

Answer it out loud in the mock interview about 2 min

Follow-ups to expect

Common mistakes

Learn it

The agent loop

Practice Agents and tools questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.