How to Verify an AI Agent Really Finished the Job
In this article
This guide shows you how to confirm that an AI agent—whether it’s a coding assistant, a research bot, or a data-processing pipeline—has actually completed the task you assigned, not just claimed it did. You’ll learn concrete verification steps, common failure points, and what to do when the agent’s output doesn’t match reality. No special tools are required, but you’ll need access to the agent’s logs or output files and a clear understanding of what “done” means for your specific task.
What You'll Need
- The original task description or prompt you gave the agent
- Access to the agent’s output (files, database entries, API responses, or a chat transcript)
- If the agent runs code, a way to execute or test that code (local environment, CI pipeline, or sandbox)
- A checklist of acceptance criteria (what must be true for the job to be considered finished)
- Optional: a second person to review the output if the task is high-stakes
Step-by-Step
- Restate the task in your own words. Write down what you asked the agent to do, including any constraints (e.g., “write a Python script that reads a CSV and outputs a summary table”). This becomes your reference point.
- Check the agent’s final message for explicit completion. Many agents will say “I’ve finished” or “Task complete.” But don’t stop there—treat that as a claim, not proof.
- Inspect the output artifact directly. If the agent was supposed to create a file, open it. If it was supposed to modify a database, query the relevant rows. If it was supposed to send an email, check the sent folder. Look for the actual result, not just a summary.
- Run the agent’s code or commands yourself. If the agent generated code or shell commands, execute them in a clean environment. A common failure is that the agent’s code works in its simulated environment but not in yours—or it doesn’t run at all.
- Compare the output against your acceptance criteria. For each criterion you listed, mark pass/fail. For example, if the task was “sort the list ascending,” verify the output is indeed sorted. If the task was “summarize this 10-page PDF,” check that the summary covers all major sections.
- Check for silent truncation or shortcuts. AI agents often stop early, skip edge cases, or produce placeholder text. Look for phrases like “…” or “etc.” in the output, or missing sections that were in the input.
- Verify with a separate method. If possible, cross-check the result using a different tool or manual calculation. For example, if the agent computed a total, add the numbers yourself or use a spreadsheet formula.
- Review the agent’s logs or reasoning trace. Many agents provide a step-by-step log. Look for any steps that were skipped, marked as “assumed,” or that ended with an error that the agent ignored.
- Ask the agent to explain its work. If you’re using a conversational agent, prompt it with: “Explain exactly how you arrived at this result, including any assumptions you made.” This often reveals gaps.
- Do a final spot-check on real-world data. If the task involved processing data, take a small sample of the input and manually compute the expected output, then compare to the agent’s result.
Common Mistakes
- Trusting the “I’m done” message. Agents are trained to be agreeable and may declare success even if they didn’t complete all steps.
- Only checking the final output, not the process. A correct-looking result might be based on wrong assumptions or incomplete data.
- Ignoring error messages. If the agent’s log shows a failed step but the agent continued, the final output may be unreliable.
- Not defining “done” upfront. If you didn’t specify acceptance criteria, you can’t objectively verify completion.
- Skipping the test run. Code that looks fine may have syntax errors or missing dependencies.
Tips
- Use a checklist. Write down the exact deliverables before you start. This makes verification systematic.
- Ask for a summary of what was done and what wasn’t. A good agent will be transparent about limitations.
- Break large tasks into subtasks. Verify each subtask as you go, rather than waiting for the final output.
- Use version control. If the agent edits code, commit changes so you can see exactly what was modified.
- Test with edge cases. If the task involves data, test with empty inputs, extreme values, or unusual formats.
Troubleshooting
The agent says it finished but no output exists. Check the working directory or the agent’s output folder. Sometimes the agent saves to a different path than expected. If you’re using a chat interface, look for attachments or links.
The output is incomplete or truncated. Ask the agent to continue from where it stopped, or increase the token limit if you have that control. For code, check if the file ends mid-function.
The agent’s code throws an error when you run it. Read the error message carefully. It might be a missing import, a wrong file path, or a version mismatch. Try fixing the error manually or ask the agent to fix it, providing the error text.
The result doesn’t match a manual calculation. Recheck your manual calculation first—it’s easy to make a mistake. If yours is correct, ask the agent to show its arithmetic or logic step by step.
The agent ignored a key constraint. Point out the specific constraint and ask it to redo the task with that constraint explicitly in a new prompt. Avoid ambiguity in your original instruction.
Frequently Asked Questions
How can I tell if an AI agent is lying about finishing?
You can’t tell from the message alone. You must verify the output artifact and, if possible, the process. Look for inconsistencies between the agent’s description and the actual file contents.
What if the agent’s output is correct but the code is messy?
That’s often acceptable. If the task was to produce a result, the result matters more than the code style. But if you need maintainable code, ask the agent to refactor and then review the changes.
Should I re-run the agent’s code in a sandbox?
Yes, especially if the code has side effects (deletes files, sends emails, modifies data). A sandbox prevents accidental damage.
What if the task is subjective, like “write a good summary”?
Define “good” with specific criteria (length, key points covered, tone). Then check against those criteria. If you’re still unsure, get a second opinion.
Can I rely on the agent’s confidence level?
No. Confidence is not a reliable indicator of accuracy. Always verify.
How long should verification take?
It depends on the task. For a simple calculation, seconds. For a complex code change, minutes to hours. The more critical the task, the more thorough the verification should be.