1. What the guardrail match log records
Every fired rule writes one match into a workspace-scoped feed (GET /api/guardrail/match, open to any Member). The feed is
separate from your request log — it stores only what a guardrail did, not
the full request body. Each match records:
The verdict
The verdict
rule_type (keyword, regex, pii, max_chars, external,
llm_judge, grounding), the effective action (block / mask /
flag / annotate / spotlight), and the stage (input or output) — so you can tell
instantly what fired and what it did.Where it fired
Where it fired
guardrail_name, the firing rule_label, plus the request context:
model_name, the token it rode in on, the caller ip, and the
request_id that joins back to your request log.A detail string
A detail string
detail — the engine’s short human-readable note for the violation
(e.g. which entity or pattern tripped), always recorded.The matched substring — only when you opt in
The matched substring — only when you opt in
matched is populated only when the guardrail’s Log raw
content toggle is on. It’s off by default, so by default the feed
tells you a rule fired and why, but never stores the sensitive string
itself.2. List and filter the match log
The default list view is cursor-paginated, newest-first, and scoped to your workspace. Narrow it with query params — the console exposes these as filter chips:| Param | Filters by |
|---|---|
guardrail_id, rule_type, action, stage | The verdict |
token_id, model_name, request_id | The request context |
days / start_at + end_at, hide_fp | Window and false-positive state |
Management routes like
/api/guardrail/* authenticate with your
console session / access token, not a relay key. The sk-orca-... keys
are only for /v1/* model calls. In day-to-day use you’ll read the feed
straight from the Matches tab on the Guardrails page.3. Group by request
A single request can trip several rules at once — an input PII mask and a max-length cap, say. The grouped view (GET /api/guardrail/match/grouped, Member) collapses matches by
request_id so you see one row per offending request with its matches
folded inline, instead of scrolling past five rows for the same call.
Tune how many matches show inline per group with inline_limit
(default 5).
4. Stats and the trend strip
The stats endpoint (GET /api/guardrail/match/stats, Member) powers the
count strip and chart on the Matches tab — totals over a days window,
optionally broken down with group_by:
group_by | Breakdown |
|---|---|
| (omitted) | Totals only |
rule_type | Which rule types fire most |
guardrail_id | Which guardrail accounts for the activity |
request_id to get a constant-time match count for one request
(used by the request-log cross-link). This is where per-guardrail usage,
action mix, and false-positive rate live — slice it rather than paging
the raw list.
5. Export for an audit trail
When you need matches outside the console — an evidence pack, a spreadsheet, a downstream SIEM —GET /api/guardrail/match/export
(Member) streams your current filter set as CSV or JSON:
6. Triage false positives
Not every match is a real hit. When a rule fires on benign traffic, a workspace Admin can mark the match as a false positive (POST /api/guardrail/match/:id/mark-fp); the inverse
DELETE /api/guardrail/match/:id/mark-fp un-marks it. Marking is
Admin-only even though the rest of the feed is Member-readable —
triage is a privileged action.
Marking a false positive does two things: it tags the match (so
hide_fp=true filters it out of the feed) and remembers the finding so
the same rule on the same content is skipped on future requests. Un-mark
to restore enforcement. For the broader workflow of tuning a noisy rule,
see Tune false positives.
A match is diagnostic data, not an enforcement decision. Whether a
request was blocked, masked, or merely flagged is already settled by the
action at request time — the feed is the
record after the fact. Marking a false positive changes future
behavior, never the call that already happened.
7. Where matches come from
Matches are produced by the guardrail engine on the relay path, so the feed reflects exactly what your attached policies did:- Input-stage matches record what the gateway screened before the model saw it — see Input stage.
- Output-stage matches record what it screened on the response — see Output stage.
- A blocked request also surfaces as an
HTTP 400
guardrail_blockedto the caller; the match is the server-side record of it.
8. Related
Guardrails reference
The full engine: rule types, stages, actions, presets, eval harness.
Logging & privacy
The Log raw content toggle and what the feed does — and doesn’t — store.
Tune false positives
Use the feed to find and quiet noisy rules without weakening the policy.
Versioning
Diff and revert a guardrail when the feed shows a change misfired.
