GuardrailLlmPolicy
import type { GuardrailLlmPolicy } from "https://googleapis.deno.dev/v1/ces:v1.ts";Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.
§Properties
Optional. By default, the LLM policy check is bypassed for short utterances. Enabling this setting applies the policy check to all utterances, including those that would normally be skipped.
Optional. If an error occurs during the policy check, fail open and do not trigger the guardrail.
Optional. When checking this policy, consider the last 'n' messages in the conversation. When not set a default value of 10 will be used.
Optional. Model settings.
Required. Defines when to apply the policy check during the conversation.
If set to POLICY_SCOPE_UNSPECIFIED, the policy will be applied to the
user input. When applying the policy to the agent response, additional
latency will be introduced before the agent can respond.