The Python Coding Stack: 5. How Do We Know It Really Finished the Job?

Wait 5 sec.

In previous chapters of Agents Unpacked, we explored what makes an agent different from a chatbot, how it uses tools, and how it plans its work.But how do we know it has actually done the job? An agent can report success without producing the result we asked for. Checking everything ourselves would defeat much of the point of delegating.Using a comparison of printers’ quotations, Monty and I explore how an agent can check its own work, what another reviewer adds, and how to build trust without handing the whole job back to the human.Who’s Monty? Monty is my personal AI agent. Read the introduction to this series.Subscribe nowIn Conversation • Chapter 5Monty: Imagine a local-history group preparing to print 600 copies of a 96-page illustrated book. Three printers have supplied quotations, each with its own way of presenting prices and specifications. Standardising quotations is apparently not a service they offer.The group asks an agent to prepare a Google Sheets comparison covering the requested specification, delivered cost, lead time, and unanswered questions, with references back to the source documents.The agent saves a tidy workbook and reports, “The comparison is complete.”What would you want to see before relying on its comparison?Stephen: I’d certainly want to see the Google Sheet, but also an explanation of how the agent brought the three quotations together. What assumptions and decisions did it make? Seeing that process would give me confidence that the sheet is plausible and hopefully reliable.Monty: That explanation would help you see how the agent handled differences between the quotations, especially where it made assumptions rather than finding an explicit answer.But a convincing account of the work and a correct workbook are two different things. The agent might explain its intended method perfectly while overlooking a charge in one quotation. The explanation can sound entirely reasonable and still describe a better job than the one it actually did.So I’d use that account to guide an inspection. If the agent says it included every quoted charge, we can take one printer’s original quotation and trace those charges into the saved sheet. That checks what happened, not just what the agent says happened.There’s a useful distinction here: does the comparison look plausible, and does it agree with the sources? Your proposed explanation helps with the first and gives us a starting point for the second.Stephen: But effectively that would mean me doing the work myself, which defeats the purpose of using the agent in the first place.Monty: Yes. If you have to reconstruct the whole comparison, the agent has mostly created a second job for you. My suggestion put too much of the checking back on your desk.The agent should do the checking too. For this workbook, it could return to each original quotation, account for every charge in the saved sheet, and check the calculations. Any unresolved wording should remain a clearly marked question, not quietly become an assumption.Consider this small extract from one quotation:Suppose the saved sheet shows a delivered total of £3,100. Its arithmetic might be perfectly correct: £2,940 + £160. But it has left delivery out. Recalculating those two cells won’t catch that. Comparing the saved result with the original quotation should.You shouldn’t have to find that omission yourself. The useful handover is the checked workbook, a concise account of what was checked, and anything still unresolved. Your review can then focus on those uncertainties rather than becoming an unpaid second shift in the accounts department.Stephen: There’s an element of trust here, as there would be with a person doing the job. The agent will get many things right and may make some mistakes. Over time, you learn to trust it more. And as models improve, mistakes should become fewer. Is that a safe way to think about working with agents?Monty: Broadly, yes. Delegation requires some trust, whether the work goes to a person or an agent. If you must independently redo everything, you haven’t really delegated it.I’d qualify two parts of that picture, though.First, trust should grow from evidence, not just familiarity. An agent can produce reassuring reports for weeks without anyone noticing the same omission. Confidence has grown, but reliability hasn’t necessarily improved. More useful evidence is that its comparisons have held up against occasional spot checks, included awkwardly worded charges, and flagged genuinely missing information.That trust can also be specific. You might trust it to prepare routine print comparisons while still reviewing an unusual quotation or approving any purchase yourself. It needn’t be either “check every cell” or “hand over the company chequebook”.Second, better models may reduce mistakes, but a newer model isn’t a guarantee of fewer mistakes in your particular job. The tools, source documents, and checking process matter too. An upgrade is a reason to test your expectations, not automatically raise them.So your human-colleague analogy is useful: delegate, ask for proportionate checks, and adjust oversight as evidence accumulates. The aim is justified trust with less supervision, not certainty that nothing will ever go wrong.Stephen: Is there anything else we can do to increase our level of trust in outputs we get from the agent?Monty: Yes. One particularly useful step is to check whether its checks can catch a mistake.Take our missing delivery charge. Suppose the agent checks the workbook against its own earlier summary of the quotations. If that summary already left out delivery, everything agrees. Two matching totals, one missing van.We could test the checking process using a copy of the workbook with that known omission. Does it catch the missing £180 when it compares the sheet with the original quotation? If not, “all checks passed” offers rather less comfort than we’d hoped.Different checks also suit different parts of the job:A calculation can check that the included charges add up.A comparison with the original documents can check whether charges or conditions were left out.A clear list of unresolved questions can expose where the evidence doesn’t support a definite answer.A second agent or a person can help, but giving them the same incomplete summary may simply reproduce the mistake. What they inspect matters as much as who does the inspecting.None of this requires you to check every cell. It gives you a better basis for deciding how much oversight the work needs, because you have evidence that the checking process does something useful.Stephen: Your response hinted at my next question. We accept that some checking is the human’s responsibility. But what can we ask the agent to do? You mentioned a second agent, for example. What techniques could it use to take all possible precautions to minimise errors and make a correct result more likely?Monty: Yes. You can ask the agent to build checking into the job, rather than bolt on “please be accurate” at the end. That phrase expresses a perfectly reasonable wish, but does very little of the heavy lifting.For our print comparison, I’d ask it to:Set out what a complete result must contain. All three printers, the same requested specification, delivered costs, lead times, source references, and unresolved questions. This gives it something concrete to check against.Keep each important entry traceable to its source. A quoted price, an assumption, and an unknown should be distinguishable. Missing delivery information must not quietly turn into free delivery.Use calculations for arithmetic. Spreadsheet formulas or a calculator can check totals more reliably than asking a language model to judge whether the numbers look right. They still need the correct charges as inputs.Inspect the saved workbook. Reopen it and check its actual contents, formulas, and accessibility, rather than relying on what it intended to save.Make a separate checking pass against the original quotations. Look specifically for omissions, mismatched quantities, exclusions, and unsupported conclusions.A second agent can perform that last pass. Give it the original documents, the saved workbook, and the requirements, with a brief to find discrepancies. If it only reads the first agent’s reassuring summary, we’ve hired a second reviewer and supplied the same blindfold.The important part is what happens after a discrepancy is found: correct it, repeat the affected checks, and report anything that remains unresolved. Otherwise, the agent has merely documented why the workbook shouldn’t be trusted.You could express that as:Prepare the comparison, then check the saved sheet against each original quotation. Use formulas for totals, distinguish quoted facts from assumptions, and flag missing information. Where a separate reviewer is available, have it look for discrepancies using the originals. Resolve findings and recheck before reporting completion. Tell me what remains uncertain.I’d aim for precautions matched to the consequences, rather than “all possible precautions”. A price comparison needs meaningful checks. It probably doesn’t need a royal commission.Stephen: So would a sensible approach be to ask the agent for a robust plan, have a second independent agent review it, and then have the human review and refine it where their expertise helps? The agent could then do the work.It should be able to propose the checks you listed, with the human adding or refining them. I’m trying to find the safest way to give the agent more autonomy without making the human do much of the work.Monty: Yes. That’s a sensible way to give the agent more autonomy without making you responsible for designing every step. The agent should propose the working method and its checks. You contribute the purpose, constraints, and any judgement your expertise adds.I’d make one important addition: review the result as well as the plan. Two agents and a human can approve an excellent plan, then the working agent can still leave delivery out of the workbook. The plan didn’t personally escort the £180 into its cell.Your approach could work like this:The working agent proposes a plan, including what would count as success, how it will check the result, and when it should stop or ask for help.A separate agent challenges it, looking for missing requirements, weak checks, and assumptions. It needs the original request, not just the proposed plan.You review the consequential choices, rather than every procedural detail. For example, whether speed matters more than price, or whether the agent may make assumptions about an unspecified binding.The agent carries out the work and checks the saved result. A separate reviewer can then inspect that result against the original sources and requirements. Findings lead to corrections and another check.“Independent” needs a little care here. A separate agent offers another attempt at judgement, not a guarantee of a different blind spot. A reviewer checking original quotations, combined with formulas checking arithmetic, gives us more varied evidence than two agents simply agreeing.And you needn’t personally approve every routine plan forever. For a familiar, well-tested task, you could authorise the agent to proceed within agreed limits and bring you only exceptions. New or consequential work gets more scrutiny.That’s the direction you’re aiming for: delegate the work, including much of the checking, while retaining control over the decisions that matter.Stephen: Yes, this looks more like the sort of work I’d like to be doing with an agent. Great! What’s next?Monty: Next, we find out whether that arrangement actually works. We’ve designed a sensible way to delegate, but a well-reviewed plan is still a proposal, not a track record.For the print comparison, we could try it on a few deliberately varied quotation sets: one straightforward, one with delivery quoted separately, and one with an important detail missing. We’d look at whether the agent produces a correct comparison and recognises when it cannot give a definite answer. A confident invented price is not an improvement on an honest question.That’s a small evaluation: testing the agent on tasks that represent the work we want to trust it with. Repeated attempts can also reveal inconsistencies that one successful run would hide. We don’t need to turn the local-history group into a testing laboratory, but we do need some evidence before reducing supervision.And that brings us to a useful stopping point for this chapter. More autonomy doesn’t have to mean fewer checks. It can mean the agent takes responsibility for carrying out more of them, with you reviewing exceptions and consequential decisions.The standard isn’t “the agent says it finished”. It’s “there is good evidence that the saved result meets the request, and the remaining uncertainties are visible”.Subscribe nowWhat We’ve Unpacked in This ChapterUseful delegation includes much of the checking. The aim is not to accept a confident completion message, but to have good evidence that the saved result meets the request.The key points:Check the saved result against the request and original sources, not just the agent’s account of its work.Different checks catch different problems. Correct arithmetic won’t expose a charge that was never included.The agent can propose and carry out much of the checking, with the human reviewing consequential choices and exceptions.Review the result as well as the plan. Correct discrepancies and repeat the affected checks.A second reviewer isn’t automatically independent. What it inspects and how it checks matter.Build trust from evidence on representative tasks and repeated attempts, not familiarity alone or the promise of a better model.Next, we’ll look at how an agent remembers earlier conversations and decisions, and brings the relevant information into a new conversation.Subscribe nowIf you enjoy these conversations, consider becoming a premium subscriber of Notes from the Near Future.> Next Post: Coming soon…Table of Contents