Guardrails Monitor page
The Guardrails Monitor page shows how your guardrails behave on live traffic over a date range. For each guardrail you see how many requests it evaluated, how many it blocked or flagged and the cost of its provider usage, and you can open the individual requests with the time the guardrail took on each. The average latency a guardrail adds is not tracked yet, so its card and column read Not tracked yet or a dash. Open it at /ui/guardrails-monitor. It sits under Observability in the left nav as Guardrails Monitor, at the bottom of that group.
The nav item is shown to the session roles Admin and Admin Viewer (proxy_admin_viewer). The page checks the same capability again. Org admins, internal users and internal viewers who open the URL directly see "Guardrails Monitor is only available to admin users." The page only reads data, so a view only admin sees everything a proxy admin sees. No license feature is checked.
The numbers come from the proxy's daily guardrail metrics, which the gateway builds when it writes its spend logs, so they cover requests that reached the gateway while spend logs were written. With general_settings.disable_spend_logs: true (off by default) nothing is recorded and the page stays empty. The start of each request's input in the logs list comes from the stored prompt, so with general_settings.store_prompts_in_spend_logs unset (the default) every entry shows a dash instead of the input, while the outcome, model and time are still shown. See the settings reference. Both config file guardrails and database guardrails are included.
A real-world scenario
Users report that many of their questions are refused since a new content filter went live. The admin opens the Guardrails Monitor for the last seven days, sorts the guardrails by fail rate, sees that the new filter blocks 18 percent of requests while the others block under 2, and opens its blocked requests to check whether the blocks are false positives.
Steps
-
Open Guardrails Monitor under Observability, or go to
/ui/guardrails-monitor. -
Keep the default last seven days, or pick a range in the date picker.
-
Read the metric cards and sort the Guardrail Performance table. The same data with the API:
curl "http://localhost:4000/guardrails/usage/overview?start_date=2026-11-14&end_date=2026-11-21" \-H "Authorization: Bearer $SPANWAY_MASTER_KEY" -
Click a guardrail and open its Logs tab to see the requests it blocked. With the API,
curl "http://localhost:4000/guardrails/usage/logs?guardrail_id=<id>&start_date=2026-11-14&end_date=2026-11-21" -H "Authorization: Bearer $SPANWAY_MASTER_KEY".
Expected result
Each guardrail shows its evaluated requests, fail rate and cost, and the detail view lists its individual requests with the outcome and the milliseconds the guardrail took on each.
Overview
The overview opens first. Its header reads Guardrails Monitor with the line "Monitor guardrail performance across all requests".
| Control | Type | What it does |
|---|---|---|
| Date range | Date range picker | The days to report on. Defaults to the last seven days. The proxy accepts at most 366 days and refuses an end date before the start date. The same range is kept when you open a guardrail. |
| Export Data | Button | Not implemented yet. Its tooltip says "Coming soon" and clicking it does nothing. |
Metric cards
| Card | Meaning |
|---|---|
| Total Evaluations | The number of guardrail evaluations in the range, summed over all guardrails. |
| Blocked Requests | How many of those evaluations blocked the request or response. |
| Pass Rate | The share of evaluations that did not block, as a percentage. It reads 100 percent when there were no evaluations. |
| Avg. latency added | Not tracked yet. The gateway does not store an average latency per guardrail, so the card reads Not tracked yet. Use the per request times in a guardrail's Logs tab instead. |
| Guardrail Cost | The total priced cost of guardrail provider usage, or a dash when nothing was priced. When some usage units have no known price, the card says how many are unpriced. How is this calculated? opens a breakdown with one line per guardrail and the note that each guardrail's cost is its units per counter times that counter's price from the cost map. |
| Active Guardrails | The number of rows in the table below. This counts every guardrail the proxy knows about, including ones that evaluated nothing in the range. |
Request Outcomes Over Time
A stacked bar chart with one bar per day, split into passed and blocked. It shows "No chart data for this period" when there is nothing to plot.
Guardrail Performance table
The table lists one row per guardrail. Guardrails that have metrics but no longer exist in the proxy's guardrail list (for example ones that were deleted, or ones recorded under another name) appear as extra rows with the provider Custom. Click a row, or the guardrail's name, to open its detail view, which for a Custom row shows its metrics under that name. The settings button next to the table title opens Evaluation Settings, described below.
| Column | Meaning |
|---|---|
| Status | A coloured dot and label derived from the fail rate. healthy up to 5 percent, warning above 5 percent, critical above 15 percent. |
| Guardrail | The guardrail name. |
| Provider | The guardrail's provider key as stored, such as bedrock, or Custom for metrics that match no known guardrail. |
| Requests | The number of evaluations. Sortable. |
| Fail Rate | Blocked evaluations as a percentage, coloured like the status. An up or down arrow shows the change against the seven days before the start of the range. Sortable, and the default sort is fail rate, highest first. |
| Avg. latency added | A dash, because the average latency is not tracked yet. |
| Usage Units | The total billable units the provider reported. Hover to see the units per counter. A dash means none. |
| Cost | The priced cost of those units, or a dash. A warning icon means some units had no known price and were left out. Sortable. |
Guardrail detail
The detail view opens when you pick a guardrail. Its ID is kept in the guardrail query parameter, so you can link to it, and the browser back button returns to the overview. Back to Overview does the same. The date range picker stays at the top.
The header shows the guardrail name, a status badge (Healthy, Warning or Critical), the description from the guardrail's information if it has one, the provider key as a badge, and the Evaluation settings button.
The view has two tabs, Overview and Logs.
Overview tab
| Card | Meaning |
|---|---|
| Requests Evaluated | Evaluations in the range. |
| Fail Rate | Blocked evaluations as a percentage, with the estimated number blocked underneath. A warning icon appears above 15 percent. |
| Avg. latency added | A dash with "No data", because the average latency is not tracked yet. |
Below the cards, Usage & Cost explains the billable units the provider reported and what Spanway priced them at. It shows "No billable usage units were recorded in this period." when there are none. Otherwise it shows two cards and three tables.
| Element | Meaning |
|---|---|
| Cost card | The priced cost, with the number of unpriced units when there are any. How is this calculated? shows priced units times the price per unit for each counter. Prices come from the cost map that ships with Spanway. |
| Usage Units card | The total units and the number of counters. How is this calculated? lists the units per counter. |
| By counter | Columns Counter, Units, Cost and Unpriced Units. |
| By team | The same figures per team. Requests without a team show No team. Team IDs can be copied. |
| By key | The same figures per virtual key. Requests without a key show No key. |
When some units have no known price, a note says how many were left out of the cost and links to the Spanway support page with a pricing request filled in.
The tab ends with the same log list as the Logs tab.
Logs tab
The log list shows the requests this guardrail evaluated in the selected range, newest first, and loads again when you change the range. The proxy returns at most 50 entries for the view. The API's action filter (blocked, passed, flagged or not_run) applies to the returned page only, so total still counts every outcome. The heading shows the guardrail name and "Showing N of M entries", where M is the total number of matching requests.
| Control | Type | What it does |
|---|---|---|
| All, Blocked, Flagged, Passed | Filter buttons | Show only entries with that outcome. Filtering happens on the entries already loaded. |
| Sample 10, 50, 100 | Buttons | How many of the loaded entries to show. Defaults to 10. Because only 50 entries are loaded, 100 shows the same as 50. |
| Entry | Button | Opens the request's log details drawer, the same drawer as on the Logs page. |
Each entry shows an outcome badge, the timestamp, the model and the start of the request input. When your custom role hides prompts, responses or tool call arguments, the start of the input, the start of the output and the guardrail's reason read [hidden by your role] wherever they would quote that content.
| Badge | Meaning |
|---|---|
| Blocked | The guardrail blocked the request or response. |
| Flagged | The guardrail flagged it without blocking, or the guardrail failed or returned an error. |
| Passed | The guardrail let it through, including entries with no recorded status. |
| Not run | The request recorded the guardrail as not run. The filter buttons have no Not run option. |
Evaluation Settings dialog
The settings button on the overview and on a guardrail's detail view opens Evaluation Settings, meant for re-running an AI evaluation of guardrail decisions over the logs.
| Control | Type | What it does |
|---|---|---|
| Evaluation Prompt | Text area | The system prompt for the evaluation model. Reset to default restores the built in prompt, which asks the model whether each decision was correct or a false positive or false negative. |
| Response Schema | Text area | The JSON schema for the structured verdict. |
| Model | Searchable dropdown | A model from this proxy. |
| Run Evaluation | Button | Disabled, because evaluation runs are not built yet. |
| Cancel | Button | Closes the dialog. |
This dialog is not connected to anything yet. It says "Not available yet" at the top, Run Evaluation stays disabled, nothing runs and the prompt, schema and model are not saved.
Empty, error and disabled states
| State | What you see and what to do |
|---|---|
| No guardrail traffic in the range | The cards show zeros, the chart shows "No chart data for this period" and rows show zero requests. Widen the date range or check that guardrails are attached and spend logs are on. |
| No guardrails at all | The table shows "No data for this period". Create guardrails on the Guardrails page. |
| Overview fails to load | "Failed to load data. Try again." above the table. Reload the page. An invalid date range also lands here. |
| Detail fails to load | "Failed to load guardrail details." with Back to Overview. A guardrail that no longer exists and has no metrics in the range returns this, and so does a gateway without a database. |
| No logs | "No logs for this period. Select a guardrail and date range." and "No logs to display. Adjust filters or date range." |
| Not an admin | "Guardrails Monitor is only available to admin users." |
Differences by role and license
| Role | What changes |
|---|---|
Admin and Admin Viewer (proxy_admin_viewer) | Full page. Everything on it is read only. |
| Org Admin, Internal User, Internal Viewer | The nav item is hidden and the page shows the admin only notice. |
No license feature is checked on this page.
Errors
The usage routes answer a bad date range with a plain {"detail": "<message>"} body.
| Status and message | What it means | Fix |
|---|---|---|
400 start_date and end_date must be in YYYY-MM-DD format | The overview or detail was sent a date that is not a calendar date. | Send dates like 2026-11-21. |
400 start_date and end_date must be ISO dates such as 2026-11-21 or 2026-11-21T09:30:00Z | The logs route was sent a date it cannot read. | Send a date or a full ISO timestamp. |
400 start_date must be on or before end_date | The end of the range is before the start. | Swap the dates. |
400 Date range too large; maximum is 366 days | The range is longer than 366 days. | Pick a shorter range. |
401 Authentication Error, ... or 403 | The key is not a proxy admin or admin viewer key. | Use an admin key. |
404 Guardrail not found | The detail was asked for a guardrail that does not exist and has no metrics in the range. | Pick a guardrail from the overview. |
500 Prisma client not initialized | The detail route needs the gateway database. The overview and the logs return empty data instead. | Connect the database. |
| A guardrail shows no requests | It did not run in the range, or spend logs are off. | Check that it is attached, and that disable_spend_logs is not set. |
| Export Data does nothing | It is not built yet. | Use the API above. |
Logs
| Level | Line | Meaning | Action |
|---|---|---|---|
| WARNING | Spend tracking - guardrail usage tracking failed (non-fatal): <error> | The day's guardrail figures could not be updated for one batch of requests, so the page undercounts them. Requests were not affected. | Check the database when it repeats. |
| WARNING | Guardrail usage tracking failed (non-fatal): <error> | The same, from inside the rollup. | Check the database. |
| WARNING | Guardrail usage tracking: <rows> upsert failed for <key> after <n> retries; requeued for the next flush (non-fatal): <error> | A daily row could not be written and is retried with the next batch. | None unless it repeats. |
| WARNING | Guardrail usage tracking: <rows> upsert failed for <key> and is not safe to retry (non-fatal): <error> | A daily row was dropped, so that day undercounts. | Check the database. |
| WARNING | Guardrail usage tracking: pending <rows> requeue exceeds 10000 rows; dropping the <n> oldest (non-fatal) | The database was unreachable long enough that queued figures were dropped, so the page undercounts that period. | Fix the database connection. |