AI Agent Goal Drift and Minimal Repair: A Practical Guide to Evidence and Budget Control

    This article uses a plumber who forgets to fix the leak as a metaphor for common AI agent failure modes: goal drift, broken evidence chains, missing budget and context management, and over-broad permissions. It breaks down four systemic defects behind these failures and translates them into engineering mechanisms, including goal anchoring with decidable stop conditions, evidence grading and promotion rules, budget limits with staged summaries, minimal repair with regression checks, and fine-grained authorization with human gates. A reusable troubleshooting workflow and evaluation metrics are also provided to help teams keep agents aligned with the original objective across noisy, multi-turn tool use.

    1. A Metaphor: The Repair Technician Who Forgot to Fix the Pipe

    Imagine a pipe is leaking in your home, so you call a repair technician. After arriving, he first performs semantic clarification: what counts as a “pipe,” what counts as “water,” and what counts as a “leak.” Ten minutes later, he says the exhaustive search failed, insists on re-inspecting the specified locations, and emphasizes that “a failed search does not mean there is no pipe.” Twenty minutes after that, he reports elevated humidity somewhere but proactively states that this is only a directional clue and not decisive evidence. He then finds flowing water inside the pipe and measures the flow rate, while noting that “flowing water” does not equal “a leak,” and certainly does not imply the pipe material. When the flow measurement fails, he suspects external magnetic interference; when localization fails, he declares that “localization failure” does not imply “I am not on Earth.” Next, he obtains latitude and longitude but says the coordinates cannot be treated directly as the on-site position and that he must observe the facilities outside the window. Hearing a regional dialect outside, he again states that the dialect cannot prove the location, let alone the local geomagnetic intensity. After context compression, he is still working on the geomagnetic problem. You interrupt and ask, “Is the leak fixed?” He apologizes and promises root cause confirmation and a minimal repair. The final root cause he gives is that “some of the water output by the municipal water plant overflows outside the water supply system.” He is then rejected by the water supplier due to insufficient credentials, so he asks the user for credentials and requests “full access” to communicate with the other party.

    This narrative is almost a complete sample of how current agent systems fail. It is not a failure of capability, but a failure of goal management and evidence governance.

    2. Problem Breakdown: Four Systemic Defects

    2.1 Goal Drift

    The task goal gradually shifts from “stop the leak” to “clarify definitions,” “run an exhaustive search,” “measure humidity,” “measure flow rate,” “calibrate the geomagnetic field,” and “confirm the position.” Each step is locally reasonable, but the global return diminishes. The root cause is the lack of an explicit goal anchor and termination conditions. The model tends to treat “what can be done” as “what should be done.”

    2.2 Broken Evidence Chains and the Side Effects of Over-Defensive Inference

    The technician repeatedly states that “this cannot be concluded,” which is correct for suppressing hallucination. But overuse leaves the system in an undecidable state: every piece of evidence is downgraded to a clue, and no evidence can be promoted to a conclusion. Engineering requires evidence grading and promotion rules, not blanket denial.

    2.3 Missing Budget and Context Management

    Multiple rounds of tool calls accumulate many intermediate conclusions. After context compression, early constraints are lost and the task focus drifts. Without token, time, and call-count budgets and staged summaries, the system cannot converge within limited resources.

    2.4 Permission Overreach and Coarse Authorization Design

    The final request for “full access” is a typical case of expanding permissions in the name of “task needs.” The principle of least privilege requires splitting authorization into auditable, fine-grained capabilities and adding human confirmation for high-risk actions.

    3. Engineering Solutions: Translating the Metaphor into Mechanisms

    3.1 Goal Anchoring and Decidable Termination

    Fix the goal and acceptance criteria in the system prompt and task state. Any subtask must explicitly state how it contributes to the goal.

    1. goal: Stop the leak and verify dryness
    2. acceptance:
    3. - Humidity in the target area stays below the threshold for 30 consecutive minutes
    4. - No new seepage points appear
    5. stop_conditions:
    6. - Acceptance passed
    7. - Budget exhausted
    8. - High-risk authorization required

    3.2 Evidence Grading and Promotion Rules

    Grade evidence into three levels: clue, support, and decisive. Define how many independent sources are required for promotion, avoiding both extremes of “always downgrade” and “conclude from a single point.”

    1. level: clue | support | decisive
    2. promote_rule: >=2 independent sources && reproducible

    3.3 Budget Constraints and Staged Summaries

    Set hard limits on call counts, elapsed time, and tokens. Produce a structured summary at each stage, and when compressing, retain the goal, excluded items, items to verify, and authorization status.

    3.4 Minimal Repair and Regression Verification

    Locate the root cause first, then make the minimal change. After the change, regression verification is mandatory; fixing only the surface is prohibited. Changes should be rollback-capable, and verification evidence should be retained.

    3.5 Fine-Grained Authorization and Human Gates

    Split “full access” into independent capabilities such as read, write, and external communication. Actions involving external communication, irreversible operations, or third-party credentials must go through human confirmation and audit logging.

    4. A Reusable Troubleshooting Workflow

    1. Clarify the goal and acceptance criteria, and lock the invariants.
    2. Build a hypothesis list with priorities, and run low-cost, high-information checks first.
    3. Label each hypothesis with an evidence level and a decision threshold.
    4. Set budgets and escalation or exit conditions.
    5. After root cause confirmation, perform the minimal repair.
    6. Run regression verification and archive the evidence chain.
    7. When a high-risk action is triggered, enter the human gate.

    5. Evaluation Recommendations

    Use metrics such as goal retention rate, ineffective call ratio, evidence promotion accuracy, convergence rate within budget, overreach interception rate, and regression pass rate. Build an adversarial test set with distractors such as humidity, dialect, and coordinates to test whether the system can hold the original goal across multiple rounds of noise. If platform-side support is needed, industry-standard logging services, monitoring and alerting, and container platforms can carry observability and canary regression.

    6. Conclusion

    Every cautious step by that technician deserves recognition, but an engineering system cannot converge on caution alone. Reliability comes from institutionalizing five things: goal, evidence, budget, repair, and authorization. If this set of mechanisms is carried by the foundational capabilities of a platform such as Baidu AI Cloud, teams can focus more on acceptance criteria and domain knowledge instead of repeatedly firefighting.