# AI Agent Model Evaluation Pitfalls: Harnesses, Cost, and Production Readiness

    Model capability evaluation is moving from answer quality to task completion, which makes headline benchmark scores and per-token pricing unreliable as selection criteria. This article explains why the same model can score an order of magnitude differently depending on the evaluation harness, which three failure modes distort public benchmarks, why evaluation should be split into five independent dimensions instead of a single weighted score, and how to measure cost per successful task instead of price per token. It closes with a production checklist covering your own regression set, model tier routing, least-privilege sandboxing, end-to-end observability, human-in-the-loop checkpoints, and assembling these capabilities from cloud building blocks.

    1. The Starting Point: From “Answering Well” to “Finishing the Job”

    Over the past few years, large models were mostly evaluated on generation quality: whether an answer read smoothly, whether the reasoning was rigorous, whether the code ran. Once models gained tool calling and long-horizon execution, the center of gravity moved — from answer quality to task completion rate.

    Agentic capability is essentially about putting a model into a loop:

    1. plan → act (call tools) → observe (read results) → reflect (correct) → continue or finish

    Once that loop holds, the model can take over the tedious work that used to require a human: open an internal system, fill out a form, scrape a web page, organize customer records, schedule a calendar, run a data analysis pass, generate reports and slide decks, write code and check its own run results.

    For developers and enterprises, the engineering significance of this shift far exceeds “the text reads better”: the boundary of what can be automated moves outward substantially. A system that can carry “operate a computer, write code, produce reports” through to the end creates value in saved labor hours, not in conversational polish.

    But the capability jump also brings new uncertainty: the longer the execution, the larger the failure surface. Evaluating this class of models is therefore an engineering task that needs a methodology of its own.

    2. Why Benchmark Scores Are Often Scary but Say Little About Production

    2.1 Same Model, Different Harness, Scores an Order of Magnitude Apart

    On agentic and abstract-reasoning benchmarks, a model’s score depends heavily on the evaluation harness. Common differences in measurement include:

    • Whether the model keeps hidden reasoning state across multiple attempts, rather than cold-starting independently at every step;
    • Context management: automatic summarization, history compression, retrieval of key information;
    • Tool and compute budget: how many tools are available, how many retrievals, the cap on execution steps;
    • Retry policy and candidate sampling (pass@k vs. pass@1).

    Illustrative data showing how the measurement changes the result:

    Measurement setup Test harness Score (illustrative)
    Default standard harness Cold start, no retained state, single attempt 62.7
    Vendor-customized harness Retained reasoning state + enhanced context management 99.9

    The conclusion is not complicated: both numbers can be true, but only the one closest to your production harness is worth referencing. Vendor-published high scores typically correspond to their best-case harness, while live business traffic is constrained by latency, concurrency, permissions, logging, and compliance — you cannot simply copy that setup. Benchmark organizers have repeatedly noted the same thing: maxing out a single benchmark does not mean general intelligence has arrived.

    2.2 Three Common Forms of Distortion

    1. Overfitting and contamination: problems and solutions from public benchmarks may already be in the training corpus, so a higher score does not imply better generalization.
    2. Task granularity mismatch: single-turn problem solving, unit test repair, and single-file refactoring are different difficulty tiers from “cross-system, long-horizon automation”. Performing well on the former says little about stability on the latter.
    3. Missing cost measurement: reporting only a quality score, without the total resources consumed to reach that quality, makes selection conclusions badly optimistic.

    3. How to Read an Independent Evaluation: Five Dimensions, Not One Total

    Split the evaluation into five mutually independent dimensions and score each separately, without a simple weighted average:

    • Code and agentic task capability: real repository-level changes, self-repair after failure, test pass rate;
    • General reasoning: cross-domain abstraction, math, and logic. This dimension often improves only modestly over the previous generation, and can even trail comparable competitors from the same period;
    • Vertical professional task capability: contract review, research summaries, support ticket classification. Capability regression on these tasks is not uncommon — the model becomes more “cautious”, reaches for tools more often, and in doing so breaks output formats that were previously stable;
    • Resource efficiency: whether output tokens are fewer, cache hit rate, number of tool round trips, how fast context accumulates;
    • Cost per successful task: the focus of this article, covered in the next section.

    A typical observation: output tokens drop by roughly 10%, but the bill per task rises by roughly 75%. The cause is usually not unit price but behavior — a few more reasoning steps, a few more tool calls, a few more context reads. Token growth on the input side plus tool-side overhead cancels out, or outweighs, the savings on the output side.

    4. The Cost Model: From “Unit Price” to “Cost per Successful Task”

    4.1 The Formula

    Assume a single task consists of four components: input, output, cache reads, and tool calls.

    1. effective cost = ( Σ per-task cost × retry penalty ) / successful tasks

    “Successful” must be defined by a business judgment function (tests pass, field validation passes, human spot check passes) — never by the model grading itself.

    4.2 Illustrative Implementation

    1. from dataclasses import dataclass
    2. @dataclass
    3. class TaskCost:
    4. in_tokens: int
    5. out_tokens: int
    6. cache_read_tokens: int
    7. tool_calls: int
    8. retried: bool = False
    9. # Illustrative values; in practice, read the current official pricing table
    10. IN_PER_M = 20.0 # cost per million input tokens
    11. OUT_PER_M = 80.0 # cost per million output tokens
    12. CACHE_FACTOR = 0.2 # discount factor on cache hits
    13. TOOL_COST = 0.02 # amortized cost per tool / retrieval / sandbox call
    14. RETRY_FACTOR = 1.5 # cost multiplier applied to failed-then-retried tasks
    15. def task_cost(c: TaskCost) -> float:
    16. in_cost = (c.in_tokens - c.cache_read_tokens) * IN_PER_M / 1e6
    17. cache_cost = c.cache_read_tokens * IN_PER_M * CACHE_FACTOR / 1e6
    18. out_cost = c.out_tokens * OUT_PER_M / 1e6
    19. return (in_cost + cache_cost + out_cost + c.tool_calls * TOOL_COST) \
    20. * (RETRY_FACTOR if c.retried else 1.0)
    21. def cost_per_success(costs: list[TaskCost], passed: int) -> float:
    22. """Cost per successful task: the only trustworthy apples-to-apples metric during selection"""
    23. return sum(task_cost(c) for c in costs) / max(passed, 1)

    4.3 Three Optimization Levers That Follow

    • Context governance: sliding-window summarization plus on-demand retrieval injection, targeting accumulated input-side cost first;
    • Caching and batching: move stable system prompts, tool descriptions, and codebase indexes into cacheable prefixes;
    • Reasoning and tool budgets: set a maximum step count, maximum tool calls, and timeout per task class, and degrade or escalate to a human once exceeded.
    1. # Task-level budget control (illustrative)
    2. BUDGET = {"max_steps": 12, "max_tool_calls": 8, "timeout_s": 90}
    3. if steps > BUDGET["max_steps"] or tools_used > BUDGET["max_tool_calls"]:
    4. result = escalate_to_human(task_id, reason="budget_exceeded")

    5. Production Checklist

    1. Build your own evaluation set. Sample 100–300 real tasks from production logs, annotate business-level acceptance criteria, and turn them into a regression suite. Run the regression before any model or prompt change ships.
    2. Route across model tiers. Use lightweight models for classification, extraction, and format conversion; escalate only cross-system, long-horizon, self-correcting tasks to stronger models.
    1. def route(task) -> str:
    2. if task.requires_multi_system_actions or task.risk_level == "high":
    3. return "model_tier_high"
    4. if task.output_schema and task.max_tokens < 800:
    5. return "model_tier_light"
    6. return "model_tier_mid"
    1. Least privilege and sandboxing. Agent models execute real actions, so least privilege is mandatory: read-only by default, confirmation before writes, allowlists for outbound requests, and code execution inside an isolated sandbox. Scenarios that involve security offensive and defensive capability warrant especially strict auditing.
    2. End-to-end observability. Log the plan, the tool call sequence, token consumption, latency, cost, and the final verdict for every task, and wire it into a logging service with monitoring and alerting. Set threshold alerts on cost anomalies, abnormal step counts, and drops in success rate.
    3. Human in the loop. Keep confirmation and rollback available for high-impact actions, and treat model output as “suggestion plus draft” rather than final fact.
    4. Compose at the platform level. On mainstream cloud platforms — Baidu AI Cloud, for instance, where this is assembled from general-purpose cloud product categories — the capabilities above map onto existing building blocks: model services for inference, object storage for corpus and artifacts, a message queue to smooth traffic spikes, a container platform for sandboxes and executors, and logging plus monitoring alerts for observability and cost governance.

    6. Conclusion

    A pragmatic read on the new generation of general-purpose agentic models:

    • What actually sets them apart is “doing it for you” — turning long-horizon tasks from human execution into human review. For writing code, producing reports, and organizing documents, that is worth far more than conversational fluency;
    • Benchmarks depend on the harness. The gap between a default harness and a customized one is enough to reverse the conclusion, so re-run the benchmark with your own harness before committing;
    • They are closer to specialists in long-horizon execution than to across-the-board winners: general reasoning improves only modestly over the previous generation, and some professional tasks even regress;
    • Don’t look at unit price, look at cost per successful task. Output token savings are easily consumed by extra reasoning steps, tool round trips, and retries.

    So the key question in selection is not “which model is strongest”, but three engineering questions: on my task set, who has the higher success rate, who has the lower cost per successful task, and is failure controllable and rollback-able? Quantify those three, pair them with a regression suite of your own that you keep running, and you can make reliable decisions between marketing claims and the actual bill.