arXiv:2610.06563cs.AIOct 2026

Manuscript Offprint

arXiv:2610.06563

HERA: Harness-Environment Co-Evolution for Reliable Agentic Abstention

Han Luo, Bingbing Wen, Guang Yang, Zora Zhiruo Wang, Pan Lu, Lucy Lu Wang

ABSTRACT

Large language model (LLM) agents are increasingly capable of acting in complex tool-use environments, yet they often fail to recognize when tasks are infeasible and no valid solution exists. Recent work has formalized this reliability gap as the problem of agentic abstention, and existing approaches typically optimize a model or agent harness against a fixed set of tasks, leading to limited generalization to unseen failure modes. We introduce HERA, a framework for harness-environment co-evolution for agentic abstention. HERA consists of (i) a pipeline to automatically construct verifiable pairs of feasible and infeasible tasks by applying controlled environment mutations that transform solvable tasks into cases requiring abstention, and (ii) a co-evolution procedure in which performance failures on previous tasks are used to drive harness adaptation and generate new execution environments and tasks geared towards previous weaknesses. On held-out evaluation tasks, an evolved harness from HERA improves abstention accuracy from 61.7% to 83.3% while improving feasible-task completion from 68.3% to 76.7%, achieving the highest abstention and feasible-task completion among the compared methods. The resulting best harness transfers across 19 other LLMs, improving abstention accuracy by 15.3 percentage points on average without any model-specific optimization, and enabling smaller models to match the performance of more powerful models at an estimated 85% lower cost.

1 INTRODUCTION

Large language model (LLM) agents are increasingly capable of solving complex tasks through multi-step interactions with tools and external environments (Merrill et al., 2026; Yao et al., 2022), yet their reliability still lags behind in many areas. Recent work on agent reliability has identified agentic abstention (Luo et al., 2026; Liu et al., 2026) as a key challenge: agents often fail to recognize when they should stop and instead continue acting even when a request is underspecified or the environment lacks the prerequisites for successful execution. This ability to recognize appropriate stopping is essential, as continuing to act when a task cannot or should not be completed can degrade task performance (Wan et al., 2026; Sui et al., 2026), incur unnecessary API costs and latency (Lou et al., 2026), and even lead to unintended or irreversible actions (Zhang et al., 2026a). Prior work has improved agent capability through (i) methods that optimize the model directly, e.g., through supervised fine-tuning, reinforcement learning, or online policy optimization (Agarwal et al., 2026; Chen et al., 2026b;a), and (ii) methods that keep the model fixed and instead optimize the agent harness around it, which governs context construction, memory and skills, tool use, action validation, and the control logic for continuing, recovering, or stopping execution (Shao et al., 2026; Wang et al., 2026; Karten et al., 2026). The former has received considerable attention, whereas the role of harness optimization in agentic abstention remains largely unexplored.

Optimizing a harness against a fixed set of tasks can only expose a limited set of failures. As the harness adapts to failures exposed by those tasks, the same examples provide diminishing signal about

∗^{*}Equal contribution.

where the harness still fails. Continued improvement requires the task distribution itself to adapt, evolving new cases that challenge existing capabilities. This idea parallels recent work on adaptive data generation, in which model performance is used to iteratively refine the data-generation process and expose new learning opportunities (Meng et al., 2026). For agentic abstention, we therefore consider a setting in which harness optimization and environment/task generation co-evolve, where agent failures shape improvements to the harness and elicit more challenging tasks for the agent.

This is the primary motivation for our work. We introduce HERA, a framework for harness–environment co-evolution for agentic abstention. HERA proceeds in two stages. In Stage 1, building on methods from Dong et al. (2026), we construct executable environments and tasks with verified reference solutions. We then introduce a new environment-mutation procedure for constructing infeasible tasks, transforming feasible tasks into matched cases requiring abstention. Each pair of feasible-infeasible tasks shares the same task request, while the environment mutation determines whether the request can be completed. In Stage 2, using the task data construction procedure in Stage 1, HERA alternates environment evolution and new task construction with harness adaptation. For each round of co-evolution, we analyze paired execution trajectories to identify both failures to complete feasible tasks and failures to abstain on infeasible tasks. These failures guide targeted harness changes to environment states, tool behavior, or constraints, followed by new environment-task modification and validation. After each round, an updated harness provides failure feedback for the next round, allowing environment generation to respond to the agent's changing weaknesses and vice versa.

We use HERA to produce a challenging evaluation set for agentic abstention, which we call HERA-BENCH. We then execute HERA using GPT-5.6-Luna as our base task-execution model. We apply the final evolved harness across 19 other LLMs on HERA-BENCH, where it improves abstention and paired success by an average of 15.3 and 12.5 percentage points, respectively, without further model-specific optimizations. We further analyze inference costs for 14 models and find that, despite the additional overhead of the evolved harness, HERA can enable less expensive models to achieve comparable performance to more costly models at significantly lower overall cost.

We also compare HERA against baselines such as abstention prompting, harness-only optimization, and alternative task-expansion strategies. Each method's final harness is evaluated on our cumulative training pool and HERA-BENCH. Across cumulative training sets, HERA matches or outperforms all compared baselines, reaching 86.0% abstention success and 78.0% paired success on the final 50-pair pool. On HERA-BENCH, HERA improves abstention success from 61.7% to 83.3% and paired success from 48.3% to 70.0% relative to the base harness.

In summary, our key contributions are as follows:

• Benchmark for agentic abstention. As part of HERA, we introduce a controlled environment-mutation pipeline for constructing matched feasible-infeasible task pairs in executable tool-use environments, where infeasible instances require the agent to abstain. Using this pipeline, we construct HERA-BENCH, a benchmark of 60 verified task pairs for evaluating whether agents appropriately act when tasks are feasible and abstain when they are infeasible.

• Harness–environment co-evolution. HERA then combines verifiable task construction with failure-driven environment evolution and harness adaptation. On the final training pool, HERA achieves 86.0% abstention success and 78.0% paired success, exceeding the next-best baseline by 10.0 percentage points on both metrics. These results support the necessity of both harness and environment/task updates, as well as multiple iterations for both.

• Transferable improvements in agentic abstention. On held-out tasks in HERA-BENCH, the final harness from HERA increases abstention success from 61.7% to 83.3% and paired success from 48.3% to 70.0%. Across 19 additional LLMs, the same final harness improves these metrics by an average of 15.3 and 12.5 percentage points without further optimization. These findings indicate that harness improvements generalize beyond the model used during development.

• Performance–cost trade-offs. We analyze API costs and token usage across 14 models, examining the additional inference overhead of harness adaptation and differences between model configurations. HERA enables less expensive models to achieve performance gains approaching more costly models. For example, GPT-5.6-Luna with HERA matches the 70.0% paired success of base GPT-6-Astra at an estimated 85% lower API cost per episode.

2 RELATED WORK

Agentic Abstention. LLM abstention is defined as a model's decision to refrain from answering under uncertainty (Wen et al., 2025; Kirichenko et al., 2025; Wen et al.; 2024). Existing studies of LLM abstention can be broadly grouped by why abstention is warranted: insufficient information in the query or available context (Cao et al., 2026; Kwiatkowski et al., 2019; Trivedi et al., 2022; Reddy et al., 2019; Choi et al., 2018; Min et al., 2020; Zhang & Choi, 2021; Yin et al., 2023; Amayuelas et al., 2024; Jin et al., 2019; Dasigi et al., 2021), limitations in the model's knowledge due to temporal or factual gaps (Kasai et al., 2023; Yang et al., 2024; Mallen et al., 2023; Sciavolino et al., 2021; Feng et al., 2024), and safety or value concerns that make responding inappropriate (Han et al., 2024; Gehman et al., 2020; Hartvigsen et al., 2022; ElSherief et al., 2021; Lin et al., 2023; Ji et al., 2023; Xu et al., 2023; Röttger et al., 2024; Qiu et al., 2023; Shen et al., 2024; Wang et al., 2024; 2023; Li et al., 2024; Xie et al., 2024).

Recent work has begun to shift the study of abstention from LLMs to agent settings. Luo et al. (2026) first introduce the notion of agentic abstention, asking whether agents know when to stop instead of act, and evaluate this capability across QA, web, and terminal environments. They find that current agents often fail to identify when abstention is warranted. Liu et al. (2026) similarly study agentic abstention by constructing executable environment–task pairs, where controlled changes to tasks or environments create cases in which agents should abstain rather than act. Relatedly, (Lin et al., 2026b) study a closely related stopping problem through the lens of budget awareness, asking whether agents can estimate their remaining resource requirements and identify when task completion is unlikely within the available budget. However, the environments in these works are fixed or generated independently of agent performance, whereas we use agent failures to drive environment generation and the resulting environments to iteratively improve the agent harness.

Harness Evolution. Prior work improves agents by optimizing individual parts of the external scaffold, including prompts, demonstrations, and language-model programs. (Khattab et al., 2023; Opsahl-Ong et al., 2024; Yuksekgonul et al., 2025; Agrawal et al., 2026). More recent work treats the full agent harness as the object of optimization. Meta-Harness (Lee et al., 2026) searches over harness code using execution feedback, while Agentic Harness Engineering (Lin et al., 2026a) jointly evolves components such as prompts, tools, middleware, skills, and memory, and AEVO (Zhang et al., 2026c) optimizes the procedure and context that guide subsequent agent evolution. Recent approaches further explore harness improvement through failure-driven self-refinement (Zhang et al., 2026b), learned runtime editing (Shao et al., 2026), more reliable search and generalization (Zhang et al., 2026d), and population-based evolution (Zhang et al., 2026e). Task-CoEvolve (Miyai et al., 2026) additionally adapts the selection of validation tasks as the harness changes, while recent work has also questioned whether gains from harness evolution generalize beyond the tasks repeatedly used during optimization (Wang et al., 2026).

Unlike prior harness-evolution methods, which typically improve the harness against fixed environments, we evolve the harness together with the environment–task ecosystem, adapting the latter to target weaknesses exposed by the current harness. We apply this idea to agentic abstention.

References (1)