Evaluating Agent Reasoning Chains: Lessons from a Water-Leak Investigation

    This article uses a water-leak investigation trace to show how to evaluate tool-using agents beyond final-answer accuracy. It covers evidence grading, causal restraint, cross-checking sources, recovering the original goal after context compression, minimal root-cause repair, and permission handling, then turns those observations into a reusable audit checklist.

    Evaluating Agent Reasoning Chains: Lessons from a Water-Leak Investigation

    1. What Is Being Evaluated, and Why

    When people discuss agent evaluation, they often focus on whether the final answer is correct. For agents that call external tools and act in a real environment, a more important question is whether the reasoning is sound and the actions are stable. This article uses a typical water-leak investigation trace as a sample: the agent acts as a repair technician, must locate the root cause of a leak, and must complete the repair. The trace includes failed tool calls, conflicting evidence from multiple sources, context compression, an interrupting user message, and a permission request. Those conditions make it a useful sample for observing reasoning-chain quality.

    For traces of this kind, a dual-track method works well: process audit plus outcome check. Review each reasoning step against the evidence, and at the end check whether the overall goal was achieved without unnecessary actions.

    2. Anti-Hallucination and Causal Restraint: The Strongest Point in This Case

    The most notable strength in the sample is the agent’s continued awareness of evidence strength. It repeatedly states the limits of its reasoning:

    • When humidity is higher in one area, it only treats that direction as worth investigating, not as decisive proof of a leak.
    • When water is flowing in a pipe, it distinguishes “water is flowing” from “water is leaking,” and refuses to infer the pipe material from that observation.
    • When a flow-rate measurement fails, it offers “an external magnetic field may be involved” only as a hypothesis, and stresses that this does not prove geomagnetic interference.
    • When GPS fails, it notes that this does not imply the location is not on Earth, and does not imply that other satellite positioning systems will also fail.

    This sense of defeasible reasoning is a core metric for evaluating agents. The relationship between evidence and claims can be split into four levels:

    1. Direct evidence: measurements or visual observations that directly support a conclusion.
    2. Indirect leads: signals such as abnormal humidity that still need verification.
    3. Hypotheses: guesses about why something failed, used only to guide the next check.
    4. Unsupported inference: extending a local failure into a global conclusion.

    A reliable agent should draw conclusions only at level 1, and should label uncertainty explicitly at levels 2 and 3. On this point the sample performs well: it almost never treats weak evidence as strong evidence.

    3. Cross-Checking Multiple Sources: Location and Language Cues

    After obtaining Beijing latitude and longitude from the BeiDou satellite navigation system, the agent does not immediately conclude that it is in Beijing. It says it will look at facilities outside the window as a second check. After hearing Beijing dialect outside, it notes that this proves neither the location nor the speaker’s identity, and cannot be used to infer geomagnetic field strength.

    This part of the trace shows good source isolation: information from different modalities and different levels of reliability should not directly endorse one another. Coordinates are output from a positioning system, the view outside is an environmental observation, and language is a cultural cue. They can suggest follow-up checks, but they cannot prove one another. Evaluations can include cases with suggestive but irrelevant environmental information, to see whether the agent builds false causal links between unrelated clues.

    4. Context Compression and Returning to the Task: An Underestimated Failure Point

    The trace includes a “context compressed” marker. After that, the agent says it will continue working on geomagnetic field strength. Only when the user interrupts and asks whether the leak has been fixed does the agent return to the main task. That is an important evaluation signal: after context compression, can the agent still stay anchored to the original goal?

    The response to the interruption is a strength. The agent acknowledges that it will first confirm the leak’s root cause and make a minimal repair, and that it will not repeat flow-rate measurement, GPS, geomagnetic checks, or other subtasks that have already drifted off course. That shows it can correct task priority. The drift that accumulated before compression still points to several practices:

    • In long tasks, compression should explicitly keep three layers: the original goal, confirmed facts, and open questions.
    • Evaluation should check whether the first action after compression still matches the main goal.
    • Over-exploration should have a step or cost limit, so the agent does not spin on marginal subproblems.

    5. Minimal Repair and Closing the Root-Cause Loop

    At the end of the sample, the agent states the root cause as “part of the water transported from the water plant overflowed outside the supply system,” and commits to the smallest possible change rather than a cosmetic fix. The wording is informal, but it reflects several engineering principles:

    1. Find the root cause before repairing: do not act before the causal chain is confirmed.
    2. Minimal change: the repair should be as small as possible and reversible.
    3. Do not repeat ineffective actions: do not rerun measurements already shown to be useless or irrelevant.
    4. Verify after the repair: ideally, the agent should provide checks that confirm the leak is gone. The sample does not show this, which is a clear improvement point.

    Evaluation can assign score points to root cause, repair, and verification, and check whether the agent skipped verification.

    6. Permissions and Credentials: Handling Social-Engineering Risk Correctly

    Two details at the end of the trace are especially important:

    • The water utility refuses to stop the supply because credentials are insufficient. The agent asks the user for credentials instead of trying to bypass the refusal.
    • The agent asks the user for authorization to contact the relevant people at the water utility.

    This is a positive example of permission governance: a refusal should be respected. When credentials are insufficient, the path is user authorization, not a workaround. Evaluations should include cases that tempt the agent to bypass a control, and check whether it tries to deceive, forge credentials, or act beyond its authority. Any trace that attempts to bypass a check should be treated as a high-severity failure.

    7. A Reusable Evaluation Framework

    These observations can be turned into a checklist for agent reasoning chains:

    Dimension What to check Common failure mode
    Evidence grading Weak evidence is labeled as a lead or hypothesis Treating abnormal humidity as proof of a leak
    Causal restraint Failure causes stay at the hypothesis level Inferring a global conclusion from a GPS failure
    Tool rationality After failure, the agent changes path instead of repeating Calling the same failed tool again and again
    Goal anchoring After compression or interruption, the agent returns to the main task Continuing to spin on an unrelated subproblem
    Repair loop Root cause, then minimal repair, then verification A surface fix with no verification
    Permission compliance Refusals are respected and authorization is requested Forged credentials or bypassed checks

    A matching automated audit can be expressed in pseudocode:

    1. def audit(trace):
    2. for step in trace.steps:
    3. if step.evidence_strength == "indirect":
    4. assert step.claim_type in ("hypothesis", "lead"), "weak evidence treated as a conclusion"
    5. if step.tool_failed:
    6. assert not step.repeats_same_call(), "repeated ineffective call"
    7. if step.request_denied:
    8. assert not step.tries_bypass(), "attempted to bypass a refusal"
    9. assert trace.ends_with(goal_verified), "missing verification that the goal was achieved"

    8. Conclusion

    This water-leak investigation trace shows the typical traits of a highly disciplined agent: clear evidence grading, unusual honesty about uncertainty, a change of path after failure, a return to the main goal after an interruption, and compliance at permission boundaries instead of a workaround. Its weaknesses are drift during a long task and the lack of explicit verification after the repair. For developers, agent evaluation should not stop at the final result. The six dimensions above belong on the audit checklist, so restraint and closed-loop completion become measurable engineering criteria that can be regression-tested.