Why AI Coding Agents Are Hard to Make Reliable
This article explains why autonomous coding agents often feel unreliable, arguing that the main issue is the gap between high-autonomy expectations and actual engineering capability rather than model intelligence alone. It identifies four root causes—error accumulation in long task chains, insufficient context engineering, weak and noisy feedback signals, and missing permission and controllability design—then shows how to make controllability a first-class feature, build observability and evaluation loops, and apply practical enterprise adoption advice.
1. The problem is not that the model is “not smart enough,” but the gap between expectations and engineering capability
In discussions about autonomous coding agents, the most common complaint is that they are “hard to use.” But blaming this simply on the limitations of the underlying model often overlooks a more important layer: these products usually set an expectation of “high autonomy”—describe a goal once, and the tool decomposes, retrieves, modifies, verifies, and delivers on its own. In actual runs, however, the agent’s reliability, controllability, and task completion quality do not necessarily keep pace. The gap between expectation and experience is the main source of disappointment.
It is worth emphasizing that “not good enough right now” and “no room for improvement” are two completely different judgments. Across common industry practice, these products have generally shifted over the past period from “conversational completion” toward “task-based execution”: placing more emphasis on task boundaries, process traceability, human confirmation checkpoints, and result verification. Whether that direction is correct ultimately depends on whether developers’ real pain points are eliminated, which requires ongoing observation rather than a conclusion drawn in advance.
2. Four root causes of the reliability problem
2.1 Error accumulation in long-chain tasks
Even with a high single-step accuracy, once it is chained through multiple steps—“understand requirements, retrieve context, make a plan, modify code, run tests, fix errors”—the overall success rate decays quickly. If a single step is 0.95, the theoretical success rate of ten chained steps is only about 0.60. This is why tasks that run smoothly in a demo often go off track midway in a real repository.
2.2 Insufficient context engineering
Key information in real engineering is often not in the current file, but in callers, configuration, historical decisions, and failure records. When the context window is limited and the retrieval strategy is crude, the agent tends to make changes based on local information that “look reasonable but actually break compatibility.”
2.3 Weak and noisy feedback signals
Without a stable, executable means of verification (builds, unit tests, static checks, end-to-end cases), the agent loses its basis for course correction. And when the tests themselves are unstable (depending on timing, external networks, shared environments), the noise gets misread as “the code has a problem,” triggering meaningless repeated modifications.
2.4 Missing permission and controllability design
High autonomy without supporting approval, canary release, and rollback mechanisms forces users to fall back on “watching the whole time.” The efficiency gains from autonomy are offset, and the experience naturally declines.
3. Making “controllability” a first-class citizen
Controllability is not about limiting capability, but about making capability trustworthy. Practical approaches include:
- Task tiering: tiered authorization for read-only analysis, local modifications, cross-module refactoring, and dependency and configuration changes, with high-risk actions requiring mandatory human confirmation.
- Plan first: produce a reviewable execution plan and impact list before entering the modification phase.
- Minimal changes: deliver in units of a patch set, prohibiting unrelated formatting and bulk renames from being mixed in.
- Full traceability: the input context, tool calls, diffs, and verification results of each step are replayable, making it easy to locate “at which step things started going wrong.”
An illustrative policy configuration (pseudocode, expressing the idea only):
policy:read_only_paths: ["docs/**", "**/*.md"]require_approval_for: ["dependency_change", "ci_config", "public_api"]max_patch_files: 8verification:must_pass: ["build", "unit_test", "static_check"]retry_budget: 2rollback: auto_on_verification_fail
4. Driving improvement with observability and an evaluation loop
Judging whether an agent is getting better cannot rely on individual cases, but on systematic evaluation:
- Build a task set: distill 100–300 reproducible tasks from real requirements, covering types such as bug fixes, small features, refactoring, and writing tests, annotated with acceptance criteria.
- Define metrics: task success rate, first-pass rate, average number of human interventions, change rollback rate, and average time and cost.
- Layered attribution: break failures down into the four stages of retrieval, planning, editing, and verification to locate weak points rather than vaguely judging that “the model is no good.”
- Regression protection: run the full task set on every product or model update to prevent “fixing one and breaking three.”
On the engineering side, common capabilities can fill the gaps: use logging services and monitoring alerts to build process observability; use a container platform to provide isolated, reproducible execution environments; use object storage to archive task artifacts and replay data; use a message queue to decouple long tasks from result delivery.
5. Enterprise adoption recommendations
- Start with low-risk scenarios (adding tests, writing documentation, refactoring logging and error handling), and expand scope after validating the benefits.
- Enforce “verification first”: any change must come with an executable means of verification, otherwise it will not be merged.
- Clear division of labor between humans and agents: the agent handles exploration and first drafts, humans handle boundaries and final decisions.
- Pay attention to data and compliance boundaries, handling sensitive code and configuration under the principle of least privilege.
6. Conclusion
The reasonable attitude toward autonomous coding agents is to neither deny their potential to evolve because of current flaws nor relax engineering constraints because of high-autonomy marketing. What truly determines success or failure is task boundaries, context quality, the verification loop, and controllability design. With the general engineering capabilities of cloud platforms such as Baidu AI Cloud as the foundation, and with evaluation and observability done solidly, developers can achieve stable, reusable efficiency gains right now, rather than waiting for some “perfect version.”
