Skip to main content

Online evals and regression alerts

Online evals grade real answers from production while your users are getting them. You write a rule that says which traffic to look at, how much of it to sample and how to grade each answer, for example "5 percent of support traffic, graded by a judge model for politeness". The gateway grades the sample in the background, so callers never wait for it. Every 5 minutes it compares the share of answers that passed with the window before, and when that share falls, the regression goes to your alerting channels and lands in the alerts inbox, where your team can acknowledge it, give it an owner and close it with a note. Every step is written to the audit log.

This is an enterprise feature that needs the evals licence feature, like the rest of evals. The full rule reference, with every scorer and limit, is in online scoring.

A real-world scenario​

A support team grades 5 percent of its chatbot's answers with a judge that asks "is the reply polite and does it solve the problem". On a normal day about 95 percent pass. On Thursday a provider quietly changes the model behind gpt-5.5, and answers start to ramble. Within the next hour 40 of the sampled answers have been graded and only 62 percent passed. At the next 5 minute check the gateway sees the drop, sends one eval_regression alert to the team's Slack channel and puts a warning in Alerts Inbox: "Online eval rule 'support answers' pass rate for gpt-5.5 scorer 0 (g_eval) is 62.0% over the last 60 minutes, under the threshold of 85.0%, it was 95.0% in the window before". The on-call engineer acknowledges it, assigns it to the person who owns the prompt, who pins the previous model version, and resolves the alert with the note "provider model update, pinned the older version".

How a regression is found​

For each rule with alert settings, the gateway looks at every model group and scorer of the rule on its own, called a series. For each series it compares two numbers:

  • the pass rate over the last Window minutes (60 by default), the share of graded answers that passed, and
  • the pass rate over the window before that.

A series has regressed when its pass rate is under the Minimum pass rate, or when it fell by more than the Regression threshold since the window before. A series with fewer graded answers than Minimum scored requests (20 by default) in the window is too thin to judge and never alerts, and a window before with too few graded answers gives no baseline, so then only the minimum pass rate applies.

Leave both the minimum pass rate and the regression threshold empty and the rule never alerts. Its answers are still graded and shown in the summaries.

What lands in the alerts inbox​

Each regressed series becomes one alert in the inbox, with:

  • What happened, a sentence naming the rule, the model group, the scorer, the pass rate now, the threshold and the pass rate in the window before.
  • Who, shown as Online eval rule with the rule id, which links to the Online tab of the Evals page.
  • The numbers behind it. Over the API kind is eval_regression, entity_type is online_eval_rule, entity_id is the rule id, metric is pass_rate, observed is the pass rate now, baseline_p95 is the pass rate in the window before (the minimum pass rate when that window was too thin) and threshold is the pass rate the series had to stay above.
  • Severity critical when the pass rate is at most half the threshold, for example 40 percent against a threshold of 85 percent, and warning otherwise.

A series gets at most one alert per rule, model group, scorer and day (UTC). When the pass rate falls further later that day, the same alert is updated with the lower rate instead of a new one being added. A better pass rate later never changes it. A resolved alert stays resolved for the rest of that day, and a new regression the next day opens a new alert.

The inbox alert is written whether or not Slack, email or webhook alerting is set up, and whether or not eval_regression is in general_settings.alert_types. One gateway instance claims each check, so with several instances the alert is still sent and stored once, and a rule is checked for a new alert at most once per window. The inbox alert is written before the Slack, email or webhook message goes out, so a failed send never loses it. When one rule cannot be checked, for example because of a short database error, the gateway logs a warning and goes on to the next rule.

Alerts hold numbers, the rule name, the model group and the scorer type, never a prompt, an answer or the judge's reason.

Steps​

  1. In the Admin UI open Evals, then the Online tab. You need to be a proxy admin to create or change rules.
  2. Click New rule. Give it a name, pick the traffic it watches (for example the request tag support), set Sample percentage to 5 and add a scorer, as described in online scoring.
  3. Under Alerts, set Minimum pass rate to 0.85, Regression threshold to 0.1, and keep Window (minutes) at 60 and Minimum scored requests at 20. The help under each box says what it does.
  4. Click Create rule. Grading starts on the next sampled request.
  5. Open Observability, then Alerts Inbox. A regression appears here within 5 minutes of the window that shows it. Click Acknowledge, then Assign and type the owner, and Resolve with a short note once it is explained.
  6. Open Logs, then Audit logs, and pick Alerts inbox in the Table filter to see each alert the online check created and who acknowledged, assigned and resolved it.

The same steps with curl, where $SPANWAY_PROXY_URL is your gateway and $SPANWAY_ADMIN_KEY a proxy admin key:

curl -X POST "$SPANWAY_PROXY_URL/eval/online/rules" \
-H "Authorization: Bearer $SPANWAY_ADMIN_KEY" -H "Content-Type: application/json" \
-d '{"name": "support answers", "match": {"tags": ["support"]}, "sample_percentage": 5,
"scorers": [{"type": "contains", "substrings": ["refund policy"]}],
"alert": {"min_pass_rate": 0.85, "regression_threshold": 0.1, "window_minutes": 60, "min_scored": 20}}'

curl "$SPANWAY_PROXY_URL/alerts/inbox?status=active" -H "Authorization: Bearer $SPANWAY_ADMIN_KEY"

Expected result​

Creating the rule answers 200 with the rule and its rule_id. Once a window regresses, the inbox list holds an alert like this one:

{
"alert_id": "6f0c2d9e-...",
"kind": "eval_regression",
"severity": "warning",
"entity_type": "online_eval_rule",
"entity_id": "<rule_id>",
"metric": "pass_rate",
"day": "2026-11-23",
"observed": 0.62,
"baseline_p95": 0.95,
"threshold": 0.85,
"summary": "Online eval rule 'support answers' pass rate for gpt-5.5 scorer 0 (contains) is 62.0% over the last 60 minutes, under the threshold of 85.0%, it was 95.0% in the window before",
"status": "open"
}

Acknowledge, assign and resolve it with the alerts inbox routes.

Settings​

The alert settings sit in the rule's alert block, so each rule has its own.

SettingDefaultWhat it does and when to change it
min_pass_rateemptyThe floor, from 0 to 1. A series under it regresses, for example 0.85 for 85 percent. Set it when you know what good looks like. Empty means no floor.
regression_thresholdemptyThe largest drop allowed against the window before, from 0 to 1, for example 0.1 for 10 points. Set it to catch sudden changes even while the rate is still above the floor. Empty means no drop check.
window_minutes60How much recent traffic each check compares, from 15 to 1440 minutes. Longer windows are steadier on low traffic, shorter ones react sooner on busy rules.
min_scored20The fewest graded answers a window needs before it can alert, from 1 to 10,000, so a handful of requests never pages anyone. Raise it on noisy rules.

Alerting costs nothing extra. The check only reads the stored scores, while grading itself costs what the rule's scorers cost, as online scoring explains.

Audit​

Each new inbox alert writes a created row on the table Spanway_AlertInboxTable, shown as Alerts inbox in the Admin UI audit log, by the actor online_eval_alerts, with the whole alert. An alert updated later the same day with a lower pass rate writes no new row. Acknowledge, assign and resolve write updated rows by the admin who made them, as described in alerts inbox. Creating and changing the rule itself writes rows on Online eval rules.

Errors​

The online check runs in the background and returns no errors to anyone. Creating or changing a rule returns the errors listed in evals errors, for example 422 when min_pass_rate is above 1 or window_minutes is under 15. The inbox routes return the errors listed in alerts inbox errors.

Logs​

LevelLineMeaningAction
INFOOnline eval rule <rule_id> regressed: <n> series, <n> new alerts in the alerts inboxA check found regressed series for the rule and wrote them to the inbox. New alerts can be fewer than series when a series already had an alert today.Open Alerts Inbox and work the alert.
WARNINGOnline eval rule <rule_id> regressed but the alert could not be sent: <error type>The regression is in the inbox, but the Slack, email or webhook message failed.Check the alerting settings and the receiving channel.
WARNINGOnline eval rule <rule_id> could not be checked for a regression: <error type>Reading this rule's scores or writing its inbox alert failed. The other rules were still checked.Check the database if it repeats.
ERRORJob "run_online_alerts (trigger: interval[0:05:00], ...)" raised an exceptionThe check could not read the list of rules, usually because the database could not be reached. The next check 5 minutes later tries again.Check the database if it repeats.

See the log reference.

  • Online scoring for every rule field, scorer and limit.
  • Evaluator operations to test a rule before saving it, preview its cost and restore an earlier version.
  • Alerts inbox for acknowledging, assigning and resolving alerts, and for usage anomalies.
  • Alerting for sending eval_regression alerts to Slack, email or webhooks.
  • Audit logs for reading the alert history.