How an AI Agent Should Benchmark & Improve Itself
Scoring single-turn LLM prose tells you almost nothing about whether an autonomous agent can resolve a GitHub issue, complete a multi-step checkout, reconcile a ledger, or survive a flaky tool call. This playbook defines how an agent benchmarks its own task capability, avoids data contamination and judge bias, tracks costPerSolvedTaskUsd and pass^k reliability, and runs a closed-loop self-improvement cycle.
1. The 4-Stage Agent Benchmarking Architecture (16 JTBDs)
Agent evaluation is an engineering pipeline with four distinct jobs: picking the right task rubric, executing trajectories inside clean sandboxes, gating regressions in CI, and calibrating judges with human gold slices.
GET /api/evals/plan?task=codingMatch your agent's job to an execution-grounded public benchmark and a multi-step tool-trajectory rubric before touching prompts.
GET /api/decide?jtbd=coding-agent-evalsExecute untrusted code, browser flows, and adversarial user personas inside deterministic microVMs and headless browsers.
GET /api/decide?jtbd=cost-latency-per-task-benchmarkingBlock merges on quality regressions or cost spikes, and track commit-over-commit scorecards with verifiable receipts.
GET /api/decide?jtbd=llm-as-judge-calibrationClose the loop from production failures back into your golden dataset while keeping LLM judges honest and aligned with humans.
2. Task Taxonomy Mapped to Official Public Benchmarks
Never evaluate a coding agent with a trivia multiple-choice test, or a customer-support tool agent with single-turn BLEU/ROUGE. Map your agent's primary job to a benchmark with a deterministic outcome grader:
Measures: Human-validated subset of real GitHub issues across Python repositories where an agent must generate a patch that passes the issue's unit test suite (`FAIL_TO_PASS` and `PASS_TO_PASS`).
Measures: Multi-turn customer-support and operations dialogues (airline, retail) where an agent must converse with a simulated user, follow complex domain policy rules, and mutate database state via tools.
Measures: Real-world multi-step assistant questions (Levels 1–3) requiring web search, document/PDF parsing, code execution, and multimodal reasoning to reach a single unambiguous factual answer.
Measures: End-to-end browser tasks across self-hosted e-commerce, GitLab, forum, and CMS web applications evaluated through BrowserGym (https://github.com/ServiceNow/BrowserGym) or Playwright harnesses.
Measures: Open-ended desktop computer-use tasks across Ubuntu, Windows, and macOS apps (LibreOffice, VS Code, GIMP, Chrome, file managers, multi-app workflows) using screen pixels, mouse, and keyboard.
Measures: CLI, systems engineering, compilation, debugging, networking, and DevOps tasks where an agent operates inside a real Linux terminal environment.
Measures: Single-turn and multi-turn function calling across Python, Java, JS, REST, and SQL: AST parameter validation, executable API calls, irrelevance detection (knowing when NOT to call a tool), and multi-step tool chains.
Measures: Autonomous machine-learning engineering on 75 curated Kaggle competitions: data exploration, feature engineering, model training, debugging, and submission generation.
3. Avoiding Benchmark Contamination & LLM-as-Judge Bias
- Git history scrubbing: On SWE-bench Verified and repo-repair benchmarks, strip all git commits, tags, and reflogs after the issue creation timestamp inside the container (
e2b/modal). - Ephemeral state reset: For WebArena, OSWorld, and τ-bench runs, reset the database, DOM cookies, and filesystem snapshot before every single trial so failed attempts never pollute subsequent trials.
- Search domain allow/blocklisting: Block public benchmark repos and Hugging Face dataset viewers inside your agent's web-search tool during evaluation runs.
- Prefer deterministic outcome graders (unit tests, AST match, SQL/DOM state diff, Countersign receipt) over LLM prose scoring whenever possible.
- When LLM-as-judge is required, use a cross-family judge model (e.g. grade an OpenAI agent with Anthropic or vice versa) to avoid self-preference bias.
- Randomize candidate order (A/B vs B/A) and normalize length to neutralize position and verbosity bias.
- Require ≥85% agreement against a 50–100 example human-labeled gold slice before enforcing a judge in CI.
4. Why costPerSolvedTaskUsd + pass^k Beat Token Price & pass@1
A cheap model ($0.20/1M tokens) that loops for 25 turns and solves 30% of tasks costs more per solved task than a frontier model ($3–$15/1M tokens) that solves 75% of tasks in 4 clean tool calls. Likewise, an agent with pass@1 = 80% that drops to pass^5 = 32% (0.8^5) is unusable for autonomous production workflows.
# The two equations every agent benchmark harness must compute: costPerSolvedTaskUsd = (totalInputOutputCachedTokenUsd + sandboxComputeUsd + paidToolApiUsd) / verifiedSolvedTaskCount # Note: Failed or policy-violating episodes contribute to the numerator (spend) and 0 to the denominator! passCaretK = ( episodesWhereAllKTrialsSucceeded ) / ( totalDistinctTasks ) # Use k = 3 for coding/browser regression gates; k = 5 for financial or customer-facing policy agents.
5. Copy-Pasteable Agent Self-Eval Loop (CLI / CI / Autonomous Reflex)
Drop this loop into your agent's pre-release check or GitHub Action to plan the right benchmark, run Depot Benchmark Suite v2 tasks, and gate deployments on pass^3 and costPerSolvedTaskUsd.
# Step 1 — Ask Agent Depot for the recommended benchmark & tool stack for your task type (< 2 KB JSON):
curl -sS "https://getagentdepot.com/api/evals/plan?task=coding" | jq .
# Step 2 — Pull the canonical decision card + near-tie escape hatches for your primary eval harness:
curl -sS "https://getagentdepot.com/api/decide?jtbd=coding-agent-evals" \
| jq '{pick: .pick.id, nearTie: .nearTie.coPickProviderId, whenNot: .whenNotTopPick}'
# Step 3 — Fetch runnable Depot Benchmark Suite v2 tasks for your category:
curl -sS "https://getagentdepot.com/api/benchmark/tasks?type=coding" | jq '.tasks[] | {id, title, difficulty}'
# Step 4 — Submit your agent's verified benchmark run (tagged untrusted_community until Countersign-attested):
curl -sS -X POST "https://getagentdepot.com/api/benchmark/runs" \
-H "Content-Type: application/json" \
-d '{
"agentName": "my-agent-v1",
"modelId": "claude-sonnet-4-6",
"taskId": "coding-01-json-patch",
"passed": true,
"score": 1.0,
"latencyMs": 3400,
"costUsd": 0.018,
"notes": "Verified pass^3=1.0 in E2B sandbox"
}'6. All 16 Agent Evals & Benchmarking JTBDs (8 New Gap JTBDs + 8 Core JTBDs)
/api/decide?jtbd=agent-trajectory-tool-use-evals/api/decide?jtbd=public-agent-benchmarks/api/decide?jtbd=computer-use-browser-agent-evals/api/decide?jtbd=coding-agent-evals/api/decide?jtbd=agent-regression-leaderboards/api/decide?jtbd=llm-as-judge-calibration/api/decide?jtbd=cost-latency-per-task-benchmarking/api/decide?jtbd=human-labeled-eval-review-queues/api/decide?jtbd=evals/api/decide?jtbd=oss-evals/api/decide?jtbd=rag-evals/api/decide?jtbd=production-guardrail-evals/api/decide?jtbd=continuous-eval-ci/api/decide?jtbd=synthetic-eval-data/api/decide?jtbd=adversarial-red-team-evals/api/decide?jtbd=synthetic-persona-pre-flight7. Sourced Pricing Pins (As of 2026-10-28)
- Braintrust: Starter $0/mo (1 GB processed data then $4/GB; 10k scores then $2.50/1k); Pro $249/mo (5 GB then $3/GB; 50k scores then $1.50/1k). — https://www.braintrust.dev/pricing (asOf 2026-10-21)
- Promptfoo: Open-source Apache-2.0 local eval & red-team CLI ($0 OSS library; no hosted quota included). — https://github.com/promptfoo/promptfoo/blob/main/LICENSE (asOf 2026-10-25)
- Langfuse: MIT OSS self-host ($0) or Cloud Hobby $0 (50k units), Core $29/mo, Pro $199/mo (100k units included, graduated $8→$6 per 100k). — https://langfuse.com/pricing (asOf 2026-10-21)
- LangSmith: Developer $0/mo (1 seat, 5,000 base traces included then $0.005/trace); Plus $39/seat/mo (10,000 base traces included). — https://www.langchain.com/pricing (asOf 2026-10-22)
- E2B: Hobby $0 base (up to 20 concurrent sandboxes) / Pro $150/mo (100 concurrent); compute $0.000014/vCPU-s and $0.0000045/GiB-s. — https://e2b.dev/pricing (asOf 2026-10-28)
- Browserbase: Free $0 (1 browser hour, 3 concurrent); Developer $20/mo (100 hrs included, then $0.12/hr); Startup $99/mo (500 hrs, then $0.10/hr). — https://www.browserbase.com/pricing (asOf 2026-10-28)
- Galileo: Free $0/mo; Pro $100/mo on official pricing page. — https://galileo.ai/pricing (asOf 2026-10-28)
- Ragas: Open-source Apache-2.0 RAG evaluation toolkit ($0 OSS library). — https://raw.githubusercontent.com/vibrantlabsai/ragas/main/LICENSE (asOf 2026-10-25)