Pre-release evaluation tells you a system was good on the day you tested it. Production monitoring tells you whether it is still good. Claude systems degrade in ways that ordinary services do not: the HTTP status stays 200 while answers get worse because the input mix shifted, a retrieval index was rebuilt, a tool changed its output, or a prompt edit quietly harmed one slice of traffic. Lesson 1.4 covers what to log and trace across an LLM, agent and tool integration, including correlation across multi-agent runs and the privacy of logged content. This lesson takes those logs as given and asks a different question: what do you watch, what do you alert on, and how do you catch quality decay early enough to matter?
Anthropic’s agent-evals write-up positions monitoring as one layer among several. It reveals real user behaviour at scale and catches what synthetic evals miss, but it is reactive: problems reach users before you know. Automated evals give fast iteration before release, and user feedback is sparse, self-selected and skews toward severe issues. A monitoring design should say which failures it is expected to catch, and which it is not.
Three families of signals
| Family | Signals | Where they come from | Alert on |
|---|---|---|---|
| Operational | Time to first token and total latency percentiles; error rate by status and error.type; retries; timeouts; share of responses that stopped at max_tokens | Your request log and response fields; the request-id header | Percentile shifts against baseline; sustained error-rate rise; 429 and 529 treated separately; truncation spikes |
| Economic | Input, output, cache-read and cache-write tokens; cache-read share; cost per completed task; batch share; spend by model and workspace | The usage object per call; the Usage and Cost Admin API; Console Usage and Cost pages | Cost per task drift; cache-read share drop; spend approaching a limit |
| Quality and safety | Sampled judge scores; groundedness or citation-check failures; guardrail and injection-screen trigger rates; refusal and escalation rates; edit or thumbs-down rates; task-completion proxies | Online scoring of sampled traffic; guardrail logs; product analytics; human review | Score drop on a slice; rise in guardrail triggers; jump in escalations or corrections |
Some notes for architects. The Usage and Cost Admin API needs Admin API credentials, and usage typically appears within about five minutes; daily cost buckets and per-request logs answer different questions. Anthropic lists observability partners (Datadog, Grafana Cloud, Honeycomb and others) for dashboards and alerts on usage and cost. Neither replaces your own per-request log, because only that log can join tokens and latency to task outcome and prompt version.
Instrument so that every signal can be explained
For each call record a stable set of fields: request id, timestamp, model ID, prompt and tool-set version, experiment variant, effort and other parameters, latency (first token and total), the usage fields, stop_reason, error status and type, tool calls and outcome, and a task or conversation id that lets you compute per-task cost and success. Tag deploys, prompt changes, model migrations, retrieval index rebuilds and tool changes as events on the same timeline, because most regressions coincide with one of them. Logged prompts and outputs can contain personal or regulated data, so apply redaction, retention limits and access control from the start (Lessons 1.4 and 4.4).
Detecting drift and regressions
Separate the sources of change, because they need different detectors:
- Input drift. Users start asking different things, or in different languages, or with longer documents. Watch input length, intent or topic mix, and the share of cases that fall outside your evaluation slices. New clusters are candidates for new eval cases (Lesson 3.2).
- Your own changes. Prompts, tool definitions, retrieval indexes, chunking and upstream data change often. Every Claude model ID is a pinned snapshot, so an unchanged ID does not silently change its behaviour; model changes are deliberate migrations you should treat as experiments (Lesson 3.3). That makes your own release events the most likely regression source.
- Dependency drift. A tool API changes its schema, an index goes stale, a rate limit tier changes. These show up as tool errors, retrieval misses or rising latency.
Two detectors work together. Scheduled replay runs your held-out or regression set against the live pipeline on a schedule and after every change, comparing to a stored baseline with a pre-set tolerance; it is deterministic in inputs, so movement means the system changed. Online sampling scores a sample of real traffic with a judge (different model, fixed rubric, calibrated against humans; Lesson 3.1) and tracks the score per slice over time; it catches problems your fixed set does not contain. Compare against a baseline window rather than an absolute number, use enough samples per window that noise is not mistaken for signal, and remember that non-determinism means single-run swings are expected.
Key concept: monitoring closes the evaluation loop
Monitoring is not separate from evaluation. Production failures found by sampling, feedback and alerts become new cases in the evaluation dataset, the fixed judge is re-calibrated on freshly human-labelled samples, and each fix is validated offline and online before rollout (Lessons 3.2 and 3.3). A monitoring system that never feeds back into the eval set finds the same failure repeatedly.
Alerting that people will trust
- Alert on user-visible symptoms tied to your SLOs, and use dashboards for causes. Page on “p95 latency above the objective for N minutes”, not on a single slow call.
- Use percentiles and baselines, not averages. Means hide tails, and a fixed threshold ignores daily patterns. Compare with the same period in prior weeks where traffic is seasonal.
- Separate error classes. A 429 means your own limit or a spend cap was hit; a 529 or 500 is capacity or a fault on the provider side; a 400 is your bug. Anthropic notes that a tier spend cap can return a 429 with no
retry-afterheader that keeps failing, so it needs its own alert rather than blind retries. The API also returns a 400 once an organisation or workspace spend limit you set is reached, so alert on spend approaching that limit before it turns into an outage. Batches may slightly exceed a workspace spend limit. - Watch truncation and format failures. A rise in
max_tokensstops or unparseable outputs is an early sign of a prompt or data change. - Control noise. Tier severity, require persistence across windows, route quality alerts to a review queue and outages to on-call, and attach a runbook (Lesson 3.4 gives the diagnostic order; Lesson 3.3 gives rollback).
Sampling for human review
Humans cannot read all traffic, so sample deliberately. Use a random baseline sample to estimate overall quality without bias, plus targeted samples: low judge scores, guardrail or injection-screen triggers, negative feedback, escalations, very long or unusual inputs, new topic clusters and outputs near a decision threshold. Stratify by slice so rare but important segments are not drowned out. Size the review load to reviewer capacity (Lesson 4.3 covers reviewer load and automation bias), record reviewer labels with rubric versions, and use disagreement between reviewers and the judge to recalibrate the judge. Every confirmed failure gets a root-cause label and, where useful, becomes an eval case.
Common exam distractor
Beware answers that equate health with availability (“the API returns 200 and error rates are flat”), alert on mean latency, rely only on user thumbs-up or thumbs-down as the quality signal, or treat production monitoring as a replacement for pre-release evaluation. Quality drift can occur with every technical metric green; the exam favours sampled quality scoring, scheduled replay of a regression set, baseline-relative alerts, and monitoring layered on top of offline evals.