diff --git a/content/docs/kubernetes/main/documentation/llm/guardrails/overview.md b/content/docs/kubernetes/main/documentation/llm/guardrails/overview.md index 225deed55..8eb7e9617 100644 --- a/content/docs/kubernetes/main/documentation/llm/guardrails/overview.md +++ b/content/docs/kubernetes/main/documentation/llm/guardrails/overview.md @@ -94,7 +94,7 @@ The values that `action` takes depend on the guard, because a regex guard can ma ## Customize rejection responses -When a guard rejects content, {{< reuse "agw-docs/snippets/agentgateway.md" >}} returns a `403` response by default. Set `response.message` to return a custom response body, `response.statusCode` to change the status code, or both. You can set the `response` field on any request or response guard except a `webhook` guard, which ignores it. A webhook sets the status code and body of its own rejections. For more information, see [Custom webhooks]({{< link-hextra path="/documentation/llm/guardrails/webhook/" >}}). +When a guard rejects content, {{< reuse "agw-docs/snippets/agentgateway.md" >}} returns a `403` response by default. Set `response.message` to return a custom response body, `response.statusCode` to change the status code, and `response.headers` to add response headers. You can set the `response` field on any request or response guard except a `webhook` guard, which ignores it. A webhook sets the status code and body of its own rejections. For more information, see [Custom webhooks]({{< link-hextra path="/documentation/llm/guardrails/webhook/" >}}). For example, the following request guard returns a custom `422` response when it detects a credit card number. @@ -111,6 +111,11 @@ spec: response: message: "Request contains sensitive information." statusCode: 422 + headers: + - name: x-guardrail + value: regex + - name: content-type + value: application/json ``` The `response` settings apply only when the guard rejects content. They do not apply to a guard in `Audit` mode or to a regex guard that masks content.