Evaluating Long-Horizon AI Agents: Metrics and Interpreting Results

    As AI agents evolve to handle complex, multi-step operations, evaluating their performance requires moving beyond simple Q&A accuracy to end-to-end task completion. This article explores the unique characteristics of long-horizon agent tasks, breaks down core evaluation metrics including command execution reliability, steerability, and net improvement rates, and provides a practical engineering guide for building an internal evaluation framework. Readers will learn how to interpret benchmark rankings accurately and avoid common evaluation pitfalls.

    1. Why Long-Horizon Agent Evaluation Matters

    The fundamental difference between an AI agent and a standard Q&A model is that an agent can plan steps, call tools, observe execution results, and modify its next action based on feedback. Evaluating single-turn Q&A only checks whether a single response is correct, whereas agent tasks often require dozens or even hundreds of steps. A mistake in any step can cause the entire task to fail. Therefore, the focus of evaluation must shift from “is the answer correct” to “can the task be completed.”

    Long-horizon tasks typically have the following characteristics:

    • Multi-level goals: The overall objective must be broken down into sub-goals, often with dependencies between them.
    • State-changing environments: The environment changes as the agent operates, meaning early decisions affect the available action space later on.
    • Noisy feedback: The environment provides noisy feedback, such as command errors, timeouts, or file contents not matching expectations.
    • Final-state success criteria: Success is usually determined by the final environment state—such as whether a file was generated, a configuration took effect, or a test passed—rather than the fluency of the output text.

    Understanding these characteristics is a prerequisite for interpreting any agent evaluation results.

    2. Evaluation Subjects and Sample Sources

    The evaluation subjects are typically a group of configured models or agent systems, each running within the same set of tasks and the same tool environment. Using the “same environment” is critical; otherwise, the performance of different systems cannot be compared fairly.

    Sample sources generally fall into three categories:

    1. Fixed Task Sets: Pre-designed by evaluators with standard answers, covering scenarios like document processing, code modification, data organization, and daily Q&A. The advantage is reproducibility, but the disadvantage is susceptibility to targeted optimization.
    2. Real Conversation Samples: Extracted from real user long-horizon task conversations, anonymized, and executed uniformly. The advantage is close alignment with actual usage, but the disadvantage is that task difficulty and distribution are difficult to control.
    3. Adversarial and Boundary Samples: Intentionally injecting exceptions like timeouts, insufficient permissions, or missing information to test the system’s fault tolerance.

    When a leaderboard mentions the number of conversations, readers should ask three questions: Are the samples deduplicated? How are the task categories distributed? Was the same task run multiple times at different times? A large sample size reduces randomness, but if the category distribution is skewed, the overall ranking may mask shortcomings in certain scenarios.

    3. Core Metrics Breakdown

    3.1 Shell Command Execution Reliability

    Shell command execution reliability measures an agent’s ability to correctly organize and execute commands in a terminal environment. It typically includes the following dimensions:

    • Syntax correctness: Can the command be correctly parsed by the interpreter? Are parameter orders and quotes used properly?
    • Environment awareness: Does the agent verify paths, permissions, and dependencies before execution?
    • Error recovery: If a command fails, can the system read the error message and make a reasonable retry or use an alternative plan?
    • Side-effect control: Does the agent avoid unnecessary deletions, overwrites, or permission changes?

    In evaluations, reliability is often expressed as the “proportion of commands successfully executed on the first try within a task” or the “final task pass rate.” These two metrics mean different things: the former reflects single-step quality, while the latter reflects end-to-end capability. A system might have a high single-step success rate but fail entirely because of a single mistake at a critical step. Therefore, both metrics need to be considered.

    3.2 Steerability and Course Correction

    Steerability refers to an agent’s ability to adjust its plan promptly when it receives new instructions, discovers a deviation midway, or when the user modifies the goal, rather than stubbornly following the original path.

    This capability can be broken down into three questions:

    1. Upon receiving a new instruction, does the system correctly identify its priority? For example, does it override the original goal or act as a supplementary condition?
    2. When the system realizes it is going in the wrong direction, can it stop, backtrack, and explain the reason for the deviation?
    3. After adjusting, does the system preserve intermediate results that are still valid to avoid redundant work?

    In evaluation design, a modification request can be injected midway through a task to observe whether the system’s subsequent behavior aligns with the new requirement. This type of test reveals planning strength better than simply looking at the final result.

    3.3 Net Improvement Rate

    The net improvement rate is a common summary metric on leaderboards used to describe the overall change of a new version relative to a baseline version. Its general definition is:

    Net Improvement Rate = (Improved Tasks − Degraded Tasks) ÷ Total Tasks Compared

    This definition has two key points. First, it focuses on task-level win/loss changes rather than tiny gaps in average scores. Second, it simultaneously reflects “how much it improved” and “how much it worsened,” avoiding the pitfall of only looking at the number of improvements while ignoring regressions.

    Leaderboards often use the term “percentage point.” If one version has a certain net improvement rate and another has a lower one, the difference between them is the percentage point difference. Note that a percentage point is the difference between two percentages and is not equivalent to a relative increase. For example, going from 1% to 2% is an increase of 1 percentage point, but a relative increase of 100%. When reading reports, these two concepts must be distinguished.

    3.4 Meaning of Blind Test Rankings

    A Blind Test refers to evaluators comparing two or more outputs without knowing which system generated them, providing preference judgments. Blind testing reduces the interference of brand impressions and expectations on judgments.

    Blind test results are typically converted into rankings using pairwise comparison statistical models, with common methods including Elo ratings and Bradley-Terry type models. The core idea of these methods is: winning against strong opponents is more valuable than winning against weak ones. Therefore, the ranking depends not only on the win rate but also on the strength distribution of the opponents.

    It is important to note that blind test rankings usually measure “human or reviewer preference.” While correlated with task success rates, they are not identical. A system with a more popular response style might not necessarily be more reliable at executing tasks. Therefore, blind test rankings and task pass rates should be read in conjunction.

    4. How to Read Benchmark Rankings

    When reading leaderboards, readers can check the following in order:

    1. Grouping criteria: Is the ranking calculated among all participating models or only within a specific category (e.g., open-weight models)? The same model might rank very differently under different groupings.
    2. Task categories: What tasks are included in categories like work, programming, and chat? Is the weighting balanced?
    3. Sample sources: Does the data come from real conversations? Has it been anonymized and deduplicated?
    4. Time range: What is the cutoff date for the ranking? Models iterate quickly, so outdated data has limited reference value.
    5. Confidence intervals: Are statistical errors or confidence intervals provided? The difference between adjacent systems in the rankings might just be statistical noise.

    Additionally, leaderboards from different organizations or platforms generally cannot be directly compared because their task sets, scoring criteria, and statistical methods differ. Comparisons should only be made within the same leaderboard.

    5. Building an Internal Evaluation Framework

    If a team wants to evaluate its own agent system, they can build a lightweight evaluation framework following this process.

    5.1 Task Set Design

    Each task should contain the following fields:

    • Task description: The goal stated in natural language.
    • Initial environment: File structure, data contents, and list of available tools.
    • Validation rules: Criteria to determine success based on the final environment state, such as checking a file’s hash value, a specific configuration value, or the output of a command.
    • Difficulty and category tags: To facilitate grouped statistics.

    The number of tasks doesn’t need to be large initially, but it should cover main scenarios and maintain a reproducible initial state for each task.

    5.2 Execution Sandbox and Isolation

    Agent command execution carries security risks, so the evaluation environment must be isolated from production environments and personal devices. Common practices include:

    • Running each task in an independent container or virtual machine, destroying it entirely after the task ends.
    • Restricting network access to only the necessary addresses for the task.
    • Setting resource limits, including CPU, memory, disk, and timeouts for individual commands.
    • Prohibiting the use of high-privilege accounts to run tasks.

    5.3 Scoring and Recording

    Scoring should be as automated as possible. After each task, the scoring script reads the environment state and outputs structured results while recording the complete operational trajectory for post-hoc review. The trajectory should include the command, exit code, output summary, and duration for each step.

    Below is a simplified example showing how to execute a single command in an isolated environment and record the result. In actual use, commands should run in a sandbox like a container, and the caller should strictly validate the command source.

    1. import subprocess
    2. import time
    3. from dataclasses import dataclass, asdict
    4. @dataclass
    5. class StepRecord:
    6. command: str
    7. exit_code: int
    8. timed_out: bool
    9. duration_s: float
    10. stdout_tail: str
    11. def run_step(command: str, timeout_s: int = 30) -> StepRecord:
    12. """Execute a command in an isolated environment and return a structured record."""
    13. start = time.monotonic()
    14. try:
    15. proc = subprocess.run(
    16. ["/bin/sh", "-c", command],
    17. capture_output=True,
    18. text=True,
    19. timeout=timeout_s,
    20. )
    21. exit_code, stdout, timed_out = proc.returncode, proc.stdout, False
    22. except subprocess.TimeoutExpired as exc:
    23. exit_code, stdout, timed_out = -1, (exc.stdout or ""), True
    24. duration = time.monotonic() - start
    25. return StepRecord(
    26. command=command,
    27. exit_code=exit_code,
    28. timed_out=timed_out,
    29. duration_s=round(duration, 3),
    30. stdout_tail=stdout[-500:],
    31. )
    32. def score_task(records: list[StepRecord], goal_satisfied: bool) -> dict:
    33. """Calculate basic metrics for a single task."""
    34. total = len(records)
    35. ok_steps = sum(1 for r in records if r.exit_code == 0 and not r.timed_out)
    36. return {
    37. "task_passed": goal_satisfied,
    38. "step_success_rate": ok_steps / total if total else 0.0,
    39. "steps": [asdict(r) for r in records],
    40. }

    In the example, goal_satisfied should be provided by an independent validation function based on the environment state, not declared by the agent itself. This prevents inflated results caused by systems “self-evaluating.”

    5.4 Result Aggregation

    During the aggregation phase, the following data should be output simultaneously:

    • Task pass rate, grouped by category and difficulty.
    • Single-step success rate and average number of steps, to observe efficiency.
    • Degraded task list, i.e., tasks passed by the baseline version but failed by the new version.
    • Net improvement rate, calculated according to the previous definition.

    The degraded task list is often more valuable than the overall numbers. After each version iteration, the team should prioritize reviewing these tasks to confirm whether the failure causes are known risks.

    6. Common Pitfalls

    1. Looking only at total scores, not subgroups: A system with a high total score might be significantly weak in certain critical scenarios.
    2. Treating accidental success as capability: Succeeding once on the same task does not mean it is stable and reliable. It is recommended to run each task multiple times and calculate the distribution of success rates.
    3. Ignoring environmental changes: Network latency, dependency versions, and temporary files can all affect results. Environment versions should be fixed before evaluation.
    4. Using model self-evaluation instead of external judgment: The model believing it completed the task does not mean the task was actually completed.
    5. Mixing data from different sources: Different leaderboards use different task sets and statistical methods; directly comparing values leads to incorrect conclusions.

    7. Implementation Advice

    For most teams, a safer path is to first establish a small task set of 20 to 50 typical tasks covering the most common business scenarios, and write the validation rules as executable scripts. Subsequently, run the same evaluation after every model or prompt adjustment to compare pass rates and degraded tasks. Once the task set is stable, gradually introduce adversarial samples and mid-task instruction modifications to test steerability.

    The purpose of evaluation is to support decision-making, not to pursue a pretty number. As long as metrics are clearly defined, environments are reproducible, and results are traceable, evaluation conclusions can provide a reliable basis for model selection, version release, and risk control.