← Agentic Harness / Evaluation
Agentic Harness · EvaluationReading guide

Agent Evaluation Systems: From Trajectory Benchmarks and Stateful Tool Sandboxes to Human-Calibrated LLM-as-Judge and Paired Significance Testing

Why static single-turn benchmarks fail on multi-step tool-calling agents, how to architect a four-layer evaluation harness from scratch (deterministic AST guards, stateful mock-database sandboxes, $\text{Pass}^k$ reliability, and CI/CD regression ratchets), and how to calibrate an LLM-as-judge against human annotations with paired hypothesis tests ($p$-values) in production.

Evaluating a multi-step agent is fundamentally different from evaluating a single-turn text classifier or static QA model. An agent interacts with external state: it decomposes an ambiguous user goal, selects tools from a schema registry, serializes JSON arguments, interprets noisy or empty API payloads, and mutates backend databases. A single prompt edit or base-model swap can leave final-answer fluency unchanged while silently breaking tool parameter formatting, skipping an authorization check, or inflating tail latency by $3\times$.

$$J_{\text{episode}}(\tau) = \mathbb{I}\!\left[\Delta S_{\text{db}}(\tau) = \Delta S_{\text{db}}^*\right] \cdot \Big( w_1\,\operatorname{F1}_{\text{tool}}(\tau) + w_2\,\operatorname{Sim}_{\text{arg}}(\tau) + w_3\,\hat{R}_{\text{cal}}(x, \tau) - \lambda\,\operatorname{Cost}(\tau) \Big).$$

Two chapters covering the full evaluation stack

01
Designing an Agent Evaluation System from Scratch: Trajectory Benchmarks, Stateful Tool-Mock Sandboxes, $\text{Pass}^k$, and CI/CD Regression Suites

Architect the 4-layer evaluation pyramid, contrast outcome-level state assertions ($\Delta S_{\text{db}}$) against trajectory-level tool F1 across the $2\times 2$ failure matrix, derive why customer-facing agents must optimize $\text{Pass}^k = p^k$ rather than $\text{Pass}@k$, and build a deterministic SQLite tool-fixture replay harness that gates every prompt or model pull request.

02
Human-Calibrated LLM-as-Judge & Paired Significance Testing: The AutoPulse CRM Case Study (+21% Similarity & +35% Relevance)

Calibrate an automated LLM judge against human expert labels using Cohen’s $\kappa$, Krippendorff’s $\alpha$, and the Rogan–Gladen prevalence correction ($\hat{p} = \frac{\hat{p}_{\text{raw}} + q_0 - 1}{q_1 + q_0 - 1}$), then run paired $t$-tests, Wilcoxon signed-rank tests, and Holm–Bonferroni corrections on the 800-dealership AutoPulse CRM platform to prove +21% semantic similarity and +35% context relevance.

Summary of the Four Evaluation Layers

The four layers of a production agent evaluation harness, ordered from fastest deterministic assertions to online shadow telemetry.
LayerWhat It VerifiesCore Mathematical MetricExecution CostChapter
L1 · Deterministic Schema & PolicyJSON AST validity, Pydantic types, enum bounds, forbidden tool combinations$\mathbb{I}[\text{AST\_valid}] \land \mathbb{I}[\text{policy\_safe}] = 1$$< 2\text{ ms}$ / stepCh. 01
L2 · Trajectory & Sandbox State DiffTool sequence recall/precision, argument similarity, exact mock DB mutation $\Delta S_{\text{db}}$$\operatorname{F1}_{\text{tool}}(\tau)$, $\text{Pass}^k = \hat{p}^k$, $\mathbb{I}[S_T = S_T^*]$$\sim 15\text{ ms}$ / traceCh. 01
L3 · Calibrated LLM-as-JudgeSemantic similarity, context relevance, groundedness (faithfulness), tone rubricRogan–Gladen $\hat{\theta}_{\text{RG}}$, Paired $t$ / Wilcoxon $p$-value$\sim 600\text{ ms}$ / traceCh. 02
L4 · Online Shadow & Canary GateUser re-query rate, human escalation rate, P99 latency, distribution driftSequential mSPRT / CUPED-adjusted $\Delta\mu$Real-time streamCh. 01–02