Interface GuardrailProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
GuardrailProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-09-02T11:25:42.810Z")
@Stability(Experimental)
public interface GuardrailProps
extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for creating a Guardrail.
Example:
Guardrail guardrail = Guardrail.Builder.create(this, "bedrockGuardrails") .guardrailName("my-BedrockGuardrails") .build(); // Add regex filter with input/output actions guardrail.addRegexFilter(RegexFilter.builder() .name("TestRegexFilter") .pattern("test-pattern") .action(GuardrailAction.ANONYMIZE) // below props are optional .description("This is a test regex filter") .inputAction(GuardrailAction.BLOCK) .inputEnabled(true) .outputAction(GuardrailAction.ANONYMIZE) .outputEnabled(true) .build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forGuardrailProps
static final class
An implementation forGuardrailProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic GuardrailProps.Builder
builder()
default String
(experimental) The message to return when the guardrail blocks a prompt.default String
(experimental) The message to return when the guardrail blocks a model response.default List
<ContentFilter> (experimental) The content filters to apply to the guardrail.default TierConfig
(experimental) The tier configuration to apply to the guardrail.default List
<ContextualGroundingFilter> (experimental) The contextual grounding filters to apply to the guardrail.(experimental) The cross-region configuration for the guardrail.(experimental) A list of policies related to topics that the guardrail should deny.default String
(experimental) The description of the guardrail.(experimental) The name of the guardrail.default IKey
(experimental) A custom KMS key to use for encrypting data.default List
<ManagedWordFilter> (experimental) The managed word filters to apply to the guardrail.(experimental) The PII filters to apply to the guardrail.default List
<RegexFilter> (experimental) The regular expression (regex) filters to apply to the guardrail.default TierConfig
(experimental) The tier configuration to apply to the guardrail.default List
<WordFilter> (experimental) The word filters to apply to the guardrail.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getGuardrailName
(experimental) The name of the guardrail.This will be used as the physical name of the guardrail.
-
getBlockedInputMessaging
(experimental) The message to return when the guardrail blocks a prompt.Must be between 1 and 500 characters.
Default: "Sorry, your query violates our usage policy."
-
getBlockedOutputsMessaging
(experimental) The message to return when the guardrail blocks a model response.Must be between 1 and 500 characters.
Default: "Sorry, I am unable to answer your question because of our usage policy."
-
getContentFilters
(experimental) The content filters to apply to the guardrail.Default: []
-
getContentFiltersTierConfig
(experimental) The tier configuration to apply to the guardrail.Default: filters.TierConfig.CLASSIC
-
getContextualGroundingFilters
@Stability(Experimental) @Nullable default List<ContextualGroundingFilter> getContextualGroundingFilters()(experimental) The contextual grounding filters to apply to the guardrail.Default: []
-
getCrossRegionConfig
@Stability(Experimental) @Nullable default GuardrailCrossRegionConfigProperty getCrossRegionConfig()(experimental) The cross-region configuration for the guardrail.This is optional and when provided, it should be of type GuardrailCrossRegionConfigProperty.
Default: - No cross-region configuration
-
getDeniedTopics
(experimental) A list of policies related to topics that the guardrail should deny.Default: []
-
getDescription
(experimental) The description of the guardrail.Default: - No description
-
getKmsKey
(experimental) A custom KMS key to use for encrypting data.Default: - Data is encrypted by default with a key that AWS owns and manages for you
-
getManagedWordListFilters
(experimental) The managed word filters to apply to the guardrail.Default: []
-
getPiiFilters
(experimental) The PII filters to apply to the guardrail.Default: []
-
getRegexFilters
(experimental) The regular expression (regex) filters to apply to the guardrail.Default: []
-
getTopicsTierConfig
(experimental) The tier configuration to apply to the guardrail.Default: filters.TierConfig.CLASSIC
-
getWordFilters
(experimental) The word filters to apply to the guardrail.Default: []
-
builder
- Returns:
- a
GuardrailProps.Builder
ofGuardrailProps
-