public sealed class Guardrail.Types.LlmPromptSecurity : IMessage<Guardrail.Types.LlmPromptSecurity>, IEquatable<Guardrail.Types.LlmPromptSecurity>, IDeepCloneable<Guardrail.Types.LlmPromptSecurity>, IBufferMessage, IMessageReference documentation and code samples for the Gemini Enterprise for Customer Experience v1 API class Guardrail.Types.LlmPromptSecurity.
Guardrail that blocks the conversation if the input is considered unsafe based on the LLM classification.
Implements
IMessageGuardrailTypesLlmPromptSecurity, IEquatableGuardrailTypesLlmPromptSecurity, IDeepCloneableGuardrailTypesLlmPromptSecurity, IBufferMessage, IMessageNamespace
Google.Cloud.Ces.V1Assembly
Google.Cloud.Ces.V1.dll
Constructors
LlmPromptSecurity()
public LlmPromptSecurity()LlmPromptSecurity(LlmPromptSecurity)
public LlmPromptSecurity(Guardrail.Types.LlmPromptSecurity other)| Parameter | |
|---|---|
| Name | Description |
other |
GuardrailTypesLlmPromptSecurity |
Properties
CustomPolicy
public Guardrail.Types.LlmPolicy CustomPolicy { get; set; }Optional. Use a user-defined LlmPolicy to configure the security guardrail.
| Property Value | |
|---|---|
| Type | Description |
GuardrailTypesLlmPolicy |
|
DefaultSettings
public Guardrail.Types.LlmPromptSecurity.Types.DefaultSecuritySettings DefaultSettings { get; set; }Optional. Use the system's predefined default security settings. To select this mode, include an empty 'default_settings' message in the request. The 'default_prompt_template' field within will be populated by the server in the response.
| Property Value | |
|---|---|
| Type | Description |
GuardrailTypesLlmPromptSecurityTypesDefaultSecuritySettings |
|
FailOpen
public bool FailOpen { get; set; }Optional. Determines the behavior when the guardrail encounters an LLM error.
- If true: the guardrail is bypassed.
- If false (default): the guardrail triggers/blocks.
Note: If a custom policy is provided, this field is ignored in favor of the policy's 'fail_open' configuration.
| Property Value | |
|---|---|
| Type | Description |
bool |
|
SecurityConfigCase
public Guardrail.Types.LlmPromptSecurity.SecurityConfigOneofCase SecurityConfigCase { get; }| Property Value | |
|---|---|
| Type | Description |
GuardrailTypesLlmPromptSecuritySecurityConfigOneofCase |
|