Groundedness Guard Policy
General Information
Policy Types
ai-groundedness-guard
Response-phase only, non-streaming responses only. Always judge-based — there is no cheap deterministic check for "is this text supported by that text", so a judge configuration is required.
Endpoints
List Policies
GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/
Add Policy
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Update Policy
PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Delete Policy
DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Scope
This policy only checks the response against the RAG context your own Apinizer proxy retrieved and injected in the same request/response cycle — it is not a general "is this fact true" check against outside knowledge, and it produces no per-claim citations. It only detects the retrieved context when the RAG Injection policy on the same proxy uses injectionMode=TEMPLATE (the default template, or a custom one that still contains the <CONTEXT>...</CONTEXT> markers). When no RAG context is detectable — including a request the RAG Injection policy did not touch at all — this policy is a silent no-op, not an error.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | No | FLAG (monitoring-only, default) or BLOCK. |
| failMode | string | No | FAIL_OPEN or FAIL_CLOSED — behaviour when the judge call itself errors or times out. Default FAIL_CLOSED: the response is blocked rather than let an unverified answer through. |
| latencyMode | string | No | INLINE, ASYNC or SHADOW. Default INLINE — this is a response-blocking security check, so it does not default to fire-and-forget the way some other AI guardrails do. |
| maxWaitMs | integer | No | Bounded max wait (ms) for ASYNC/INLINE. Default 3000. |
| externalGuardrail | object | Yes | The judge configuration. See Judge fields. Always required — this policy has no builtin, non-judge leg. |
| maxContextChars | integer | No | Truncation cap (chars) for the retrieved context before it is composed into the judge's input. Default 6000. |
| maxResponseChars | integer | No | Truncation cap (chars) for the response text before it is composed into the judge's input. Default 4000. |
Judge fields
externalGuardrail is always type: "llm-judge" for this policy — there is no http-dlp option, unlike the DLP-family guardrails.
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Must be llm-judge. |
| llmProviderName | string | Yes | Name of the LLM connection to call as the judge. Resolved server-side; an unknown name is rejected with 400. |
| modelId | string | No | Judge model identifier. |
| promptTemplate | string | Yes | The judge's prompt template. Unlike the Prompt Guard policy, a blank template is rejected, not defaulted — a blank template falls back to a generic safety-taxonomy judge that does not answer a groundedness question at all. |
| jsonMode | boolean | No | Whether the judge is asked to respond in JSON mode. |
| maxOutputTokens | integer | No | Judge max output tokens. |
| timeoutMs | integer | No | HTTP call timeout (ms). |
| maxInputChars | integer | No | Max input characters sent to the judge. |
List Policies
Endpoint
GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |