Response metadata is available for debugging and observability
Why it matters
Without logging model name, token usage, and latency on AI calls, there is no operational visibility into cost trajectories, quality degradation, or performance regressions. A model version bump by the provider, a prompt change that doubles token usage, or a latency spike affecting user experience will go undetected until users report problems. NIST AI RMF MEASURE-2.7 requires that AI systems have mechanisms for ongoing performance measurement. ISO 25010:2011 maintainability requires that system behavior is observable. The observability infrastructure is low-effort to add and eliminates an entire class of invisible production failures.
Severity rationale
Info because the absence of observability does not directly cause user-visible failures, but it makes every other AI reliability issue — cost overruns, quality degradation, latency regressions — invisible until they become critical.
Remediation
Add minimal structured logging to every AI API call:
const t0 = Date.now()
const response = await openai.chat.completions.create({ model: process.env.OPENAI_MODEL ?? 'gpt-4o', ... })
console.log(JSON.stringify({
model: response.model,
promptTokens: response.usage?.prompt_tokens,
completionTokens: response.usage?.completion_tokens,
finishReason: response.choices[0]?.finish_reason,
latencyMs: Date.now() - t0
}))
For production, route this telemetry to Helicone, Braintrust, or LangSmith rather than console.log. Also ensure the model name is configured via process.env.OPENAI_MODEL rather than hardcoded so version changes are tracked through config rather than code diffs.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Response Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability — Analysability
- nist-ai-rmf:1.0 · MEASURE 2.7 — AI system performance or assurance criteria are measured
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-response-quality·automated