Skip to main content

Chapter 11. Offline Experiment Design and Release Decisions

The lifecycle spans more than offline comparisons. Its companion chapters cover production monitoring, configuration integrity, shadow and canary rollout, and randomized online experiments.

Evals in the Development Lifecycle

A prompt edit fixes two examples but breaks a high-risk refund case. The team discovers the problem only after release, when the error has already reached customers. Lifecycle evaluation moves evidence earlier—through local development, pull request, staging, and release—then keeps watching once the system is live.

Each tier balances speed, breadth, and realism. Fast checks catch straightforward defects while a developer can still act on them, larger suites support release decisions, and carefully controlled experiments can estimate real-world effects. No one tier answers every question, which is why the evidence must build across the lifecycle.

After this chapter you will be able to:

  • classify an agent by composable capabilities and risk overlays, then apply a reusable evaluation playbook;
  • design evaluation tiers for code, integration, regression, and release;
  • choose fast versus full suites based on risk and change scope;
  • define gates with thresholds, uncertainty, and non-compensable failures;
  • handle flaky evaluation without hiding instability;
  • test model, prompt, and tool upgrades with paired comparisons;
  • distinguish canaries, shadow traffic, and A/B tests, and apply safeguards to each.

A reusable playbook: compose capabilities and overlays

Deployed agents usually combine capabilities. A legal assistant may retrieve sources, answer questions, and draft a document, while a voice support agent may retrieve policy, track dialogue state, and call account tools. Because each capability introduces different evidence and failure modes, one archetype rarely describes the whole evaluation.

The first diagram is a routing map, not a maturity ladder: select each relevant capability, then add overlays only where they change the evidence or acceptable risk. The second shows how those choices turn into an evaluation plan. It is a reusable workflow, not a claim that every product needs identical tests.

flowchart TB
    A[Describe goal, boundaries, and impact]
    A --> B[Select all applicable capabilities:<br/>Knowledge-grounded answering<br/>Transactional workflow<br/>Artifact creation<br/>Research and analysis<br/>Conversation and interaction]
    B --> C[Add relevant overlays:<br/>Risk and regulation<br/>Language and locale<br/>Voice and other modalities<br/>External actions and autonomy<br/>Privacy]
    C --> D[Compose the evaluation plan]

flowchart TB
    S1[1. Classify capabilities, actions, and risk]
    S1 --> S2[2. Define task contract and failures]
    S2 --> S3[3. Build offline tests and protected holdouts]
    S3 --> S4[4. Set metric gates and hard stops]
    S4 --> S5[5. Choose shadow, canary, or powered experiment]
    S5 --> S6[6. Monitor outcomes and evaluation health]

Choose archetypes by observable capability

Archetype Include it when the agent… Example primary outcomes and failure modes Related chapters
Knowledge-grounded answering Finds and uses documents, databases, dashboards, or memory to answer Correct answer against an authoritative oracle; evidence/citation support; freshness and access compliance. Failures: unsupported claims, wrong measure or time grain, stale source, restricted-data disclosure. Chapters 22, 24, 27
Transactional workflow Calls tools or changes records, permissions, or external state Correct authorized end state; safe escalation and recovery. Failures: wrong entity, omitted prerequisite, duplicate or unauthorized action, false success claim. Chapters 22, 25, 27
Artifact creation Produces code, messages, reports, plans, or other deliverables Verified artifact requirements and quality; regression and scope checks. Failures: fabricated facts, hidden invariant break, missing requirement, out-of-scope side effect. Chapters 22 and 23
Research and analysis Searches, synthesizes evidence, analyzes data, or makes claims from it Source coverage, claim-to-evidence support, analytical validity, uncertainty and warranted conclusions. Failures: missed or weak sources, citation mismatch, confounding, unsupported inference. Chapters 24, 30, 13
Conversation and interaction Resolves a goal across turns, voice, or multimodal exchanges Episode resolution, state/slot accuracy, appropriate clarification and handoff, latency. Failures: forgotten corrections, ASR/entity errors, unsafe continuation, poor transfer. Chapters 23 and 25

An agent can fit several rows. Pick a primary archetype for its main user outcome, then add a secondary one for each capability that matters on its own. For example, a research assistant that writes a report combines research/analysis and artifact creation, while a support agent that issues refunds combines conversation and transactional workflow.

Add overlays when they change the evidence or acceptable risk

Overlay Add tests and report results by… Decision implication
High-impact or regulated use Severity, jurisdiction, protected or sensitive data, human review, and escalation Define non-compensable gates with domain and legal owners; a general quality score cannot establish compliance.
Multilingual or locale-sensitive use Language, locale, script, dialect, native/domain-qualified reviewer, and policy version Gate supported languages separately; pooled performance cannot mask an unsafe or unsupported language.
Voice or other modality Modality, signal quality, recognition confidence, timing, interruption, and handoff Separate perception diagnostics (such as WER) from task correctness and safe recovery.
External or irreversible actions Action type, principal, authorization, state change, retries, and rollback Require least privilege and explicit approvals; never trade away an unauthorized action for higher task success.
Autonomous or long-horizon behavior Scenario, step budget, dependencies, environment state, and repeated runs Set bounded authority, safe-stop criteria, and run-level reliability measures.
Privacy-sensitive data Data source, purpose, retention, access, redaction, and deletion path Use approved fixtures and logging rules; missing privacy evidence means hold or insufficient evidence.

An overlay changes how a case should be interpreted, not just how it is labeled. Attach it to the relevant cases and metrics instead of creating a duplicate scorecard; one case can carry several overlays. Those slices should remain visible even when the aggregate passes.

Run the same six-step workflow for every composition

Step Work and required output
1. Classify capabilities, actions, and risk Name the primary and secondary archetypes; list tools, data, user-visible outputs, state changes, autonomy, and overlays. Bound intended users, supported tasks, exclusions, and impact.
2. Define the task contract and failure taxonomy For each task family, specify input/state, acceptable and prohibited behavior, authoritative evidence/oracle, terminal outcome, and failure categories. Separate observable symptoms from confirmed root causes.
3. Build representative offline tests and protected holdouts Create a fast regression core, a broader release set, targeted challenge/safety cases, and a sealed holdout. Cover ordinary, ambiguous, boundary, failure-recovery, and overlay slices. Document sampling and label provenance; targeted risk cases do not estimate traffic prevalence by themselves.
4. Set metric-specific gates For every metric, state the unit, numerator, denominator, direction, slice, minimum evidence, uncertainty rule, threshold, and owner. Keep critical harms and invariant violations non-compensable; return insufficient evidence when the evaluator, denominator, or sample cannot support a claim.
5. Advance safely from offline to production Pass deterministic and integration checks first, then regression/release evaluation. Use shadow only with sensitive actions blocked or isolated; canary bounded exposure with monitoring and rollback. Run a powered randomized experiment only for a safe, causal user-outcome question and after independent safety gates pass.
6. Monitor and close the learning loop Track user outcomes and guardrails alongside trace completeness, judge health, label freshness, and alert delivery. Investigate shifts, preserve versions and evidence, adjudicate incidents, then add verified failures as regression tests without contaminating the holdout.

The archetypes tell the team what the agent can do, while the overlays describe conditions that change its risk. A task contract connects both to testable evidence. Record the following for each task family:

Field Record
Task family and version What user goal and task distribution does this claim cover?
Archetypes and overlays Which capabilities, actions, risk, languages/locales, and modalities are in scope?
Unit and population What is one observation (claim, query, episode, user, or workflow), and who or what does it represent?
Acceptable/prohibited outcomes What constitutes resolution, and which failures are hard stops?
Evidence and oracle Which trace, source, state, policy, test, or qualified review establishes the outcome?
Metrics and denominators What is counted, over what denominator, by which slices, with what uncertainty?
Gate and decision owner What threshold applies, what happens on miss, and who owns any exception?
Stage and monitoring Offline, shadow, canary, or experiment; what are the stop rules, rollback, and monitoring owner?

11.1 Eval tiers

flowchart TB
    subgraph "Eval Tiers (fast -> comprehensive)"
        U[Unit]:::tier
        I[Integration]:::tier
        R[Regression]:::tier
        L[Release]:::tier
    end

    U --> I
    I --> R
    R --> L

    classDef tier fill:#e1f5e1,stroke:#333;

    linkStyle default stroke:#666,stroke-width:2px

Tier Typical trigger Scope Decision
Unit Each code change Schema, grader, and deterministic policy tests Is this component valid?
Integration Pull request or scheduled Agent, tools, state, and error paths Do components work together?
Regression Prompt/model/tool change Curated golden and failure slices Did known behavior regress?
Release Candidate build Representative tasks, repeats, risk and cost slices Is evidence sufficient to stage or ship?

These tiers form a practical progression, not four unrelated test buckets. Version data and evaluators alongside code, running a small, high-signal suite during rapid iteration and a broader suite on a schedule or before release. When production reveals a failure, first understand what happened and define a trustworthy oracle. Only then add the case to regression coverage, so the suite checks a known condition rather than preserving an unexplained symptom.

11.2 Offline evaluation: fast suites vs. full suites

Offline evaluation runs a candidate on fixed or versioned cases outside live traffic. It is usually the safest way to catch known regressions and can support repeatable comparisons, provided the comparison itself is pinned: freeze the baseline, dataset, and evaluator versions. Protect holdouts from leakage, and refresh challenge cases without losing the stable regression core. The results describe the tested cases and conditions; they do not establish user impact or show that the set represents production traffic.

Prioritize high-frequency, high-severity, and deterministic checks in fast suites. Broader suites add more coverage, repeated runs, human-reviewed slices, modality variants, and cost measurements. Keep the regression core stable for comparisons; rotate challenge cases to limit overfitting. Document how cases are selected. Random sampling can miss rare, high-impact scenarios, while a targeted safety set cannot estimate prevalence without a suitable sampling design.

An incomplete run is not a pass. Count queued, timed-out, skipped, and failed-to-execute cases separately from agent failures. In a staged pipeline, block first on critical safety or correctness regressions, then finish the broader analysis before the release decision.

11.3 Quality gates and thresholds

Set gates before looking at candidate results. For every gate, name the metric, denominator, minimum sample, uncertainty rule, slice thresholds, and exception owner. Make harmful side effects and policy violations non-compensable: a high helpfulness average cannot erase an unauthorized write.

A gate can return ship, hold, or insufficient evidence. The last outcome means the sample, evaluator, or environment cannot support a decision; it is not a disguised failure label. Chapter 32 explains how to report the recommendation and residual risk.

11.4 Handling flaky evals

A flaky result changes under conditions that should be equivalent. To investigate it, track the failure signature and environment health, then compare with known-good controls. Reruns can help distinguish infrastructure noise from agent behavior, but the retry policy must be set in advance and every attempt retained. If a test is quarantined, assign an owner, record the reason and expiry, and plan its replacement.

Selecting only the first green result turns nondeterminism into selection bias. When retries are part of the product, measure first-attempt and eventual success separately; when they belong only to test infrastructure, report their frequency and investigate the cause rather than allowing repeated attempts to erase failures.

11.5 Model, prompt, and tool upgrade testing

Upgrade comparisons are most interpretable when the conditions are paired. Use the same tasks, change one component at a time where possible, freeze dataset and evaluator versions, and repeat stochastic runs. Check model and tool identifiers instead of trusting a mutable alias, then compare outcomes, safety slices, latency, cost, and judge-human agreement.

A provider can change a model without changing its API name. Treat that as a version change. Save available response metadata, keep canary tasks, and know how to roll back or switch to a fallback.

11.6 Capability evidence across deployment stages

The deployment method should follow the claim the team needs to support. Offline tests establish behavior on specified cases; shadow runs compare a candidate on eligible inputs without consequential control; live evaluation measures bounded behavior under monitoring and rollback. The candidate should carry the same task contract through each stage, but the evidence and limits change. Shadow results do not reveal what users would have done with the candidate. Use A/B tests for causal questions only when assignment is defensible and independent safety gates protect both variants.

Capability Offline and shadow evidence Live evidence and advancement condition
Tool use (Ch. 22) Offline: policy/state fixtures, tool schemas, and negative cases. Shadow: compare selected tools and arguments on eligible requests with writes blocked or isolated. Begin with bounded permissions and audited actions; expand only after authorization, wrong-record, and side-effect gates pass. A/B only for a safe user outcome, not to test a known-unsafe write.
Generative and multimodal outputs (Ch. 23) Offline: annotated assets, claim checks, qualified review by modality and slice. Shadow: process privacy-reviewed inputs without returning outputs or taking actions; compare claims and latency. Sample outputs for qualified review and monitor critical errors. A/B may inform preference or task outcomes if consent, exposure, and safety are acceptable.
RAG and memory (Ch. 24) Offline: frozen corpus/query set, relevance labels, freshness and access tests. Shadow: compare retrieved sources, memory behavior, and claims against a snapshot; prevent writes to shared memory. Monitor freshness, citation support, access violations, and deletion behavior. A/B only where a user-facing outcome is measurable and memory isolation is maintained.
Conversation (Ch. 25) Offline: scripted and reviewed dialogues, simulator validation, state/goal oracles. Shadow: candidate processes eligible turns without replying or changing state; incumbent-driven user behavior limits interpretation. Canary complete conversations with handoff and rollback. Use randomized assignment for causal user outcomes only with persistent assignment and contamination controls.
Coding and computer use (Ch. 22) Offline: reproducible repositories/apps, tests, state diffs, and side-effect checks. Shadow: replay against snapshots or disposable replicas; never reuse live write credentials. Keep execution in approved sandboxes and gate real actions separately. Production A/B is usually inapplicable; compare task outcomes in isolated, randomized evaluation environments if needed.
Long-horizon autonomy (Ch. 26) Offline: repeated scenarios, milestone oracles, dynamic-state tests, budgets, and safe-stop cases. Shadow: compare plans and simulated actions against mirrored state, with writes disabled. Advance authority through explicitly bounded staging, approvals, and rollback; maintain step, cost, and impact caps. A/B of irreversible or unsafe actions is inappropriate.
Multi-agent systems (Ch. 26) Offline: full system traces, ablations, and single-agent/fixed-workflow baselines. Shadow: replay orchestration with isolated tools and compare evidence, outcomes, and cost. Canary bounded workflows and monitor correlated failures, delegation, cost, and latency. A/B when the system-level user outcome is causal, safe, and not contaminated across users.
Safety and security (Ch. 27) Offline: authorized threat-model cases, synthetic assets, deterministic boundary checks, and independent review. Shadow: only privacy-reviewed inputs with sensitive actions blocked and no uncontrolled retention. Live exposure follows independent security approval, least privilege, monitoring, and stop procedures. Never use A/B to expose users to a known harmful or unauthorized behavior.

Before the next exposure, qualify the evaluator and trace pipeline, pass critical gates, and obtain the required approval for that exposure. If a method does not apply, record why; do not turn missing evidence into a pass. Population-impact claims need a defensible sample. Causal claims need an appropriate experiment, not just a canary or shadow comparison.

Chapter summary

Evaluation lifecycle

  • Describe the agent’s capabilities and risks, then use the six-step playbook to turn the task contract into verified regression learning.
  • Layer quick component checks with broader release suites.
  • Use offline runs to check controlled cases; gather deployment evidence separately.
  • Set gates, denominators, uncertainty rules, and risk slices before seeing results.
  • Treat incomplete evaluation as an evidence gap, not a pass or fail.
  • Keep every flaky attempt; never publish only the best retry.
  • Compare upgrades on paired tasks with pinned model, tool, and grader versions.
  • Choose canaries, shadow runs, or randomized A/B tests based on the claim each can support.
  • Match evidence to the capability and release decision.
  • Protect users with safety gates, monitoring, and rollback during online evaluation.
  • When evaluation-pipeline SLOs miss, name the evidence gap and follow the recovery plan.

For product managers. What evidence is required at each lifecycle gate? Which failures automatically block release, and who may accept residual risk? Ask how the team handles incomplete runs, silent upgrades, and rollback.

Hands-on labs (Python)

Lab 1: Evaluation lifecycle

Run python code\ch22\lab_lifecycle.py. The fictional candidate has an average improvement but violates a critical safety guardrail; the decision rule must hold it.

from bookkit.system_eval import release_decision

print(release_decision(
    baseline=0.80, candidate=0.84, lower_bound=0.01,
    safety_violations=1, max_safety_violations=0,
))
{'decision': 'hold', 'reasons': ['safety_gate_failed']}

Exercises

Evaluation lifecycle

  1. Design. Assign tests from a tool schema change to lifecycle tiers.
  2. Hands-on. Change the safety violations to zero and explain how the lower bound affects the decision.
  3. Flakiness. Write a quarantine policy with expiry and ownership.
  4. Experiment. Define guardrails and rollback criteria for a shadow-to-canary-to-A/B sequence.
  5. Discussion. What makes a release gate too strict or too weak?

Further reading

Evaluation lifecycle

  • NIST AI RMF, for risk-aware measurement and management [1].
  • Efron, for bootstrap uncertainty methods [2].
  • Miller, Adding Error Bars to Evals, for statistical framing of language-model evaluations [3].
  • OpenTelemetry GenAI conventions, for production trace context [4].
[1]
National Institute of Standards and Technology, “Artificial Intelligence Risk Management Framework (AI RMF 1.0),” National Institute of Standards; Technology, NIST AI 100-1, 2023. doi: 10.6028/NIST.AI.100-1.
[2]
B. Efron, “Bootstrap methods: Another look at the jackknife,” The Annals of Statistics, vol. 7, no. 1, pp. 1–26, 1979, doi: 10.1214/aos/1176344552.
[3]
E. Miller, “Adding error bars to evals: A statistical approach to language model evaluations.” 2024. Available: https://arxiv.org/abs/2411.00640
[4]
OpenTelemetry Authors, “OpenTelemetry semantic conventions for generative AI.” Accessed: Nov. 10, 2026. [Online]. Available: https://github.com/open-telemetry/semantic-conventions-genai