Why do autonomous agents consistently fail when executing seemingly flawless logical operations across external enterprise tools?
The operational failure stems from uninspectable environments: a tool call can fail even when the operation behind it is correct, because the receiving tool parses delimiters, dates, or record layouts under an internal configuration the agent cannot inspect. Addressing this breakdown requires moving away from reactive error prompting toward pre-compiled policies. As researchers Jiahao Wang, Xiaoxuan Chen, Aijun Yang, and Xiaohua Wang from the State Key Laboratory of Electrical Insulation and Power Equipment at Xi’an Jiaotong University demonstrated, coordinating calibration and search within an integrated compiler resolves these integration failures while lowering the computational overhead of agent deployment.
The Breakdown of Runtime Tool Calls
When tool-using agents act by sending calls to external systems, standard logic frequently collides with rigid host parameters. For example, an agent uploading a weather table to a data-ingestion tool faces immediate rejection if a parser expecting semicolons encounters a comma-delimited file. Similarly, an uninspected parser expecting day-first dates interprets 05/04 as April 5 rather than May 4.
Because the parser's options are fixed where the tool is deployed, the agent receives only the parsed output or a bare error message. Completing the task across diverse host environments requires a policy: a deterministic plan that fixes which call to send after each response within the few calls allowed during a single execution. When candidate configurations can be reproduced in a test environment, engineering teams can compile this policy before deployment rather than absorbing API penalties in production.
Prior research approached this problem in isolation. Frameworks such as ReAct and CodeAct studied agents reacting directly to tool feedback, while algorithms like LazySP, LRA*, and GLS analyzed search efficiency when system evaluations are computationally expensive.
"Compiling a tool-use policy for such a tool requires both calibration, which evaluates candidate calls on candidate configurations, and search over the evaluated calls."
In a standard compilation setup, calibration tests a candidate call on a candidate configuration and records its effect, while search organizes those recorded effects into a policy that completes the most configurations with the fewest calls. The central friction lies in shared resource limits: calibrating every possible call across every configuration exhausts the compilation budget on execution branches that the final policy never reaches, while continuously re-solving partially evaluated models halts useful downstream execution.
Unifying Search and Calibration Budgets
To eliminate this structural inefficiency, the researchers developed CAPE, a training-free compiler designed to balance evaluation and planning dynamically. Instead of delaying deployment until an exhaustive search finishes, CAPE maintains an executable policy at all times, directing calibration strictly to calls capable of improving that baseline.
"It maintains an executable policy at all times, directs calibration to the calls that can improve this policy, and tightens bounds only where doing so ends calibration early."
By focusing only on paths that actively branch during execution, the system avoids probing dead-end states. While evaluating a candidate call, CAPE tightens its search bounds using a two-call lookahead, terminating evaluation the moment the call is ready for deployment or when it can no longer surpass the existing policy. The resulting policies preserve every configuration completed by the initial policy, certifying mathematical optimality once executable and optimistic values converge.
Empirical Performance Across Workflows
Benchmarked against standard deployment strategies, this structured compilation delivered measurable efficiency gains across structured data pipelines. On CSV and JSON workflows built from 64 requests, CAPE achieved the independently computed optimum in 502 of 504 compilations. At the same time, it required 22.0% less compilation time than eager exact search.
On larger CSV configuration families, the compiler produced policies with higher completion rates while operating under similar compilation time limits. Compared to an LLM that iteratively revises its serialization based on runtime error feedback, CAPE raised task completion by 15.38 to 34.66 percentage points.
Pre-compiled execution branches shield autonomous agents from silent integration failures across rigid data parsers without incurring open-ended runtime compute costs. As agentic architectures interface with legacy enterprise APIs, compiling adaptive tool policies before live execution replaces fragile prompting loops with verified operational bounds. The structural shift transfers error resolution from runtime inference budgets directly into controlled pre-deployment test environments.
Against the field
What actually prevents autonomous agents from seamlessly working with external enterprise tools? Traditional reactive frameworks like ReAct forced models to stumble over fixed host formats and burn API budgets blindly on live trial-and-error attempts. Researchers from Xi'an Jiaotong University tackled this differently, prioritizing pre-compiled deterministic policies over real-time guesswork. A two-step lookahead prevents wasted compilation budgets by discarding failing branches before an agent ever touches an external tool.