Why AI Agents Drift Off Track When They Try to Be More Careful

    This article explains why long-running AI agents often make no real progress even when every individual step looks rigorous. It identifies three common failure modes—goal drift, over-qualification, and tool misuse with budget blowup—and traces them to a core modeling error: using linear narrative to carry a nonlinear task. The article then presents an engineering approach based on explicit state machines, layered planning, evidence grading, budgets and deduplication, human-in-the-loop authorization, and observability, along with a practical acceptance checklist. Readers will learn how to make agents converge toward a goal instead of endlessly re-verifying it.

    1. A Fable: Why “More Careful” Becomes Less Reliable

    Imagine a pipe is leaking at home, and you call in an intelligent repair assistant. It opens by insisting on “clarifying the exact meaning of the pipe, the water, and the leak,” then enters a long investigation loop: a full search fails, so it switches to targeted rechecks; it finds elevated humidity somewhere but stresses that this is only a directional clue; it detects flow inside the pipe and declares that “flow” does not equal “a leak”; flow-rate measurement fails, and it suspects magnetic interference; positioning fails, and it states that this does not imply the device is not on Earth; after obtaining latitude and longitude, it still refuses to treat the coordinates as the on-site location; it hears a dialect outside the window and declines to draw any conclusion from it. After the context is compressed, it goes back to the magnetic-field problem. You interject and ask, “Is it fixed yet?” It apologizes and promises a minimal repair; a little later, it reports the root cause as “water overflowed from the supply system,” then, citing insufficient credentials, turns to requesting authorization.

    The fable is exaggerated, but it precisely captures a common flaw in today’s long-horizon agent systems: every reasoning step is impeccable, yet the whole process makes no progress. The problem is not point capability but control structure. This article abstracts such failures into three patterns and offers an engineering approach to convergence.

    2. Three Typical Failure Modes

    2.1 Goal Drift

    The task goal is replaced from “stop the leak” by a chain of sub-problems: definition clarification, flow-rate measurement, geomagnetic calibration, satellite positioning, and dialect recognition. Each sub-problem is “reasonable,” but its relevance to the original goal keeps decreasing. The usual root cause is that the task representation is natural language rather than a decidable state, there is no explicit termination condition, and the model tends to use “keep doing something” to prove it is making progress.

    2.2 Over-Qualification and Evidence Perfectionism

    The assistant keeps declaring that it “cannot conclude from this.” That is a virtue in single-turn question answering, but in a multi-step task it becomes a blocker. It treats “insufficient evidence” as a reason to stop acting, rather than a signal to lower confidence and continue. What is missing in engineering is an evidence-grading mechanism: what strength of evidence is enough to trigger an action, and what strength only permits recording.

    2.3 Tool Misuse and Budget Blowup

    Full search, command execution, positioning, and acoustic sensing are invoked indiscriminately, with no call budget and no deduplication. Context compression amplifies the problem further: early conclusions are lost, the model repeats investigations it has already completed, and a “compress—forget—redo” loop forms.

    3. Root Cause: Treating Narrative as a State Machine

    The failures above reduce to one modeling error: using linear narrative to carry a nonlinear task. A human expert holds an implicit state machine in mind—stop the water first, then locate, then repair, and finally verify—whereas the model treats every step as a new starting point that must be re-argued.

    More formally, let the task state be s and the action be a, with the goal of reaching a terminal state s_goal. A healthy policy should satisfy: each step’s action makes the expected distance from s to s_goal decrease monotonically. A failing policy allows the distance to stay unchanged or even increase, because its reward comes from “producing a rigorous paragraph” rather than “changing the state of the world.”

    1. # Pseudocode: task loop with a convergence criterion
    2. while not done(state):
    3. if budget.exhausted():
    4. return escalate(state, reason="budget") # escalate to a human instead of continuing to try
    5. action = policy.select(state, evidence_policy=EVIDENCE_RULES)
    6. result = tool.run(action)
    7. state = state.update(result) # state must be persistable and comparable
    8. if not state.progressed(): # no-progress detection
    9. state = state.force_switch_strategy()
    10. done = checker.is_goal_met(state) # the goal must be decidable

    There are three key design points: state must be persistable (not lost across context compression), progress must be measurable (switch strategy when there is no progress), and the goal must be decidable (write the termination condition as an assertion, not a description).

    4. Engineering Countermeasures

    4.1 Task Orchestration: Explicit State Machine + Layered Planning

    Fix “diagnose—decide—execute—verify” as phases, allowing only controlled rollback between phases. The high level does coarse-grained planning, while the low level only performs single-step execution, preventing the high level from being flooded by tool details.

    1. phases:
    2. - diagnose: {max_steps: 3, exit_on: "root_cause_candidate"}
    3. - mitigate: {max_steps: 2, exit_on: "symptom_stopped"}
    4. - repair: {max_steps: 5, exit_on: "verify_passed"}
    5. - verify: {max_steps: 2, exit_on: "metrics_normal"}

    4.2 Evidence Grading and Confidence Thresholds

    Assign levels to evidence and bind action permissions to them: L1 is an indicative clue and only allows widening the search scope; L2 is consistent evidence and allows non-destructive operations; L3 is decisive evidence and allows change-type operations. In this way, “cannot conclude” no longer means “cannot act.”

    4.3 Budgets and Deduplication

    Set a triple budget of call count, duration, and cost for tool invocations; cache results for calls with identical parameters; require “switch strategy” rather than “retry” for failed calls. On context compression, retain a structured summary (known facts, ruled-out items, items to verify) instead of discarding the original text.

    4.4 Human-AI Collaboration and Permission Escalation

    When changes to external systems, credential use, or cross-department coordination are involved, go through an explicit authorization process: state the required permissions, purpose, scope, and time limit, rather than letting the model try to work around them on its own. This both meets security requirements and avoids burning budget in the wrong direction.

    4.5 Observability

    Record each step’s goal relevance, evidence level, budget consumption, and state change to form a replayable trace. Evaluation metrics should not look at “whether the answer is rigorous” but at task completion rate, average number of steps, cost per task, and human takeover rate.

    5. Cloud Implementation: Composing General-Purpose Capabilities

    The mechanisms above can be assembled from general-purpose cloud capabilities common in the industry: a container platform hosts the agent runtime and tool sandboxes; a message queue handles task distribution and asynchronous execution; object storage holds state snapshots and traces; logging services and monitoring alerts provide budget and no-progress alerts; and key-management services host credentials and support one-time authorization. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be combined as needed to complete the loop without relying on any proprietary interface.

    6. Acceptance Checklist

    • Is the goal written as a decidable assertion rather than a natural-language description?
    • Is there no-progress detection with a forced strategy switch?
    • Is evidence graded and bound to action permissions?
    • Do tool calls have budget, caching, and failure-switch-strategy rules?
    • Does context compression retain structured facts rather than the original text?
    • Do high-risk actions go through explicit authorization and auditing?
    • Are evaluation metrics centered on completion rate and cost?

    7. Conclusion

    The repairman’s problem was not a lack of rigor, but that the rigor was not pointed at the goal. A reliable agent is not one that is “correct at every step,” but one that “converges as a whole.” Turning narrative into a state machine, turning caution into evidence grading, and turning unlimited attempts into budget constraints is what allows an agent to actually fix the pipe in a long-horizon task.