Put guard policies in the configuration reference
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
dc788e5cda
commit
0b4c4f0698
3 files changed
+236
No files matched your search
@@ -129,6 +129,11 @@ var Reference = []Block{
|
||||
{Key: "sha256", Type: "string", Doc: "", Nested: ""},
|
||||
{Key: "bytes", Type: "int64", Doc: "", Nested: ""},
|
||||
}},
|
||||
{Package: "guard", Name: "Pattern", Title: "Pattern", Doc: "", Fields: []Field{
|
||||
{Key: "name", Type: "string", Doc: "", Nested: ""},
|
||||
{Key: "regex", Type: "string", Doc: "", Nested: ""},
|
||||
{Key: "action", Type: "string", Doc: "", Nested: ""},
|
||||
}},
|
||||
{Package: "config", Name: "Personal", Title: "Personal", Doc: "", Fields: []Field{
|
||||
{Key: "disabled", Type: "bool", Doc: "Disabled refuses personal keys and personal chat; people then use the\ngateway only through projects they are members of.", Nested: ""},
|
||||
{Key: "rpm", Type: "int", Doc: "", Nested: ""},
|
||||
@@ -136,6 +141,20 @@ var Reference = []Block{
|
||||
{Key: "budget", Type: "float64", Doc: "Budget is in whole units per Period (\"day\" or \"month\").", Nested: ""},
|
||||
{Key: "period", Type: "string", Doc: "", Nested: ""},
|
||||
}},
|
||||
{Package: "guard", Name: "Policy", Title: "Policy", Doc: "", Fields: []Field{
|
||||
{Key: "mode", Type: "string", Doc: "Mode: enforce acts, shadow only records what it would have done, off\ndoes nothing. Empty is enforce.", Nested: ""},
|
||||
{Key: "fail", Type: "string", Doc: "Fail: what happens when a policy cannot judge — a judge model down or\nover its latency budget. open serves, closed refuses. Empty is open.", Nested: ""},
|
||||
{Key: "no_store", Type: "bool", Doc: "NoStore keeps nothing of the request: no stored conversation, no\nmemory notes, no prefix routing, no fallback outside the cluster.", Nested: ""},
|
||||
{Key: "input", Type: "Rules", Doc: "", Nested: "guard.Rules"},
|
||||
{Key: "output", Type: "Rules", Doc: "", Nested: "guard.Rules"},
|
||||
{Key: "tools", Type: "Tools", Doc: "", Nested: "guard.Tools"},
|
||||
{Key: "max_output_tokens", Type: "int", Doc: "MaxOutputTokens is put in a request that asks for no limit; one\nasking for more is lowered to it.", Nested: ""},
|
||||
{Key: "system_prompt", Type: "string", Doc: "SystemPrompt is put before every request's messages.", Nested: ""},
|
||||
{Key: "drop_client_system", Type: "bool", Doc: "DropClientSystem removes the caller's own system and developer\nmessages, so only the pinned prompt instructs the model.", Nested: ""},
|
||||
{Key: "require_capabilities", Type: "bool", Doc: "RequireCapabilities refuses a request offering tools, or sending\nimages, to a model whose catalog entry does not say it takes them.", Nested: ""},
|
||||
{Key: "validate_structured", Type: "bool", Doc: "ValidateStructured checks an answer against the JSON schema the\nrequest asked for in response_format: one that does not fit is\nstopped — or, streamed a sentence at a time, flagged, having been\nsent already.", Nested: ""},
|
||||
{Key: "stream", Type: "string", Doc: "Stream: sentence scans a streamed answer a sentence at a time,\nreleasing each once it passes; buffer_all holds the whole answer\nuntil it is judged. Empty is sentence.", Nested: ""},
|
||||
}},
|
||||
{Package: "config", Name: "Prefix", Title: "Prefix", Doc: "", Fields: []Field{
|
||||
{Key: "enabled", Type: "bool", Doc: "", Nested: ""},
|
||||
{Key: "max_nodes", Type: "int", Doc: "MaxNodes bounds the tree, MinMatch is the shortest match worth acting on\nin bytes, and TTL is how long an entry is believed — an engine evicts on\nits own schedule, so an old record may describe a cache that is gone.", Nested: ""},
|
||||
@@ -187,6 +206,12 @@ var Reference = []Block{
|
||||
{Key: "scoring", Type: "Scoring", Doc: "", Nested: "config.Scoring"},
|
||||
{Key: "admission", Type: "Admission", Doc: "", Nested: "config.Admission"},
|
||||
}},
|
||||
{Package: "guard", Name: "Rules", Title: "Rules", Doc: "", Fields: []Field{
|
||||
{Key: "pii", Type: "map[string]string", Doc: "PII maps a kind (email, phone, iban, card, tckn, ip, secret) to what is\ndone when it is found: flag, redact or block.", Nested: ""},
|
||||
{Key: "injection", Type: "string", Doc: "Injection is what is done on signs of prompt injection: flag or block.", Nested: ""},
|
||||
{Key: "deny", Type: "[]Pattern", Doc: "Deny are patterns, matched against the text as a model reads it.", Nested: ""},
|
||||
{Key: "max_chars", Type: "int", Doc: "MaxChars refuses text longer than this; zero is no limit.", Nested: ""},
|
||||
}},
|
||||
{Package: "engines", Name: "SGLangConfig", Title: "SGLangConfig", Doc: "", Fields: []Field{
|
||||
{Key: "python", Type: "string", Doc: "Python is the interpreter of the SGLang virtualenv. SGLang is launched as\na module rather than a console script, which is the documented entry\npoint and avoids depending on the script being on PATH.", Nested: ""},
|
||||
}},
|
||||
@@ -249,6 +274,13 @@ var Reference = []Block{
|
||||
{Key: "idle", Type: "time.Duration", Doc: "", Nested: ""},
|
||||
{Key: "total", Type: "time.Duration", Doc: "", Nested: ""},
|
||||
}},
|
||||
{Package: "guard", Name: "Tools", Title: "Tools", Doc: "", Fields: []Field{
|
||||
{Key: "allow", Type: "[]string", Doc: "Allow, when set, are the only tool names a request may offer and a\nmodel may call.", Nested: ""},
|
||||
{Key: "deny", Type: "[]string", Doc: "Deny are tool names never offered or called.", Nested: ""},
|
||||
{Key: "on_denied", Type: "string", Doc: "OnDenied is strip (the tool is removed from the request) or block.\nEmpty is strip.", Nested: ""},
|
||||
{Key: "max_calls_per_turn", Type: "int", Doc: "MaxCallsPerTurn stops an answer calling more tools than this.", Nested: ""},
|
||||
{Key: "validate_arguments", Type: "bool", Doc: "ValidateArguments checks a call's arguments against the parameters\nschema the request declared for the tool.", Nested: ""},
|
||||
}},
|
||||
{Package: "config", Name: "Tracing", Title: "Tracing", Doc: "", Fields: []Field{
|
||||
{Key: "endpoint", Type: "string", Doc: "Endpoint is the collector, for example http://otel.internal:4318.\nEmpty falls back to OTEL_EXPORTER_OTLP_ENDPOINT, and to no tracing.", Nested: ""},
|
||||
{Key: "sample_ratio", Type: "float64", Doc: "SampleRatio is the share of requests traced, 0 to 1, when the caller\ndid not decide it with a sampled traceparent of its own. Zero takes 1.", Nested: ""},
|
||||
@@ -312,6 +344,10 @@ var Reference = []Block{
|
||||
{Key: "llamacpp", Type: "LlamaCppConfig", Doc: "", Nested: "engines.LlamaCppConfig"},
|
||||
{Key: "sim", Type: "SimConfig", Doc: "", Nested: "engines.SimConfig"},
|
||||
}},
|
||||
{Package: "guard", Name: "Config", Title: "guard.Config", Doc: "", Fields: []Field{
|
||||
{Key: "default", Type: "[]string", Doc: "", Nested: ""},
|
||||
{Key: "policies", Type: "map[string]Policy", Doc: "", Nested: ""},
|
||||
}},
|
||||
{Package: "supervisor", Name: "Config", Title: "supervisor.Config", Doc: "", Fields: []Field{
|
||||
{Key: "work_dir", Type: "string", Doc: "WorkDir holds pid files and per-shard scratch space.", Nested: ""},
|
||||
{Key: "log_lines", Type: "int", Doc: "LogLines is how many lines of engine output to retain per shard.", Nested: ""},
|
||||
|
||||
@@ -26,6 +26,7 @@ var Sources = []string{
|
||||
"internal/control/catalog/catalog.go",
|
||||
"internal/router/admission/controller.go",
|
||||
"internal/accounting/cost.go",
|
||||
"internal/guard/policy.go",
|
||||
}
|
||||
|
||||
// notReference are files with koanf tags that an operator never writes.
|
||||
|
||||
Reference in new issue
Block a user