AI Coding Agents and Their Real Limits: Selection Logic Under Constraint Decay
This article examines why falling LLM inference costs do not automatically translate into reliable AI coding agents. It explains constraint decay—the sharp drop in assertion pass rates as structured rules accumulate—along with its causes: diluted attention budget, coupled or conflicting rules, missing executable feedback, and error compounding in long tasks. It then shows how to move constraints out of prompts and into engineering systems through specification-as-code, validators, and feedback loops, with layered prompt trimming and a SQL example. Finally, it offers a four-dimension selection framework for data teams covering constraint adherence, controllable cost, governability, and ecosystem replaceability.
1. Falling Prices and Fluctuating Capability Are Happening at the Same Time
Over the past two years, inference costs for large models have dropped by orders of magnitude. A cloud provider’s permanent price adjustment cut the API price of a certain class of general-purpose models to one quarter of the original price—not a limited-time promotion, but a long-term pricing strategy. Around the same time, the industry also saw news of large funding rounds and plans to build in-house coding toolchains. Connecting these events reveals a clear path: first use low prices to expand call volume, then use capital to fill the gap in compute and R&D, and finally use toolchains and an engineering ecosystem to keep users inside their own stack. Vendors’ goals have shifted from “selling model calls” to “selling infrastructure.”
For consumers, lower cost is a tangible gain. Publicly reported real-world tests show that with mechanisms such as prefix caching, in scenarios with very long context and a high proportion of repeated system prompts, a daily bill of hundreds of millions of tokens can drop from tens of dollars to roughly a dozen dollars, with cache hit rates staying extremely high. It is worth stressing that these numbers come from public tests in specific scenarios and cannot be directly extrapolated to all workloads, but the conclusion that costs have fallen by an order of magnitude is credible.
The problem lies on the other side. A recent systematic academic evaluation reached a rather pessimistic conclusion: as structured constraints keep accumulating, the assertion pass rate of coding agents drops significantly. Stronger configurations lose about 30% of their pass rate on average, while weaker configurations fall to nearly zero. This phenomenon can be called constraint decay. It explains a strange thing many people observe in daily work—asking a model to write a basic query almost never goes wrong, but once you require it to simultaneously follow enterprise naming conventions, a data access model, audit trails, and partition pruning rules, the output often starts to break down at the third or fourth constraint.
2. Why Constraint Decay Happens: Context Competition and Rule Coupling
Constraint decay is not the model “getting dumber,” but the result of several engineering factors stacking up.
First, the attention budget is diluted. Once constraints are piled into the context as natural language, they compete for limited attention resources. The model tends to satisfy the most prominent instructions, those closest to the end, or those that appear most frequently, while earlier constraints are gradually forgotten—which is where the word “decay” comes from.
Second, constraints are coupled and conflict with each other. Naming conventions require table name prefixes to reflect the business domain; the access control system requires views split by role; auditing requires field-level lineage; and partition rules require filter conditions to include a time column. Each rule looks reasonable on its own, but combined they form a high-dimensional solution space. Without external validation, the model can only rely on probabilistic sampling, and the further it goes, the more likely it is to sacrifice one requirement for another.
Third, there is no executable feedback signal. Natural language constraints have no compiler or tests to determine right from wrong, so the model cannot self-correct. Industry evaluations have also found clear framework sensitivity: performance is good in lightweight frameworks with very few rules, and degrades noticeably in frameworks with dense conventions and much implicit behavior. Mapped to the data domain, writing bare scripts is easy, while following data warehouse layering and modeling standards is hard.
Fourth, errors accumulate in long tasks. After multi-table joins, multi-level nesting, window functions, and business definitions stack up, deviations from earlier steps are amplified by later ones, ultimately showing up as “looks right, fails when it runs.”
3. Move Constraints Out of Prompts and Into the Engineering System
Since the root cause is constraints piling up as natural language, the most effective approach is to reduce the number of constraints the model has to remember and externalize rules as executable assets.
Natural language constraints (prone to decay)↓ externalizeSpecification as code: naming rule tables / metric definition dictionary / access matrix↓Validators: static parsing + rule engine + unit tests↓Feedback loop: error localization → targeted retry (only return relevant constraint slices)
The corresponding prompt structure should be trimmed in layers, returning only the constraint fragments relevant to the current task:
-- Bad example: all constraints stacked together, prone to triggering decay-- Must follow all standards: naming prefix, access control, audit, partition, definitions...-- Good example: constraint slice + machine validation-- Task: compute GMV of active merchants in the last 30 days-- Applicable constraint slice: dwd_order (partition column ds required, amount fields must be divided by 100)select ds, merchant_id, sum(pay_amount) / 100 as gmvfrom dwd.dwd_order_diwhere ds between date_sub(current_date, 30) and current_dateand is_deleted = 0group by ds, merchant_id;
On the engineering side, three more things can be done. First, put high-frequency, stable content into a cacheable context prefix, which reduces cost and improves stability at the same time. Second, have the agent first produce a query plan or field list, generate the statement only after it passes validation, and break one big leap into several small ones. Third, build a regression test set for each type of task, turning pass rate into a continuously observable metric.
4. A Practical Selection Framework for Data Teams
Selection should not use unit price as the sole criterion. It is better to score across four dimensions.
- Constraint adherence: the assertion pass rate on your own rule set, not public leaderboard scores.
- Controllable cost: cache hit rate, context trimming capability, and the hidden bill from failed retries.
- Governability: whether permission boundaries, audit logs, and sensitive field handling are configurable and traceable.
- Ecosystem and replaceability: whether interfaces are standardized and whether you can switch smoothly between different models to avoid being locked in by a single vendor.
The recommended path is to abstract a model gateway that unifies authentication, metering, routing, and fallback; use the same evaluation set to run canary comparisons across candidate models; and chain generation, validation, execution, and rollback into a pipeline where people confirm only at key checkpoints. As for specific infrastructure, you can use a container platform to host stateless executors, object storage to hold datasets and artifacts, a message queue to smooth out peaks, and logging services plus monitoring and alerting to track pass rate and cost curves. Baidu AI Cloud provides standard-category support for these general capabilities, but specific selection should still be based on your own test data.
5. Conclusion
Low prices solve “affordable to use”; constraint decay is a reminder of “reliable to use.” When call cost is no longer the bottleneck, real competitiveness shifts to constraint engineering, validation loops, and evaluation systems. For data teams, the pragmatic approach is to move rules from prompts into code and pipelines, replace subjective impressions with regression-based pass rate metrics, and find your own balance among cost, adherence, and governability.
