Quality, Safety, and Cost Signals

Goal

Build task-quality, safety-outcome, cost, and observability-completeness signals for an AI application alongside availability and latency, and distinguish ground truth, proxies, and unknowns.

Several meanings of “service success”

One request can be HTTP 200, valid against a schema, factually wrong, cause a tool side effect, and exceed the cost budget at the same time. Do not flatten these meanings into one success=true field.

LayerExampleData timeliness
TechnicalNot timed out, not 5xx, schema validUsually immediate
ProcessRetrieval has evidence, tool parameters are valid, loop stays within its limitImmediate or shortly delayed
Task qualityClassification is correct, answer is grounded, task is completedMay be immediate; ground truth may arrive days later
Safety/authorizationNo unauthorized action, leakage, or high-loss side effectDetection may be immediate; complete investigation is often delayed
Business outcomeUser does not reopen a ticket, a decision is adopted, no reversal occursUsually delayed and affected by external factors

Record status and evidence source for each layer separately. Do not fill an unknown with “success” before ground truth returns.

Levels of quality signals

  1. Deterministic checks — output schema, numerical range, cited-ID presence, required tool invocation.
  2. Proxy signals — user retry/reversal, human handoff, no retrieval result, rule conflict. They arrive quickly but are not ground truth.
  3. Automated scoring — task functions or versioned graders. Record the grader version and calibrate it against human judgment.
  4. Human review — sampling, expert review, and disputed-case review. Report sampling rules and agreement; do not assume the reviewed subset represents the full population.
  5. Delayed ground truth — correlate a later outcome with the release, input snapshot, and prediction at the time using a stable entity ID.

Every quality curve should show its denominator, label coverage, and freshness. “90% quality” based on only 5% coverage of easy samples is weak evidence.

Safety-signal denominator and coverage

Zero recorded security events can mean three things: none occurred, detection had no coverage, or the observability pipeline lost data. At minimum, report:

  • policy rejects/passes/check failures by policy version and task type;
  • audited unauthorized actions, leaks, successful prompt injections, or high-loss side effects;
  • the share of requests covered by safety checks and the fail-open/fail-closed state;
  • human-review sample size, wait time, and conclusion-revision rate;
  • time from occurrence to detection and from detection to containment for severe events.

Do not place raw attack text or user information in metric labels. Investigation evidence needs access control, redaction, a retention period, and auditability.

Cost is a function of traffic and structure

Total cost alone mixes “more users” with “one task is out of control.” Show these together:

  • total or estimated cost attributed by project, release, and task type;
  • cost per request, per successful task, and per business outcome;
  • input, cache-read/write, and output-token distributions;
  • model, retrieval, tool, and retry call counts;
  • price-list version, currency, discount/contract assumptions, and whether a value is an estimate or a bill.

Before an invoice arrives, a token-and-price-list figure is an estimate. Mark it as such; do not claim exact equality with billing.

LLM and Agent runtime signals

Without recording sensitive content, a versioned event or trace contract can include:

CategoryControlled signalQuestion answered
Release identityProvider, model snapshot, release/prompt/policy versionWhich release unit changed behavior?
Model useModel-call count; input/output tokens; cache tokens when the provider actually supplies themIs cost or latency driven by traffic or per-task structure?
Agent processSteps, tool calls/failures, loop-termination cause, human handoffIs there a retry storm or runaway loop?
RAG/toolsRetrieval, reranking, model, tool, and policy-check spans with statusIn which stage did time or an error occur?
OutcomeTechnical status; quality status and coverage; safety status and coverage; estimated costIs HTTP success hiding task failure?

Fields must come from a current SDK/provider response or the team’s own contract. Preserve missing values as unknown rather than converting them to zero. Semantic-convention stability is declared for specific OpenTelemetry components and signals; as of 2026-07-21, the core semantic-conventions page was 1.43.0 and GenAI conventions had moved to a separate repository. Pin the actual revision and schema/contract identifier, verify stability for the components used, and write contract tests. Do not treat a core-page version or a changing field name as a permanent fact across systems. A full release-manifest or gate SHA-256 is likewise a trace/control-audit field, never a metric label.

Monitoring completeness is a first-class signal

The following gaps can make every quality and safety curve look “better”:

  • Trace or log export failure;
  • a safety classifier timing out and the system failing open;
  • the ground-truth feedback job stopping;
  • a new release omitting version fields;
  • a data definition changing without dashboard annotation.

Monitor event count, version-field completeness, trace-propagation rate, label coverage, and end-to-end collection delay too. The Collector’s most recent successful export does not replace business-event age: they respectively tell you whether the transport chain is alive and whether the observed business stream is progressing.

Exercise and self-check

For a RAG customer-support Agent, design a signal table with at least two signals in each category: technical, process, quality, safety, cost, and observability completeness. For each signal, state denominator, timeliness, ground truth/proxy, slice, and owner. Answer:

  1. Why does no recorded safety violation fail to prove there is no safety problem?
  2. Why must task-success rate be read with label coverage?
  3. When total cost rises, how do you separate traffic growth, model change, longer outputs, and retry storms?

Summary and next step

AI runtime health is a combination of multidimensional evidence and unknowns, not one availability curve. Alert Design and On-Call Operations determines which signals merit waking a person.

References