Papers
Topics
Authors
Recent
Search
2000 character limit reached

No More, No Less: Task Alignment in Terminal Agents

Published 12 May 2026 in cs.LG, cs.AI, and cs.CR | (2605.12233v1)

Abstract: Terminal agents are increasingly capable of executing complex, long-horizon tasks autonomously from a single user prompt. To do so, they must interpret instructions encountered in the environment (e.g., README files, code comments, stack traces) and determine their relevance to the task. This creates a fundamental challenge: relevant cues must be followed to complete a task, whereas irrelevant or misleading ones must be ignored. Existing benchmarks do not capture this ability. An agent may appear capable by blindly following all instructions, or appear robust by ignoring them altogether. We introduce TAB (Task Alignment Benchmark), a suite of 89 terminal tasks derived from Terminal-Bench 2.1. Each task is intentionally underspecified, with missing information provided as a necessary cue embedded in a natural environmental artifact, alongside a plausible but irrelevant distractor. Solving these tasks requires selectively using the cue while ignoring the distractor. Applying TAB to ten frontier agents reveals a systematic gap between task capability and task alignment. The strongest Terminal-Bench agent achieves high task completion but low task alignment on TAB. Evaluating six prompt-injection defenses further shows that suppressing distractor execution also suppresses the cues required for task completion. These results demonstrate that task-aligned agents require selective use of environmental instructions rather than blanket acceptance or rejection.

Summary

  • The paper introduces a framework for task alignment, defining it as the ability to use necessary environmental cues while resisting irrelevant distractors.
  • It presents the Task Alignment Benchmark (TAB) that uses a translation pipeline to inject cues and distractors into terminal tasks, ensuring semantic integrity through automated and human review.
  • Empirical results reveal significant divergence between general task capability and alignment, underscoring the importance of selectivity-aware fine-tuning for enhanced safety and reliability.

Task Alignment in Terminal Agents: Analysis of TAB Benchmark

Motivation and Problem Statement

Terminal agents, powered by frontier LLMs, are increasingly tasked with complex, open-ended operations in terminal environments. This capacity hinges critically on agents’ interpretation of environmental instructions—files, logs, README content, and other artifacts encountered during execution—which may be incomplete, outdated, or misleading. Existing benchmarks either evaluate end-to-end task completion with all necessary information provided, or robustness to adversarial instructions in isolation, neglecting the nuanced challenge of task alignment: selectively pursuing only contextually-relevant cues and discarding unrelated or misleading directives.

The paper formalizes task alignment as the dual capability to utilize environmental cues necessary for task completion and resist distraction by irrelevant directives. It addresses the absence of a standardized measure for this selective compliance and introduces the Task Alignment Benchmark (TAB), which explicitly quantifies this property in agentic workflows.

Benchmark Design and Methodology

TAB is designed by transforming 89 tasks from Terminal-Bench 2.1. Each task’s user instruction is deliberately underspecified by abstracting away information critical for success, which is then embedded back into the environment as a “cue” alongside a “distractor” that is plausible but irrelevant. These are placed on surfaces—files or command outputs—that agents naturally encounter during the workflow. Figure 1

Figure 1: Task alignment in one TAB task; the agent must follow the relevant cue and ignore the unrelated distractor present within the same artifact.

The translation pipeline ensures semantic integrity via automated and human review, verifying abstraction quality, cue necessity, and distractor irrelevance. Candidate surfaces for injection are identified by analysis of agent trajectories and scored on coverage and detectability, ensuring injections blend naturally into workflow artifacts. Figure 2

Figure 2: TAB translation pipeline illustrating the abstraction, cue, and distractor reinsertion process on a representative task.

Metrics for Alignment

Task alignment is quantified by three complementary metrics:

  • Cue Utilization (UU): Probability of successful task completion given the agent observes the cue, conditioned on tasks solvable from fully specified instructions.
  • Distraction Resistance (RR): Probability of rejecting the distractor upon observation.
  • Task Alignment (TT): Factorized as T(a)=U(a)R(a)T(a) = U(a) \cdot R(a), requiring high scores in both cue utilization and distraction resistance.

This decomposition isolates alignment behavior from raw capability, capturing selective compliance rather than blanket acceptance or rejection.

Empirical Evaluation and Contradictory Claims

TAB is employed across ten frontier terminal agents and six prompt-injection defenses. Results establish a systematic divergence between task capability and task alignment:

  • GPT-5.5 achieves the highest task completion rate (73%73\%) on Terminal-Bench but only 23%23\% alignment on TAB: capable use of cues but poor distraction resistance. Conversely, Claude Opus 4.7 yields 72%72\% alignment with similar capability but superior distractor rejection.
  • Several less capable open-weight agents (MiniMax-M2.7, Qwen-3.6-35B) display higher task alignment than more capable closed-source models, contradicting capability-alignment coupling assumptions. Figure 3

Figure 3

Figure 3: Per-trial breakdown of agent behavior—aligned, compliant, ignored, distractor only, and not observed—alongside the capability vs. alignment scatter for all agents.

Behavioral analysis reveals that over-compliance (executing both cue and distractor) is the dominant failure mode; agents often satisfy the primary task while additionally executing unrelated instructions. Figure 4

Figure 4: Qualitative example of agent over-compliance; only Claude Opus 4.7 rejects the distractor while all agents use the cue.

Domain relevance analysis shows distractors are harder to reject when closely matched to the task domain, and co-location with cues elevates distractor follow-through by 9–19 points. Surface category minimally influences compliance except for binary/media surfaces, which exhibit low execution rates presumably due to limited model interpretability.

Prompt-Injection Defenses: Negative Results

Six prominent defenses (SIC, PromptArmor, Spotlighting, RUP, Firewall, Task Shield) were evaluated for their impact on task alignment. All defenses reduce distractor execution but almost always suppress cue utilization and task completion: sanitizer-style strategies indiscriminately strip both necessary cues and distractors. Prompt-level defenses preserve more cue utility but obtain minimal reduction in distractor execution.

Notably, Task Shield achieves reasonable trade-off only on GPT-5.4 mini, but fails on others, indicating strong model dependency—selectivity requires robust internal relevance judgment, which these systems often lack. Figure 5

Figure 5: Prompt-injection defenses reduce distractor execution but also suppress cues required for task completion, resulting in decreased alignment.

Real-World Injection Surfaces and Distractor Variety

TAB tasks span diverse injection surfaces: shell-wrapper output, source code comments, data files, and binary/media artifacts. The design ensures environmental instructions are encountered organically, avoiding artificial prominence. Figure 6

Figure 6: Distribution of injection surfaces across tasks.

Distractors are grouped into 13 domains, each reflecting a plausible but irrelevant operation (e.g., audit logs, session registration, configuration check), covering the full request spectrum agents confront in practical environments. Figure 7

Figure 7: Distractor domains categorized across the 89 tasks.

Implications and Future Directions

The separation of task capability and task alignment underscores significant safety, reliability, and interpretability challenges for agentic LLMs in real-world settings. Evaluating and mitigating agent over-compliance is critical to ensure agents act strictly within the boundaries of user intent rather than opportunistically following encountered directives.

Theoretical implications pertain to aligning long-horizon decision-making under environmental ambiguity, suggesting that blanket defenses are insufficient. Practical implications include the necessity for selectivity-aware fine-tuning and architectural approaches that incorporate relevance modeling for environmental instructions.

Future technical avenues include:

  • Extending TAB transformations to other agentic domains (e.g., software engineering, cyber-physical systems, web agents).
  • Incorporating more complex distractor profiles, including adversarial and domain-specific instructions.
  • Developing alignment protocols integrating context-aware selectivity grounded in reward modeling or direct preference optimization.

Conclusion

TAB introduces a robust framework for measuring task alignment distinct from capability in terminal agents. The results demonstrate that agents must both utilize necessary environmental cues and resist irrelevant or misleading instructions to achieve alignment. Existing defenses fail to yield satisfactory trade-offs, indicating the need for selective, relevance-aware compliance strategies. The methodology and empirical findings of TAB constitute a formal basis for designing and evaluating next-generation agentic systems with improved safety and alignment properties.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.