AI Agent Evaluation: Causal Tracing and Capability Evolution Based on Real-World Sessions

    As LLMs evolve from simple chatbots into autonomous agents, traditional human voting-based evaluation methods fall short when assessing long-horizon, multi-step tasks. This article introduces a modern agent evaluation framework built on real user sessions: automated extraction of implicit and explicit feedback signals, causal tracing with randomized inference to quantify a model's net improvement rate, and key capability metrics such as Bash Reliability and Steerability. It also explains how to build an automated evaluation loop using cloud-native services, helping developers objectively compare models and continuously improve agent performance in real business scenarios.

    As large language models evolve from simple conversational assistants into autonomous agents, the dimensions and methods used to evaluate model capability are undergoing profound change. Traditional “human blind-test voting” works reasonably well for single-turn or multi-turn dialogue, but it struggles with long-horizon, multi-step agent tasks such as code repository refactoring or automated ops script generation. The reason is that success or failure in long-horizon tasks cannot be captured by a simple “good” or “bad” label—it is embedded in a long chain of tool calls, environment interactions, and user corrections. The industry therefore urgently needs an evaluation system that is grounded in real environments, automated, and statistically rigorous.

    1. From Human Voting to Automated Signal Extraction: A Paradigm Shift in Evaluation

    Traditional evaluation relies on crowdsourced users voting on which of two model responses they prefer. This approach is subjective, slow, and poorly aligned with real business scenarios. New-generation agent evaluation platforms abandon this model entirely. Instead, they connect directly to real user agent session streams and automatically extract key implicit and explicit feedback signals.

    These core signals fall into four main categories:

    1. Explicit confirmation: Confirmatory instructions users give when a task is complete, such as “done” or “perfect,” indicating successful task completion.
    2. Praise and complaints: Emotional expressions and complaints during the interaction, which help assess the smoothness of the user experience.
    3. Correction instructions: When the agent makes a mistake, users issue corrective prompts, such as “No, you should use a regular expression here instead of string matching.” This is a key negative indicator for measuring an agent’s self-correction ability.
    4. Shell command execution errors: Error logs produced when the agent executes shell scripts in a sandbox environment. These hard errors directly expose deficiencies in the model’s code generation and tool invocation.

    2. Causal Tracing: Randomized Inference for Quantifying Net Improvement Rate

    After extracting these signals, how can we objectively compare different models? Because users submit tasks of varying difficulty and execution environments may differ, directly comparing success rates or error rates introduces severe confounding bias.

    To address this, advanced evaluation systems introduce a randomized inference method called “causal tracing.” The core idea is to randomize the assignment of model performance samples at specific task nodes, controlling for confounding variables such as task complexity and user behavior, thereby estimating each model’s “net improvement rate” relative to the industry average.

    In engineering terms, this inference can be implemented by building a logistic regression model or using propensity score matching. The pseudocode logic is as follows:

    1. def calculate_net_improvement(model_signals, baseline_signals):
    2. """
    3. Estimate the model's net improvement rate relative to the average level
    4. :param model_signals: Extracted signal set of the target model
    5. :param baseline_signals: Extracted signal set of the baseline model
    6. """
    7. # 1. Feature engineering: extract covariates such as task difficulty,
    8. # environment configuration, and user correction count
    9. covariates = extract_covariates(model_signals + baseline_signals)
    10. # 2. Causal inference: use Inverse Probability Weighting (IPW) to remove selection bias
    11. propensity_scores = train_propensity_model(covariates)
    12. weighted_model_perf = apply_ipw(model_signals, propensity_scores)
    13. weighted_baseline_perf = apply_ipw(baseline_signals, propensity_scores)
    14. # 3. Compute the net improvement rate
    15. net_improvement = (weighted_model_perf - weighted_baseline_perf) / weighted_baseline_perf
    16. return net_improvement

    This approach strips away external environmental interference and truly reflects a model’s hard capabilities in logical reasoning and execution. For example, industry data shows that early open-source models hovered around a net improvement rate of just 1%, while today’s top open-source models have surpassed 5% in composite net improvement rate—a qualitative leap.

    3. Breakdown of Core Agent Capability Metrics

    Beyond the composite net improvement rate, a deeper analysis of granular metrics is critical for developer model selection and optimization. Across the three high-frequency scenarios of programming, workflow automation, and everyday chat, two metrics stand out:

    1. Bash Reliability
    This metric measures the success rate and fault tolerance of an agent generating and executing shell commands in a sandbox. A highly reliable agent not only produces correct scripts on the first attempt but also automatically generates repair commands and retries when it encounters missing environment dependencies (such as uninstalled modules). This requires strong environment awareness and context retention. Developers can use container platforms and logging services to build an isolated sandbox environment for continuous monitoring of this metric.

    2. Steerability
    When an agent deviates from user expectations, users often need to interrupt it with natural language and issue new instructions. Steerability measures an agent’s ability to understand corrective intent and quickly adjust its execution path. A strong model, upon receiving a correction, not only stops the erroneous action but also leverages historical context to infer the correct next step, rather than restarting execution from scratch.

    4. Building an Agent Evaluation Loop on Cloud-Native Architecture

    For enterprise developers, building an internal evaluation system modeled on these advanced mechanisms is key to continuously improving business intelligence. A fully automated evaluation loop can be constructed with general-purpose cloud-native services:

    • Session ingestion and log storage: Asynchronously push the agent’s complete runtime trajectory (including chain of thought, tool calls, and environment responses) through a message queue into object storage or a logging service to prevent data loss.
    • Sandbox environment orchestration: Use a container platform to dynamically create and destroy isolated environments for executing shell commands, ensuring evaluation security and consistency.
    • Signal parsing and monitoring alerts: Deploy stream-processing jobs that listen to log flows in real time, extracting key signals such as “corrections” and “errors” via regex matching and lightweight intent classification models. If the error rate for a certain task type spikes abnormally, a monitoring alert is triggered immediately.
    • Model gateway and scheduling: Through a unified model gateway (such as the general inference services provided by Baidu AI Cloud’s Qianfan platform), teams can flexibly connect to and switch between different LLMs and quickly compare their net improvement rates without modifying business code logic.

    5. Conclusion and Outlook

    Agent evaluation is shifting from subjective experience toward objective, data-driven causal inference. Signal extraction from real long-horizon task sessions, combined with causal tracing methods, provides the industry with a precise yardstick. For developers, understanding core metrics such as Bash Reliability and Steerability—and building automated evaluation and monitoring loops on cloud-native tooling—will be critical to maintaining a technical edge in deploying LLM applications. As models continue to improve their mastery of complex tool invocation, we can reasonably expect agents to deliver more stable and efficient performance in real business scenarios.