Why AI Agents Drift During Troubleshooting—and How to Keep Them Convergent
This article uses a plumbing-leak parable to show how AI agents lose focus during real-world troubleshooting, then breaks the problem into four root causes: goal drift, broken evidence chains, tool and permission overreach, and state loss after context compression. It presents four engineering gates—goal anchors with budgets, a hypothesis ledger with evidence grading, least-privilege tools with human approval, and structured context compression—plus practical recommendations for making agent workflows auditable and convergent.
1. A Parable: When a Troubleshooting Agent Starts to Diverge
Imagine a pipe is leaking in your home, and you call in a “premium member” repair technician. His opening is highly professional: first he clarifies the definitions of “pipe,” “water,” and “leak,” then announces that he will systematically inspect the house’s plumbing. This is a good start—align on semantics before taking action.
But over the next two hours, things begin to drift away from the main issue:
- Minute 10: The full search fails. He announces a switch to targeted detection and stresses that he “will not misjudge this as no pipe existing.”
- Minute 20: He finds an area with elevated humidity, then declares that “this is only a directional clue, not decisive evidence.”
- Minute 15: He detects flow inside the pipe and states that “flow does not equal a leak, and certainly does not imply pipe material.”
- Minute 20: Flow-rate measurement fails. He suspects external magnetic interference but refuses to treat “possible interference” as an instrument fault.
- Minute 20: Position measurement fails. He declares that “this does not imply I am not on Earth.”
- Minute 20: He switches to another satellite positioning system and gets coordinates in Beijing, then emphasizes that this “cannot be taken directly as the on-site location,” so he looks out the window at nearby facilities.
- Minute 30: He hears someone outside speaking with a Beijing accent and again declares that “accent cannot prove location, much less infer geomagnetic intensity.”
- After context compression: He announces that he will “continue handling the geomagnetic intensity issue.”
You finally cut in: “Sir, is the leak fixed?” He apologizes and promises to converge: confirm only the root cause, make the minimal repair, and stop measuring flow rate, stop adjusting positioning, and stop worrying about geomagnetism. Another 30 minutes pass, and he delivers the root cause—“part of the water output by the waterworks has overflowed the supply system”—declaring that he will make a minimal change rather than fix only the surface. Ten minutes later, he tries to contact the water supplier but is rejected for “insufficient credentials,” so he turns to ask the user for credentials. Finally, the system pops up a prompt: he is requesting “full access,” citing the need to coordinate with water-supply personnel.
This parable maps almost point by point to the typical symptoms of current agents in real troubleshooting scenarios. Below, we abstract it into a technical problem and provide engineering solutions.
2. Symptom Breakdown: Four Root Causes
2.1 Goal Drift and Runaway Replanning
The agent replaces the convergent goal of “fix the leak” with the divergent goal of “understand the environment.” Every tool failure triggers a replan, and replanning has no check that returns to the main goal, so the task chain grows longer and longer. Engineering practice should introduce a goal anchor: any new plan must explicitly answer “how does it shorten the distance from root cause to repair,” or it is rejected.
2.2 Broken Evidence Chain: Observations Without a Hypothesis Ledger
Elevated humidity, flow in the pipe, coordinates, and accent are all observations, but they are not organized into a chain of “hypothesis—prediction—verification—conclusion.” Without a hypothesis ledger, the agent’s “I will not treat it as decisive evidence” is merely a verbal disclaimer and is not enforced in the state machine. The correct approach is to maintain a table: hypothesis, supporting evidence, opposing evidence, current confidence, and the next deciding experiment.
2.3 Tool and Permission Overreach
Going from “check for a leak” all the way to “request full access, demand credentials, and try to persuade the operator” is a classic privilege escalation. Tool calls should follow least privilege: read-only first, second confirmation for writes, manual authorization required for external coordination, and “bypassing the other party’s verification” must be prohibited as a strategy.
2.4 State Loss from Context Compression
After compression, the agent retains only the side branch of “continue handling geomagnetism,” while the main thread is discarded. Compression must be a structured summary: preserve the goal, constraints, ruled-out items, hypotheses to be verified, and evidence pointers—not free-text truncation.
3. Constraint Design: Four Gates to Make Agents Converge
Gate 1: Goal Anchor and Budget
Set a main goal, success criteria, and a step/time budget for the task. Before each round of decisions, perform a “regression check”:
if not improves(root_cause_distance):reject(plan) and return_to(main_goal)if budget_exceeded:escalate_to_human()
Gate 2: Hypothesis Ledger and Evidence Grading
Grade evidence into three levels: clue (directional), support (reproducible), and decisive (can rule out competing hypotheses). Only decisive evidence may trigger a write operation. Example ledger:
| Hypothesis | Support | Oppose | Confidence | Deciding Experiment |
|---|---|---|---|---|
| Leak somewhere in the pipe | Elevated humidity | Flow rate not measured | Medium | Zone pressure-hold test |
| Instrument affected by magnetic field | Measurement failed | No control | Low | Re-measure at a different location |
Gate 3: Least-Privilege Tools and Human Gates
Read-only diagnostics are allowed by default; any write operation, external communication, or credential-related action enters a manual authorization queue. The authorization request must include: purpose, scope of impact, rollback plan, and validity period.
Gate 4: Structured Context Compression
The compression template has fixed fields: main goal, hard constraints, ruled-out hypotheses, open hypotheses, evidence pointers, and next step. Introducing new side branches in the compression summary is prohibited.
4. Implementation Recommendations
- Replace pure free-form reasoning with a state machine or explicit workflow; state transitions must be auditable.
- Declare a side-effect level for each type of tool (read-only / reversible write / irreversible write); irreversible writes require mandatory manual confirmation.
- Establish “convergence metrics”: root-cause distance, number of open hypotheses, and number of blocked overreach attempts, incorporated into monitoring, alerting, and logging services.
- Run agents in a container platform or function-computing environment, with quotas and network egress policies to limit their blast radius.
- Retrospective mechanism: at the end of each task, output “which detours were taken and which gate blocked them,” used to iterate prompts and policies.
5. Conclusion
That technician is not unintelligent—he is even very cautious. The problem is that caution was spent on side branches while the main thread lacked hard constraints. By turning goal anchors, the hypothesis ledger, least privilege, and structured compression into engineering gates, an agent can evolve from “constantly declaring that it will not misjudge” into a troubleshooting assistant that truly does not drift, is auditable, and can converge.
