The console never mentioned them. A Guardrails view shows each policy with its mode, fail behaviour and checks, whether its judge models have replicas ready, where policies are attached (attach and detach from it), and what they did in a window. The admin API gains GET /api/v1/guard/events, and GET /api/v1/guard says what each policy does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
77fb48ba32
commit
c5b34978f5
9 files changed
+644
-1
No files matched your search
@@ -854,6 +854,43 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/guard/events": {
|
||||
"get": {
|
||||
"operationId": "getGuardEvents",
|
||||
"summary": "What the guardrails did: totals and the newest requests",
|
||||
"tags": [
|
||||
"guard"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "since",
|
||||
"in": "query",
|
||||
"description": "How far back: 90m, 24h, 7d; 24h when absent.",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/GuardEventsView"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"default": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/jobs": {
|
||||
"get": {
|
||||
"operationId": "getJobs",
|
||||
@@ -3849,6 +3886,115 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuardCountView": {
|
||||
"type": "object",
|
||||
"description": "GuardCountView is how many requests one policy did one thing to.",
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "string"
|
||||
},
|
||||
"action": {
|
||||
"type": "string"
|
||||
},
|
||||
"policy": {
|
||||
"type": "string"
|
||||
},
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"count": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuardEventView": {
|
||||
"type": "object",
|
||||
"description": "GuardEventView is one request the guardrails did something to.",
|
||||
"properties": {
|
||||
"at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"request_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"project": {
|
||||
"type": "string"
|
||||
},
|
||||
"model": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer"
|
||||
},
|
||||
"action": {
|
||||
"type": "string"
|
||||
},
|
||||
"policy": {
|
||||
"type": "string"
|
||||
},
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"guard_ms": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuardEventsView": {
|
||||
"type": "object",
|
||||
"description": "GuardEventsView is what the guardrails did since a moment: totals, and the newest requests.",
|
||||
"properties": {
|
||||
"since": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"counts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/GuardCountView"
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/GuardEventView"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuardPolicyView": {
|
||||
"type": "object",
|
||||
"description": "GuardPolicyView is what one policy does, in brief.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
"description": "Mode is enforce, shadow or off; Fail is open or closed."
|
||||
},
|
||||
"fail": {
|
||||
"type": "string"
|
||||
},
|
||||
"no_store": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"judge": {
|
||||
"type": "string",
|
||||
"description": "Judge is the judge model, when one reads the text."
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Checks are what it looks for, one line each: \"input: pii email → redact\"."
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuardView": {
|
||||
"type": "object",
|
||||
"description": "GuardView is the library and where its policies are attached.",
|
||||
@@ -3870,6 +4016,13 @@
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/GuardAttachmentView"
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/GuardPolicyView"
|
||||
},
|
||||
"description": "Details says what each policy does, in the order of Policies."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user