Treat AI Quality as a Production Control Loop
August 7, 2026 · 7 min read

AI features do not fail like conventional software. An API usually returns the expected schema or an error. A model can return valid JSON, complete every tool call, stay within latency targets, and still give the user a polished but harmful answer.
That changes what production observability must do. Infrastructure metrics remain necessary, but they cannot tell you whether a generated summary omitted the key risk, an assistant used stale context, or an agent chose the wrong action.
The practical answer is not a larger dashboard. It is a control loop: capture meaningful traces, convert failures into evaluations, run those evaluations before and after releases, and use the results to change the system.
Start with failure modes, not metrics
Teams often instrument token counts, latency, model errors, and cost because those values are easy to collect. They are useful operational signals, but they are not a definition of quality.
Before choosing metrics, list the ways the feature can fail from the user's perspective. For a support assistant, that list might include:
- Inventing a policy or entitlement
- Citing evidence that does not support the answer
- Missing an escalation condition
- Exposing customer-specific information
- Calling an irreversible tool without confirmation
- Giving a technically correct but unusable response
- Refusing a request it should handle
Each failure mode should have an owner, severity, detection method, and expected response. Some can be detected automatically. Others require sampling and human review. High-severity failures may need hard runtime controls rather than evaluation alone.
This exercise prevents a common mistake: optimizing a convenient proxy while serious failures remain invisible.
Instrument the decision path
A single prompt-and-response log is rarely enough to diagnose an AI failure. Store the decision path that produced the output.
For each request, capture a trace that can connect:
- Product and tenant context, with sensitive fields redacted
- Feature, prompt, model, and configuration versions
- Retrieved document identifiers, timestamps, and scores
- Tool requests, arguments, results, retries, and approvals
- Intermediate routing or classification decisions
- Final response, structured output, and citations
- Latency, token usage, cache behavior, and cost
- Safety checks, validation failures, and fallback behavior
- User feedback and downstream outcomes
Use stable identifiers across the application, model gateway, retrieval layer, and tool services. Without correlation IDs, investigating one bad response becomes manual archaeology across several systems.
Versioning is especially important. “The assistant got worse this week” is not actionable unless you can separate a prompt change from a model update, retrieval-index refresh, policy revision, or tool-schema deployment.
Do not log hidden reasoning or unrestricted customer data. Record observable inputs, outputs, decisions, and artifacts needed for diagnosis. Apply retention limits, access controls, encryption, and tenant boundaries as you would for any sensitive production telemetry.
Build evaluations from real traffic
A useful evaluation set is not a static benchmark assembled before launch. It is a maintained portfolio of cases representing current traffic, known risks, and recent failures.
Use several sources:
- Curated examples for core product requirements
- Red-team cases for security and misuse
- Stratified samples from production traffic
- User-reported failures and support escalations
- Cases near thresholds, such as low-confidence retrieval
- Regressions discovered during incident reviews
Every serious production defect should produce a regression case. That case should preserve enough context to reproduce the behavior while removing personal or confidential information.
Avoid letting the suite become dominated by easy, frequent requests. Segment it by workflow, language, customer type, risk level, input length, tool path, and other dimensions relevant to the product. Aggregate scores can improve while an important minority segment deteriorates.
Refresh the set regularly. User behavior changes, source material evolves, models are updated, and attackers adapt. A benchmark that never changes eventually measures familiarity with the benchmark.
Use different evaluators for different claims
There is no universal “AI quality score.” Evaluation should match the claim being tested.
Use deterministic checks when the requirement is deterministic. Schema validity, citation existence, permission boundaries, required fields, forbidden terms, and tool-argument constraints should be checked in code.
Use execution-based checks for workflows with verifiable outcomes. Did the query return the correct record? Did the generated code pass tests? Did the agent create the requested ticket with the right fields? Outcome checks are usually stronger than judging prose.
Use model-based graders for qualities such as relevance, groundedness, completeness, or tone, but calibrate them against human judgments. Give graders explicit rubrics and evidence. Test their repeatability, position bias, verbosity bias, and sensitivity to prompt injection inside evaluated content.
Use human review for ambiguous, high-impact decisions. Reviewers need a clear rubric, examples of each score, and an escalation process. Measure agreement between reviewers; disagreement often reveals that the product requirement itself is unclear.
The strongest setup combines these methods instead of forcing one evaluator to cover everything.
Separate online signals from offline verdicts
Online monitoring answers: “What is happening now?” Offline evaluation answers: “Is this candidate change acceptable?” They share data but serve different decisions.
Online signals should detect operational changes quickly. Monitor conventional reliability metrics alongside AI-specific indicators such as:
- Retrieval with no usable evidence
- Unsupported citation rate
- Tool-call failure and retry rate
- Validation and policy-block rates
- Fallback frequency
- User correction or abandonment
- Cost and latency by workflow
Alert on changes within comparable segments, not only global averages. A cost increase may be reasonable for complex cases but suspicious for a simple classification path.
Offline evaluation should run against versioned candidates. Compare a proposed prompt, model, retrieval configuration, or orchestration change with the current production baseline. Report confidence intervals and case-level differences, not just a mean score.
For large changes, use shadow traffic or a limited canary before broad rollout. Production data reveals behavior that curated tests will miss, but users should not be the first line of evaluation.
Put quality gates into delivery
Evaluation without release policy becomes a report that everyone can ignore. Define gates according to risk.
A candidate might be blocked if it:
- Introduces any critical permission or privacy violation
- Regresses a high-severity slice beyond an agreed threshold
- Increases unsupported answers while improving style
- Exceeds latency or cost budgets without a documented trade-off
- Reduces evaluator confidence or test coverage
Do not require every metric to improve. AI systems involve trade-offs. A slower answer may be acceptable if it materially reduces unsafe actions. The release record should state which trade-off was accepted, by whom, and why.
Keep deployment units independently versioned where possible. Prompts, retrieval settings, model routes, policy rules, and tool schemas change at different rates. A release manifest tying those versions together makes rollback and comparison much easier.
Close the loop after incidents
When an AI incident occurs, asking only “Why did the model say that?” is too narrow. The failure may involve weak evidence, missing permissions, an ambiguous tool description, an evaluator blind spot, or a rollout that skipped a risky segment.
A useful review should produce concrete changes:
- Add or improve the trace needed to diagnose the case.
- Add the case to the appropriate evaluation slice.
- Fix the system at the strongest available layer.
- Add a release gate or runtime control when severity warrants it.
- Verify the change on historical and fresh production samples.
Prefer system constraints over prompt requests. If an agent must not issue refunds above a threshold, enforce that rule in the tool or authorization layer. An evaluator can confirm the behavior, but it should not be the only protection.
Ownership must also be explicit. Platform teams can provide tracing, experiment infrastructure, and model gateways. Product teams should own workflow-specific quality definitions. Security and compliance teams should define hard boundaries. Without this division, quality becomes a shared concern with no accountable owner.
Short takeaway
Production AI quality is not one score and observability is not one dashboard. Instrument the full decision path, turn real failures into segmented evaluations, combine deterministic and judgment-based checks, and attach results to release controls. The system improves when every failure leaves behind better telemetry, a durable regression case, and a stronger guardrail.