Forward Deployed EngineeringAI EngineeringEvaluation and Launch Readiness

Design the pre-launch eval suite for a customer support bot.

Question 55 of 73 · Updated

On this page

Interview-ready answer#

I would design the evaluation suite around correct customer outcomes, not how convincing the bot's responses sound. A support bot that confidently reports a refund but never issues one has failed, even if an LLM judge rates its answer highly.

I would establish the supported intents, permissible actions, policies and escalation boundaries with the customer. Then build a representative held-out conversation suite, a separate critical-risk challenge suite and a production-like integration environment. Each case includes the initial business state, authoritative evidence, expected outcome, prohibited effects and acceptable alternative resolutions.

I would evaluate three things separately: whether the bot gives the right grounded answer, whether it performs the correct authorized actions, and whether it completes or appropriately escalates the customer's task. Release gates would include absolute safety invariants, statistically supported quality thresholds, performance and cost limits. A high average score must never compensate for a cross-account data leak or unauthorized refund.

1. Define the evaluation contract before collecting examples#

Assume a commerce support bot that answers policy questions, looks up orders, assists with returns and initiates eligible refunds. The customer owns the policy and operational acceptance criteria.

Define success at the conversation level:

IntentExpected outcomeCritical failure
Policy questionCorrect applicable rule, including relevant exceptionsInvents eligibility or an unsupported guarantee
Order lookupCurrent state of the authorized orderDiscloses another customer's order
Eligible refundExactly one authorized refund for the correct amountDuplicate, excessive or unauthorized payment
Ineligible refundExplains the applicable reason or offers an approved escalationBypasses eligibility
Ambiguous requestObtains necessary clarificationMutates the wrong resource
Unresolvable problemCorrect handoff with necessary contextClaims resolution or silently abandons the user

Treat a correct escalation as a valid task outcome when the case requires escalation, not as a fully automated resolution. Treat unnecessary escalation separately so that a bot cannot obtain a high score by handing every conversation to a human.

2. Build three complementary datasets#

Representative suite. Sample authorized historical conversations across intent, customer type, product, language, channel, policy version, interaction length and complexity. Use a time-based or entity-grouped holdout to avoid leaking near-duplicate conversations into development and test sets. Record sample weights if strata are oversampled; the weighted aggregate estimates the target traffic mix.

Critical-risk suite. Deliberately oversample unauthorized requests, cross-tenant access, high-value transactions, policy exceptions, conflicting records, injection attempts and irreversible actions. Keep results separate from traffic-weighted quality. Passing a curated challenge suite is evidence against those known cases, not a population estimate of attack success.

Integration and resilience suite. Use seeded business records, a sandbox tool environment and controlled fault injection. Cover stale state, missing records, service degradation, timeouts before and after commit, duplicate delivery, concurrent updates, and escalation availability.

For example, an illustrative initial budget of 1,000 cases might contain 600 representative conversations, 250 risk-focused cases and 150 integration/fault cases. That is a starting allocation, not a statistically justified universal size. Increase coverage for rare or high-consequence failure modes using the actual launch risk tolerance.

Each test case should specify:

FieldExample
Case ID, intent and risk tagsreturn-014; refund; high risk
Conversation or interactive user scenarioCustomer requests refund, then clarifies which order
Authenticated identity, policy and initial stateOrder belongs to the customer; purchase eligible
Evidence and expected factsApplicable policy version and payment amount
Permitted outcomesOne correct refund, or clarification if required inputs are missing
Prohibited effectsAny other account access or duplicate refund
Grading rubricCorrect final state, truthful response, required confirmation

Use a scripted or stateful user simulator for multi-turn branching, but validate realism with human-reviewed scenarios. Do not let a simulator reveal hidden answers or cooperate unrealistically with bad bot behavior. Historical transcripts alone cannot test alternative interaction paths.

3. Evaluation architecture#

Loading diagram…

Run the actual application orchestration and authorization code, not just a standalone prompt. Mock dependencies for repeatable failure tests; also run integration tests against approved test services to detect mismatches that mocks cannot reveal.

Record the model, prompt, retrieval configuration, policy snapshots, fixtures, rubric version and evaluator version for reproducibility. Reset sandbox state between cases. For interactive stochastic trials, retain the initial scenario and evaluate equivalent outcomes rather than requiring identical text or tool sequences.

4. Score the dimensions that matter#

MetricDefinition or scoring rule
Correct task outcomeCases satisfying their declared outcome contract divided by evaluated cases
Correct automated resolutionCorrectly resolved without human intervention divided by eligible cases; report coverage separately
Material claim supportSupported material factual claims divided by assessed material claims; separately track required-fact omissions
Policy complianceCases satisfying all applicable policy constraints
Action correctnessVerify authorized resource, parameters and authoritative final state; track forbidden effects independently
Escalation qualityRequired handoffs completed, with appropriate routing and sufficient permitted context
Customer communicationClarity, relevance, accurate status and appropriate acknowledgment of uncertainty
Operational performanceEnd-to-end latency percentiles, errors, cost per correctly resolved task and review workload

Use both claim precision and completeness: a bot can be perfectly grounded by saying almost nothing. Check that required exceptions and next steps are present. Validate facts against current applicable evidence, not merely whether a citation exists.

For a refund, query the sandbox ledger after execution. A successful test verifies the intended payment, amount, customer, count of effects and truthful user-facing status. The precise tool sequence need not match a golden trace unless ordering or confirmation is itself a required invariant. FDE-0043 covers execution recovery; here the key is making those invariants observable in tests.

5. Adversarial and failure testing#

Design cases against the application trust boundaries, not just against the model's ability to refuse a suspicious sentence.

ChallengeExpected behavior
Customer or retrieved document asks to ignore authorizationNo prohibited action or disclosure
Cross-account identifier supplied in otherwise valid requestDeny access without revealing private existence information
A superseded policy appears more relevant than the current ruleApply the authoritative current policy or escalate ambiguity
Refund request times out after commitReconcile the result; no duplicate payment or invented failure
Customer changes their mind before approvalRespect the applicable confirmation and cancellation contract
Human handoff service unavailableExplain unavailable status and use an approved contingency

Test variants and combinations, including multilingual inputs, unusual formatting, and instructions embedded in tool responses. Check underlying state and data egress, not just the bot's final refusal text.

6. Human evaluation and judge calibration#

Use deterministic assertions where correctness is machine-observable. Reserve rubric-based grading for factual interpretation, completeness, communication and other properties that require judgment.

Define concrete anchors: for example, a complete policy answer covers the applicable rule and required exceptions, cites appropriate evidence, and does not claim unsupported facts. Have qualified human reviewers independently label a stratified sample, then adjudicate disagreements. Blind release identity where practical.

An LLM judge may scale noncritical grading after validation against those human labels. Track false passes and false failures, particularly on policy violations and unsupported claims. Agreement alone is insufficient when most cases are easy. Do not allow a judge's favorable score to override a failed deterministic assertion. Route critical or uncertain judgments to the appropriate human reviewers.

FDE-0051 addresses judge calibration in depth; the practical launch requirement here is a validated grading process with an explicit human-review boundary.

7. Statistical confidence and launch gates#

Predeclare thresholds with the customer, including the population, denominator, severity definition, confidence procedure and decision rule. Separate absolute business requirements from statistical estimates.

An illustrative launch contract might require:

GateExample acceptance criterion
Critical safetyNo observed forbidden side effects or disclosures in the challenge suite; independently enforced authorization invariants
Representative qualityOne-sided 95% lower confidence bound for correct task outcomes at least 90%
Key intent slicesAgreed minimum quality per high-volume or high-risk intent, with adequate sample sizes
GroundednessAgreed claim-support and required-fact-completeness thresholds
OperationsEnd-to-end p95 under 4 seconds for the defined automated workload; within agreed error and cost budgets
HandoffRequired escalation paths and staffing validated

These thresholds are illustrative, not industry defaults. Set them according to the customer's risk, service objectives, baseline and review capacity. Use confidence intervals appropriate to the sampling design, including stratification and clustering when needed.

Why zero observed failures is not sufficient#

For n independent representative Bernoulli trials with a fixed failure probability p, the probability of observing zero failures is (1 − p)^n. After observing zero, the exact one-sided 95% upper confidence bound is:

LaTeX

Zero failures in 300 independent trials gives an upper bound of approximately 0.994%, not zero. To place this bound at or below 0.1%, at least 2,995 zero-failure trials are needed under these assumptions.

PYTHON
from math import log, expm1, ceil, log1p def zero_failure_upper(n, alpha=0.05): if type(n) is not int or n <= 0 or not 0 < alpha < 1: raise ValueError('invalid sample size or alpha') return -expm1(log(alpha)/n) def minimum_zero_failure_cases(limit, alpha=0.05): if not 0 < limit < 1 or not 0 < alpha < 1: raise ValueError('invalid risk limit or alpha') return ceil(log(alpha)/log1p(-limit))

Executed verification: Python 3.13.5 passed 1,527 checks: 1,500 sample-size/confidence combinations checked by substitution into the zero-failure probability, 21 risk-limit/confidence combinations checked for minimum sample size, and six invalid-input cases. The functions use floating-point arithmetic; exact boundary cases should be checked numerically when a formal decision depends on them.

Do not apply these bounds to an adversarially constructed challenge set as if it were random production traffic. Repeated generations of the same scenario are not necessarily independent cases. If a critical failure is observed, investigate it, repair the underlying control and rerun the relevant regression suite; do not use the zero-failure formula. Statistical testing is not a substitute for architectural prevention of forbidden actions.

8. Convert failures into a launch decision#

Classify failures by root cause and customer consequence: policy/source defect, retrieval, model reasoning, tool selection, executor, state reconciliation or evaluator error. Assign owners and convert reproducible incidents into regression tests. Keep the final test holdout independent of iterative tuning.

If the bot passes policy QA but cannot reliably execute refunds, launch only the approved read-only scope if the customer accepts it, rather than averaging the unsafe capability into a passing score. Confirm escalation capacity and operational readiness before any customer-facing pilot.

After the pre-launch gate, use the staged release discipline from FDE-0047. Monitor actual resolution, repeat contacts, human overrides and critical incidents. A conversation ending without another message is not proof of resolution, and customer satisfaction alone cannot establish financial or policy correctness.

Related questions

Explore other topics:AI AgentsAI System DesignLarge Language Models