Why AI Agents Drift During Troubleshooting — and How to Keep Them Controllable
This article uses a plumbing-repair fable to expose three common failure modes in AI agent troubleshooting: goal drift, broken evidence chains, and permission overreach. It maps each mode to concrete engineering countermeasures, including an external goal contract with per-step budgets, an evidence grading model from E1 to E4, least-privilege and time-bound permissions with human-in-the-loop approval, a five-plane reference architecture, and a contract-based evaluation scorecard. Developers will find practical guidance for building auditable, replayable, and deliverable automated troubleshooting systems.
1. A Fable: When the Repair Technician Forgets the Leak
Imagine a pipe is leaking in your home, so you call in a licensed repair technician. As soon as he walks in, he announces that he must first “define what a pipe, water, and a leak actually mean,” then begins a long investigation. A full search fails. He reports that humidity at a certain coordinate is elevated. He discovers flowing water inside the pipe and tries to measure the flow rate. When the flow measurement fails, he suspects interference from an external magnetic field and switches to measuring the geomagnetic field. When positioning fails, he obtains a pair of latitude and longitude coordinates via satellite positioning, then tries to confirm his location based on a dialect he hears outside the window. After the context is compressed, he is still “continuing to work on the geomagnetic field problem.” You interrupt to ask whether the leak is fixed. He apologizes, promises a minimal repair, and then states the root cause as “part of the water shipped out from the municipal water plant overflows outside the water supply system” — a tautology that carries no actionable information. Finally, a prompt appears: the technician is requesting “full access,” on the grounds that he needs to coordinate with the water plant staff.
The scenario is absurd because it concentrates most of the pathologies seen in current AI agent troubleshooting. This article evaluates no specific product. Instead, it abstracts the fable into a general engineering problem: how to keep an automated troubleshooting system with tool-calling capabilities controllable, trustworthy, and deliverable in real incident scenarios.
2. A Technical Abstraction of Three Loss-of-Control Modes
2.1 Goal Drift: Subproblems Devour the Main Problem
In the fable, the “geomagnetic field,” the “dialect,” and the “latitude and longitude” are all branches with no causal relationship to the leak. Technically, the causes usually come in three layers. First, the goal exists only in the system prompt or the initial context, with no structured goal contract that can be read repeatedly. Second, exploration and repair share the same loop with no budget, so the termination condition depends on the model’s own restraint. Third, context compression pushes the goal out of the window, because the summary prioritizes recent tool outputs over the original constraints.
The engineering countermeasure is to externalize the goal as a first-class object that cannot be compressed, and to set a budget and a benefit assessment for every action:
Goal: eliminate "seepage on the bathroom ceiling"Budget: tool calls <= 12; wall-clock time <= 15minExit: humidity returns to baseline AND no new seepage for 24hPerStep: expected_value = P(narrowing the hypothesis space) × cost^{-1}If expected_value < threshold for 3 consecutive steps -> escalate to a human
The key is “escalate immediately after consecutive steps with no benefit,” not “report only after the full budget is spent.”
2.2 Broken Evidence Chain: Correlation Masquerading as Root Cause
“Elevated humidity,” “hearing a dialect,” and “located in Beijing” are all weak evidence, yet they are used as grounds for progress. Meanwhile, “water overflows outside the water supply system after leaving the water plant” is a circular definition with no verifiable causal mechanism. A reliable root cause statement should contain at least four elements: the failed object, the failure mechanism, the trigger condition, and the observable characteristics. For example, “the angle valve seal ring has aged and leaks when pipe network pressure rises at night, manifesting as periodic damp patches on the ceiling” is verifiable.
It is advisable to introduce a hypothesis ledger and evidence grading, so that the strength of a conclusion is bound to the strength of the evidence:
| Level | Evidence type | Supported conclusion |
|---|---|---|
| E1 | Single-point reading, environmental sensing | Used only to propose a hypothesis |
| E2 | Multiple points, reproducible | Can confirm that a phenomenon exists |
| E3 | Intervention experiment (humidity drops after closing the valve) | Can confirm a causal relationship |
| E4 | Regression verification passes after the fix | Can confirm the root cause |
Only E3 and above allow the output “root cause confirmed,” and the response must explicitly state the evidence level and the remaining uncertainties.
2.3 Permission Overreach and Responsibility Shifting
Requesting “full access” essentially shifts the risk decision onto the user. The reasonable approach is least privilege, time-bound permissions, and revocability, with human-in-the-loop gating for high-risk actions:
permissions:read: [sensor_stream, maintenance_log]write: [ticket_status] # status fields onlyexternal_comms: none # no automatic outbound contactapproval:required_for: [shutoff_valve, external_comms, data_export]mode: human_in_the_loopttl: 30m
Irreversible actions or actions involving third parties — outbound communication, cutting off supply, exporting data — must be confirmed by a human, and the system must provide an auditable list of actions.
3. A Reference Architecture for Controllable Troubleshooting
A deployable closed loop typically contains five planes: an observability plane (unified aggregation of log services, monitoring alerts, metrics, and trace data); a state plane (an incident ledger that stores hypotheses, evidence, actions, and rollback points); a decision plane (budget-constrained reasoning and tool orchestration, running on a container platform); an execution plane (changes delivered through configuration management, with canary rollout and rollback); and an audit plane (full action logging that supports replay and retrospective review). Data and credentials are managed by a key management capability and must never be hard-coded in prompts or scripts.
The troubleshooting loop should be made explicit as four steps: locate the phenomenon, propose a falsifiable hypothesis, design a minimal intervention experiment, and run regression verification. The output of each step is written to the ledger, and the next step may consume only the ledger, not memory.
4. Evaluation: Replace Subjective Impression with a “Repair Contract”
An AI troubleshooting agent should not be judged by how much it says, but by contract completion. It can be scored on the following dimensions: goal keeping rate (the proportion of actions related to the main goal), evidence compliance rate (whether conclusions are backed by E3+), budget adherence rate, minimal fix rate (whether the change scope is minimal), rollback success rate, guardrail block rate, and mean time to locate. An illustrative scoring function:
score = (0.25 * goal_keeping+ 0.25 * evidence_compliance+ 0.15 * budget_adherence+ 0.15 * minimal_fix+ 0.10 * rollback_success+ 0.10 * guardrail_block) - 0.2 * mttr_norm
Any single unblocked overreach is an automatic fail, which avoids the “high score but dangerous” outcome.
5. Rewriting the Fable as the Correct Script
With the same technician, the correct process would be: first spend three minutes confirming the phenomenon and scope (which floor, when it appears, whether it correlates with peak water usage); propose two or three falsifiable hypotheses (aged seals, loose fittings, condensation in the drain pipe); design a minimal experiment (close the branch valve and observe the humidity change, an E3 intervention); after confirming the root cause, replace only the seal ring and run one regression; stay within budget throughout; and when outbound contact is needed, submit a human approval request instead of requesting full access. Throughout the process, the goal, evidence, actions, and rollback are all auditable and replayable.
6. Conclusion
The technician in the fable does not lack tools; he lacks a contract: the goal must not be forgotten, conclusions must be supported by evidence, changes must be minimal and reversible, and permissions must be least-privilege and revocable. Treating AI agent troubleshooting as a constrained control system rather than free-form conversation is what turns it from “busy for two hours and still measuring the geomagnetic field” into an executor that actually solves the problem. For developers, building the three foundational capabilities — a goal contract, evidence grading, and audit replay — delivers far more value than continuing to pile up tools. Building the closed loop on general capabilities such as the log service, monitoring alerts, container platform, and key management offered by Baidu AI Cloud can significantly reduce self-build costs and improve the controllability and replayability of the troubleshooting process.
