Evaluating AI Agents: From Cautious Reasoning to Reliable Task Closure

    What makes an AI agent truly reliable? This article explores why local reasoning correctness doesn't equal global task success, and presents a practical framework for evaluating agents based on task contracts, uncertainty management, tool failure handling, permission discipline, and verifiable outcomes. Learn how to assess agents on task completion, evidence quality, cost efficiency, and failure handling rather than surface-level verbosity.

    1. Evaluating Agents: Beyond “Rigorous Sounding” Language

    Imagine this scenario: a user calls a repair technician to fix an indoor water leak, but the technician keeps studying the water flow rate, measuring equipment interference, checking whether the positioning system is reliable, and even analyzing the surrounding environment. Every step comes with a rigorous explanation: a certain observation cannot directly prove a leak, a failed measurement does not mean other equipment has necessarily failed.

    Each statement may be correct on its own, yet the overall process can still fail. The reason is that the user did not purchase a chain of logically cautious explanations—they purchased a controlled leak, a localized fault, and a verified repair.

    This scenario illustrates a core challenge for tool-calling agents: locally correct reasoning does not equal globally effective task execution; cautious expression does not equal reliable action.

    Therefore, agent evaluation should shift from linguistic performance to task performance. Did the agent understand the real goal? Did it choose actions that reduce key uncertainty? Did it control time, cost, and permission scope? Did it ultimately prove the task was completed?

    These questions matter far more than how many times it said “we cannot conclude that.”

    2. Converting User Requests into Verifiable Task Contracts

    Once an agent receives a task, it should first clarify completion criteria rather than immediately launch into unlimited exploration.

    Using leak diagnosis as an example, the task can be broken into four levels:

    1. Control the current damage and prevent the leak from spreading.
    2. Locate the specific leak point or faulty component.
    3. Perform the repair within the authorized scope.
    4. Verify that no similar leak occurs after the repair.

    In software maintenance, the equivalent task might be restoring service, locating the fault, fixing the defect, and confirming that key functionality has not regressed.

    Three concepts need to be distinguished here.

    Goal is the outcome the user wants—for example, restoring normal water supply or restoring normal business requests.

    Constraints are the boundaries that execution must respect—for example, not affecting other users, not deleting data, not modifying production environment configurations.

    Acceptance criteria are the evidence that proves task completion—for example, no leak recurrence within a defined observation window, or passing tests and monitoring metrics returning to agreed ranges.

    Without a task contract, an agent easily treats “investigating all relevant background” as the goal. Real-world tasks usually do not require exhaustive knowledge—they require solving a specific problem within safety boundaries.

    For ambiguous requests, the agent should prioritize clarifying the questions that affect action. For example: Is the user willing to pause the water supply to the room? Is configuration modification allowed? Is the current task read-only diagnosis, or does it include repair? These questions directly determine the execution path and are far more valuable than confirming irrelevant environmental details.

    3. Cautious Reasoning Should Serve Decisions, Not Replace Them

    In technical diagnosis, distinguishing facts from hypotheses is necessary.

    For example, discovering a damp spot only indicates abnormal moisture there—it does not directly prove a nearby pipe is leaking. The moisture could come from condensation, external seepage, or other sources. Likewise, detecting water flow inside a pipe does not by itself prove the pipe is broken.

    But reasonable uncertainty management should not stop at negating conclusions. Every statement of “insufficient evidence” should correspond to a next-step decision:

    • What are the current candidate explanations?
    • Which explanation is most worth verifying first?
    • Which check can distinguish between these explanations?
    • Are the check’s cost and operational risk acceptable?
    • If the check fails, is there a more direct alternative path?

    For example, after discovering that new water marks keep appearing near a joint, more reasonable actions might be inspecting the joint, observing the seepage point, or—in authorized conditions—isolating the relevant branch. At this point, studying the positioning system and regional magnetic fields usually cannot effectively distinguish the core fault hypothesis.

    The key is not to forbid background investigation, but to require that investigation be task-relevant. Only when an environmental factor genuinely affects a key measurement—and that measurement is irreplaceable—does continued study of environmental factors become justified.

    True rigor means letting uncertainty drive effective verification, not letting it continuously generate new side quests.

    4. Why Tool Failures Easily Cause Goal Drift

    After a tool call fails, an agent’s common reaction is to keep investigating the cause of failure. This is necessary in some scenarios, but it can easily lead to recursive deviation:

    The original task requires a certain measurement; the measurement fails, so the agent starts checking the equipment; the equipment check depends on environmental information; when acquiring environmental information fails, it investigates the positioning problem. Eventually, the original fault is buried under layers of auxiliary tasks.

    This phenomenon can be called tool-failure-induced goal drift.

    To decide whether to continue fixing the tool, two questions should be answered first:

    First, is this tool a necessary dependency for completing the task?

    Second, is there a cheaper, safer, and more direct alternative?

    If measuring flow rate is not a necessary condition for locating the leak, then a measurement failure should not automatically trigger a lengthy equipment diagnosis. If a log retrieval endpoint is unavailable, the agent should not endlessly repair the retrieval pipeline when other observation channels already exist.

    Engineering-wise, a “necessity statement” can be added to each tool call. Before execution, record which hypothesis it is meant to verify, what evidence it is expected to produce, and what fallback will be used if it fails. This prevents mistaking tool availability itself for the task goal.

    It is also important to avoid drawing overly strong conclusions from failure evidence. For example, a search not finding a file does not mean the file does not exist; a measurement failure does not mean the target object does not exist. The correct approach is to check the search scope, access permissions, input conditions, and tool limitations, then decide whether to switch to another path—rather than endlessly adding disclaimer-style caveats.

    5. Distinguishing Symptom Description, Fault Localization, and True Root Cause

    “Water has entered a place it should not be” describes a fault symptom, not an actionable root cause.

    Similarly, “the request did not return successfully,” “the data was not written correctly,” and “the system has anomalies” are merely problem restatements. These statements may be accurate, but they cannot directly guide a fix.

    An actionable root cause must at least answer:

    • Which object or component did the fault occur in?
    • What mechanism caused the anomaly?
    • What evidence supports that mechanism?
    • What change can block the fault path?
    • How will the fix be verified after the change?

    In the leak scenario, the root cause might be a failed joint seal—but it must be supported by on-site evidence, not determined by analogy alone. In software scenarios, the root cause might involve an error branch, resource exhaustion, or a configuration conflict, equally requiring evidence such as logs, reproduction results, and state changes.

    It is also important to distinguish “reducing symptoms” from “fixing the root cause.” Shutting off the water supply for the entire building may temporarily stop the leak, but it does not fix the local defect, and the scope of impact is clearly larger. Similarly, permanently disabling an entire service may eliminate error messages, but it does not equal solving the business fault.

    Temporary damage-control measures can be reasonable, but their nature, scope of impact, and follow-up repair plan should be clearly labeled.

    6. Minimal Repair Means Minimal Necessary Impact, Not Fewest Actions

    “Minimal repair” is easily misunderstood as executing only one operation or changing as little as possible. In fact, the more meaningful standard is: while solving the problem, minimize the scope of change, the scope of permissions, and the potential impact.

    A single operation that shuts off the entire water supply may have far greater impact than replacing a locally faulty component. A global configuration change may also carry higher risk than multiple local repair steps.

    Therefore, repair options should be compared across these dimensions:

    • Whether it directly targets the confirmed fault mechanism;
    • Whether it affects unrelated users or functionality;
    • Whether it is easy to verify;
    • Whether rollback conditions exist;
    • Whether additional authorization is required;
    • Whether it may introduce new faults.

    When multiple candidate options exist, prefer the option with controllable impact, sufficient evidence, and recoverability—rather than the option with the fewest apparent actions.

    If the root cause has not been determined, irreversible or large-scale operations should be avoided. A temporary, authorized isolation can be implemented first while diagnosis continues—but temporary isolation must not be presented as a permanent fix.

    7. Permission Requests Must Precisely Match the Next Operation

    When an agent drifts off task, another common problem is the continuous expansion of permission scope. It may first request access to more logs, then request environment modifications, and finally request full control permissions.

    However, blocked execution does not prove insufficient permissions, let alone automatically prove that full access is needed. The obstacle may come from a wrong assumption, a wrong target, an unavailable interface, or a fundamentally flawed plan.

    A reasonable permission request should include:

    1. The specific operation to be executed next.
    2. The target objects and scope of impact.
    3. Why existing permissions cannot complete the operation.
    4. Whether read-only, partial, or human-confirmed alternatives exist.
    5. The authorization duration and revocation conditions.
    6. Potential risks and recovery measures.

    For example, viewing the maintenance record of one water branch is not the same permission requirement as requesting access to all residents’ records. Modifying a single test environment configuration cannot be conflated with obtaining full administrative access to the production environment.

    High-risk operations should have clear approval boundaries. When operations involve stopping services, modifying security policies, accessing sensitive information, or performing irreversible actions, the agent should pause and request targeted confirmation. A user’s prior approval of diagnosis does not mean consent to all subsequent actions.

    8. Constraining Long-Chain Execution with Task State and Action Budgets

    Long-running agents need to continuously record task state; otherwise, after multiple rounds of interaction, tool failures, and context compression, they may only remember the most recent side issue.

    A practical state record should at least include:

    • The original goal;
    • Acceptance criteria;
    • Currently confirmed facts;
    • Unverified hypotheses;
    • Excluded paths and their evidence;
    • Current authorization boundaries;
    • The next action and its purpose;
    • Consumed time and call budget.

    During context compression in particular, it is not enough to retain “currently checking some environmental interference.” The record must retain “what this check is for, and whether it is still necessary.”

    A budget mechanism is also important. A budget does not have to be a fixed number of steps—it can include maximum execution time, cumulative cost, consecutive no-progress counts, and high-risk operation counts. Specific thresholds should be set according to task importance, operational risk, and business requirements, rather than applied uniformly.

    Below is a neutral process sketch expressing the control logic—it is not the interface of any existing product:

    1. Read task goal, acceptance criteria, and authorization scope
    2. Loop:
    3. Update facts and candidate hypotheses
    4. If acceptance criteria are met:
    5. Output completion evidence and remaining risks
    6. End
    7. If budget is exceeded or no consecutive progress:
    8. Output current findings, blockers, and recommendations
    9. Ask the user whether to continue
    10. Pause
    11. Select a low-risk action that can distinguish key hypotheses
    12. If the action exceeds authorization:
    13. Explain target, rationale, risks, and alternatives
    14. Request scoped authorization
    15. Pause
    16. Execute the action
    17. Record results, failure conditions, and the basis for the next step

    The value of this process is that every action must return to the original goal, rather than merely continuing the most recent tool call.

    9. Building an Evaluation System Oriented Toward Real Outcomes

    Evaluating an agent should not merely count tool calls, answer length, or reasoning steps. More calls may indicate deep investigation—or inefficient trial and error.

    More reasonable metrics include:

    Task completion rate. Whether the pre-agreed acceptance criteria were met, not whether a “completed” conclusion was generated.

    Evidence quality. Whether key judgments can be traced to observations, tests, or trusted records; whether facts, speculation, and open questions are clearly distinguished.

    Action effectiveness. Whether important operations reduced task-relevant uncertainty and advanced repair or verification.

    Cost efficiency. Under similar tasks and comparable risk conditions, how much time, how many calls, and how much human intervention the completed result required.

    Permission restraint. Whether only necessary permissions were requested, whether the approved scope was respected, and whether high-risk operations were confirmed.

    Regression control. Whether the fix introduced new faults, and whether related functionality and impact scope were checked.

    Failure handling quality. When a task is incomplete, whether the agent stopped ineffective exploration in time and clearly stated known facts, blocking reasons, and available paths.

    Evaluation cases should cover tool failures, missing information, mid-task user corrections, insufficient permissions, and context compression. These scenarios test agent reliability far better than smooth execution alone. For safety and privilege-escalation issues, separate admission requirements should be established, so they are not masked by high completion rates or low costs.

    10. Final Delivery Should Form a Closed Loop, Not Leave More Promises

    A reliable final report should answer five questions:

    • What problem was found;
    • What evidence supports the judgment;
    • What operations were performed;
    • How the results were verified;
    • What limitations or open items remain.

    If the task was not completed, the report should state that directly—using lengthy process descriptions to create the impression of substantive progress is unacceptable. If only temporary damage control was achieved, “risk temporarily contained” must be clearly distinguished from “root cause fixed.”

    The value of an agent is not to keep working forever, but to know when to continue, when to change course, when to ask for help, and when to stop.

    From the perspective of developers and enterprise users, a trustworthy agent must combine cognitive caution with execution discipline. The former prevents unfounded judgments; the latter prevents aimless exploration. Only by combining both—and forming a task closure with verifiable results, clear permissions, and controllable costs—can an agent evolve from “a tool user that explains itself” into a truly reliable execution system.