Building Agent Evaluation Benchmarks for Real-World Work Scenarios

    This article presents a practical approach to building agent evaluation benchmarks that reflect real productivity. It explains why public problem sets suffer from contamination, narrow task shapes, and coarse scoring, then details a dataset design based on anti-contamination rewriting and broad role coverage. It also covers a unified evaluation protocol with isomorphic task directories and sandbox isolation, domain-specific scoring for code, frontend, office, and security tasks, how to interpret results beyond a single leaderboard rank, and engineering recommendations for running repeatable evaluation pipelines.

    1. Background: Why Traditional Benchmarks Fail to Reflect Real Productivity

    Most benchmarks used to measure agent capabilities are drawn from public problem sets, such as tasks extracted from historical defect records in open-source repositories. This kind of data has three structural weaknesses.

    The first is contamination and overfitting. Task descriptions have been public for a long time, so models may have already “seen the answer” during pretraining. Scores are inflated as a result and do not reflect true generalization ability.

    The second is limited task shape. Real work rarely asks for “fix one function.” It more often involves cross-file, cross-module changes: locating the impact surface, modifying the implementation, filling in tests, and verifying there is no regression.

    The third is coarse scoring. Relying on a single automated metric cannot cover subjective dimensions such as frontend visuals or the semantic quality of office documents, nor can it prevent agents from taking shortcuts.

    A usable scenario-based benchmark therefore has to solve three problems at once: data construction, execution isolation, and scoring orchestration.

    2. Dataset Construction: Two Main Lines, Anti-Contamination and Broad Coverage

    2.1 Anti-Contamination Design

    The core idea is to make task descriptions look similar to public corpora while being substantively different. Common practices include:

    • Colloquial rewriting: rewrite a structured defect report as a natural-language request in the tone of a business stakeholder, breaking up the original sentence patterns and keyword distribution;
    • Semantically equivalent substitution: keep the technical constraints but change the phrasing path so that memory-based matching fails;
    • Private context injection: embed internal conventions, private modules, and custom specifications in the repository so the model cannot answer from memory.
    1. Original (easy to memorize): "Fix issue #1234: NullPointer in parseConfig when key missing."
    2. Rewritten (colloquial): "A colleague reported that parsing crashes when one item is missing from the config. Please handle that case as well."

    2.2 Broad Coverage Design

    Tasks should cover requests raised by real professional roles, for example five role types: engineering, algorithm, product, testing, and operations, mapped to roughly 18 task categories such as defect fixing, feature addition, test completion, algorithm implementation, and data analysis. In terms of scale, the code domain has about 80 repository-level tasks, the frontend domain about 70 tasks, the office domain about 50 tasks, and the security domain about 60 tasks, forming a multi-domain combination rather than a single-point pile-up.

    3. A Unified Evaluation Protocol: Isomorphic Directories and Sandbox Isolation

    To make different tasks comparable, the way input, execution, and output are packaged must be unified:

    • Isomorphic task directories: each task contains a task description, an initial workspace, verification scripts, and metadata;
    • A unified sandbox: restricted network, restricted filesystem, fixed timeouts and resource limits to guarantee reproducibility;
    • A unified output contract: agents submit results only through agreed file locations and commands, and the evaluator does not care about their internal implementation.

    An illustrative directory structure:

    1. task_0007/
    2. ├── prompt.md # Colloquial task description
    3. ├── workspace/ # Initial code or materials
    4. ├── verify/ # Scoring entry point
    5. │ ├── scoring.py # Deterministic scoring
    6. │ └── checks/ # Rules and test cases
    7. └── meta.json # Role, category, weight

    4. Domain-Specific Scoring: Four Scoring Logics for Four Task Types

    4.1 Code Domain: Hidden Unit Tests as the Main Signal

    The pass rate of hidden unit tests serves as the primary metric: objective, reproducible, and resistant to cheating. Any natural-language explanation the model provides is only a diagnostic reference and does not count toward the main score.

    4.2 Frontend Domain: Three-Layer Scoring

    1. Rule checks: structural completeness, required elements, and whether constraints are satisfied;
    2. Semantic and visual review: a multimodal model judges layout, color scheme, and information hierarchy;
    3. Interaction review: an agent clicks, fills forms, and navigates within the page to verify state transitions and that the business flow closes the loop.

    4.3 Office Domain: Deterministic Rules Plus Evidence-Constrained Review

    This domain handles mixed formats such as spreadsheets, documents, presentations, and structured data, and requires consistency across files (for example, summary values matching the details). Objective facts are validated by rules, semantic quality is judged by a review model, and review conclusions must cite specific evidence in the artifacts. Results are then fused according to task weights.

    4.4 Security Domain: Purely Deterministic Scoring

    Executable verification is the standard: vulnerability verification scripts or flags, threat intelligence metrics, the matching quality of signature rules, and classification and ranking metrics (such as macro-averaged F1 and Kendall rank correlation). No model review is introduced in this domain, and multi-layer anti-cheating design is applied to prevent agents from deleting verification logic or fabricating artifacts.

    5. Interpreting Results: What to Look at Beyond the Leaderboard

    Across public evaluations, a general pattern is that capability rankings show top models close together and gaps widening in the middle, with closed-source flagships and strong open-source models trading wins, and individual open-source models even overtaking in specific domains. Three things deserve attention when reading results:

    • Per-domain radar rather than a single total score: strength in code does not mean office and security are equally reliable;
    • Performance by role: vague product requests and precise operations requests differ in difficulty;
    • Failure mode clustering: whether the failure is localization, missing verification, or loss of constraints under very long context.

    6. Implementation Advice and Engineering Practice

    For enterprises building a similar evaluation in-house, a four-step approach is recommended:

    1. Scenario collection: extract and anonymize real internal tickets to form a private task pool;
    2. Anti-contamination processing: colloquial rewriting plus private context injection plus periodic rotation of the task bank;
    3. Scoring orchestration: deterministic checks first, model review only for subjective dimensions, with mandatory evidence citation;
    4. Pipeline: use a container platform for sandbox scheduling, object storage to archive artifacts, a message queue to smooth peaks, and logging and monitoring services to track evaluation stability and cost.
    1. # Scoring orchestration illustration: deterministic first, model review as fallback
    2. def evaluate(task, artifact):
    3. score, facts = deterministic_checks(task, artifact) # rules/test cases
    4. if facts.coverage_ok:
    5. return weighted(score, facts)
    6. review = llm_judge(task, artifact, evidence_required=True)
    7. return weighted(score, review, task.weights)

    On Baidu AI Cloud, this pipeline maps directly to a container platform hosting the sandboxes, object storage holding tasks and artifacts, and logging and monitoring services observing run quality, turning a one-off evaluation into a continuously improving capability baseline.

    7. Conclusion

    The value of scenario-based evaluation is not a ranking, but breaking “real work completion” into measurable, reproducible, and comparable signals. Anti-contaminated data construction, a unified sandbox protocol, and domain-specific scoring orchestration are all indispensable. Only by constraining subjective dimensions to evidence and handing objective dimensions to deterministic scripts can evaluation results genuinely guide the deployment of agents in engineering and business.