The reference describes a guardrail policy's services
CI / test (push) Successful in 11m42s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-25 16:50:58 +01:00
1 parent 783dc9e9f6
commit 9e7de57816
3 files changed
+82

No files matched your search

+70
View File
@@ -382,6 +382,15 @@ rather than repeated.
| `facility` | `Facility` | [Server](#server) |
| `federation` | `Federation` | [Server](#server) |
| `endpoints` | `[]Endpoint` | [Server](#server) |
| `name` | `string` | [Service](#service) |
| `url` | `string` | [Service](#service) |
| `header_files` | `map[string]string` | [Service](#service) |
| `body` | `string` | [Service](#service) |
| `blocked` | `string` | [Service](#service) |
| `reason` | `string` | [Service](#service) |
| `on` | `string` | [Service](#service) |
| `action` | `string` | [Service](#service) |
| `timeout` | `time.Duration` | [Service](#service) |
| `stopped` | `bool` | [ServingSettings](#servingsettings) |
| `bin` | `string` | [SimConfig](#simconfig) |
| `python` | `string` | [TRTLLMConfig](#trtllmconfig) |
@@ -3292,6 +3301,67 @@ Endpoints is the phase-1 static replica list. It is only consulted when
no model declares a profile, which is what makes a router-only smoke test
against sim-engines possible without a control plane.
## Service
### `name`
`string`
Name says which service decided, in the verdict's rule.
### `url`
`string`
URL is POSTed the body.
### `header_files`
`map[string]string`
HeaderFiles are headers whose values are read from files each time,
so a rotated key needs no restart: {Authorization: /etc/…/lakera}.
### `body`
`string`
Body is the request, a template given .Text; {{json .Text}} writes it
as a JSON string. Empty is {"input": <text>}.
### `blocked`
`string`
Blocked is where in the answer the service says the text is unsafe:
a dotted path, numbers for list items (results.0.flagged). True, a
number above zero, a non-empty list or string other than "false" is
unsafe.
### `reason`
`string`
Reason is where it says why, for the verdict; optional.
### `on`
`string`
On: input, output or both. Empty is input.
### `action`
`string`
Action on unsafe: block or flag. Empty is block.
### `timeout`
`time.Duration`
Timeout bounds one call. Empty is 3s; past it the policy's fail says.
## ServingSettings
### `stopped`
+11
View File
@@ -485,6 +485,17 @@ var Reference = []Block{
{Key: "federation", Type: "Federation", Doc: "Federation is how this cluster takes part in federation with other\nllmgw clusters. The peers themselves are added at runtime, with\n`llmgw ctl federation add`, and kept in the store.", Nested: "config.Federation"},
{Key: "endpoints", Type: "[]Endpoint", Doc: "Endpoints is the phase-1 static replica list. It is only consulted when\nno model declares a profile, which is what makes a router-only smoke test\nagainst sim-engines possible without a control plane.", Nested: ""},
}},
{Package: "guard", Name: "Service", Title: "Service", Doc: "", Fields: []Field{
{Key: "name", Type: "string", Doc: "Name says which service decided, in the verdict's rule.", Nested: ""},
{Key: "url", Type: "string", Doc: "URL is POSTed the body.", Nested: ""},
{Key: "header_files", Type: "map[string]string", Doc: "HeaderFiles are headers whose values are read from files each time,\nso a rotated key needs no restart: {Authorization: /etc/…/lakera}.", Nested: ""},
{Key: "body", Type: "string", Doc: "Body is the request, a template given .Text; {{json .Text}} writes it\nas a JSON string. Empty is {\"input\": <text>}.", Nested: ""},
{Key: "blocked", Type: "string", Doc: "Blocked is where in the answer the service says the text is unsafe:\na dotted path, numbers for list items (results.0.flagged). True, a\nnumber above zero, a non-empty list or string other than \"false\" is\nunsafe.", Nested: ""},
{Key: "reason", Type: "string", Doc: "Reason is where it says why, for the verdict; optional.", Nested: ""},
{Key: "on", Type: "string", Doc: "On: input, output or both. Empty is input.", Nested: ""},
{Key: "action", Type: "string", Doc: "Action on unsafe: block or flag. Empty is block.", Nested: ""},
{Key: "timeout", Type: "time.Duration", Doc: "Timeout bounds one call. Empty is 3s; past it the policy's fail says.", Nested: ""},
}},
{Package: "config", Name: "ServingSettings", Title: "ServingSettings", Doc: "", Fields: []Field{
{Key: "stopped", Type: "bool", Doc: "Stopped takes every model down and answers every request for one with\n503 (system_stopped), leaving the control planes, agents and mirror\nrunning and every model's definition as it is: llmgw stop sets it,\nllmgw start clears it, and the models come back as their catalog\nentries ask. In force on every control plane within seconds.", Nested: ""},
}},
+1
View File
@@ -31,6 +31,7 @@ var Sources = []string{
"internal/router/admission/controller.go",
"internal/accounting/cost.go",
"internal/guard/policy.go",
"internal/guard/service.go",
"internal/guard/judge.go",
"internal/config/oidc.go",
"internal/config/ldap.go",