Files
llmgw/internal/web/templates/admin_guard.html
T
Ilker ManapandClaude Opus 5.5 249a91aeec Guardrails turn off and on; a judge's refusal says which hazard; ctl guard judge ask
guard.enabled (unset is on) makes every policy check nothing while false,
live: llmgw ctl guard off/on set it in the cluster's settings, and ctl
status, ctl guard list and the guardrails page say when they are off.

A refusal by a judge names the hazard it saw - judge: S6,Specialized
Advice - and the verdict is kept with the request in a new usage column,
guard_rule, shown by ctl request, the request log and the guardrails page.

llmgw ctl guard judge ask has a judge read a text, past the cache, and shows
its raw answer and how it is read; the endpoint is kept out of the audit so
no text is recorded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 12:41:08 +02:00

49 lines
2.6 KiB
HTML

{{define "admin_guard"}}<!doctype html>
<html lang="{{lang}}"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{t "guard.title"}} · llmgw</title><link rel="stylesheet" href="{{stylesheet}}">
</head><body><div class="wrap">
<header>
<h1>{{t "guard.title"}}</h1>
<p class="sub">{{t "guard.sub"}}</p>
{{template "nav" .Nav}}
</header>
{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
{{if .Off}}<p class="error" role="alert">{{th "guard.off"}}</p>{{end}}
<h2>{{t "guard.policies"}}</h2>
{{if .Policies}}
<p>{{th "guard.defined_in"}} {{range $i, $p := .Policies}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}.
{{t "guard.applied"}} {{if .Default}}{{range $i, $p := .Default}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}{{else}}{{t "common.none"}}{{end}}.</p>
{{if .Attachments}}
<table class="rows">
<tr><th>{{t "guard.col.scope"}}</th><th>{{t "guard.col.who"}}</th><th>{{t "guard.col.policy"}}</th></tr>
{{range .Attachments}}<tr><td>{{.Scope}}</td><td>{{.Who}}</td><td><code>{{.Policy}}</code></td></tr>{{end}}
</table>
{{else}}<p class="sub">{{th "guard.attached_nowhere"}}</p>{{end}}
{{else}}
<p>{{th "guard.no_policies"}}</p>
{{end}}
<h2>{{t "guard.what_they_did"}}</h2>
<p class="sub">{{t "guard.over_last"}}
{{range .Windows}}{{if eq . $.Window}}<strong>{{.}}</strong>{{else}}<a href="?window={{.}}">{{.}}</a>{{end}} {{end}}</p>
{{if .Counts}}
<table class="rows">
<tr><th>{{t "guard.col.where"}}</th><th>{{t "guard.col.action"}}</th><th>{{t "guard.col.policy"}}</th><th>{{t "guard.col.category"}}</th><th class="num">{{t "guard.col.requests"}}</th></tr>
{{range .Counts}}<tr><td>{{.Where}}</td><td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}</td><td class="num">{{count .Count}}</td></tr>{{end}}
</table>
{{else}}<p class="sub">{{t "guard.nothing"}}</p>{{end}}
{{if .Events}}
<h2>{{t "guard.recent"}}</h2>
<table class="rows">
<tr><th>{{t "guard.col.when"}}</th><th>{{t "guard.col.request"}}</th><th>{{t "guard.col.where"}}</th><th>{{t "guard.col.model"}}</th><th>{{t "guard.col.action"}}</th><th>{{t "guard.col.policy"}}</th><th>{{t "guard.col.category"}}</th><th class="num">{{t "guard.col.status"}}</th><th class="num">ms</th></tr>
{{range .Events}}<tr><td>{{.At}}</td><td><code>{{.RequestID}}</code></td><td>{{.Where}}</td><td>{{.Model}}</td>
<td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}{{if .Rule}} · {{.Rule}}{{end}}</td><td class="num">{{.Status}}</td><td class="num">{{count .Ms}}</td></tr>{{end}}
</table>
<p class="sub">{{th "guard.request_hint"}}</p>
{{end}}
<footer><span>llmgw {{.Version}}</span>{{template "langs"}}</footer>
</div></body></html>{{end}}