CfnGuardrailProps

class aws_cdk.aws_bedrock.CfnGuardrailProps(*, blocked_input_messaging, blocked_outputs_messaging, name, content_policy_config=None, contextual_grounding_policy_config=None, cross_region_config=None, description=None, kms_key_arn=None, sensitive_information_policy_config=None, tags=None, topic_policy_config=None, word_policy_config=None)

Bases: object

Properties for defining a CfnGuardrail.

Parameters:
  • blocked_input_messaging (str) – The message to return when the guardrail blocks a prompt.

  • blocked_outputs_messaging (str) – The message to return when the guardrail blocks a model response.

  • name (str) – The name of the guardrail.

  • content_policy_config (Union[IResolvable, ContentPolicyConfigProperty, Dict[str, Any], None]) – The content filter policies to configure for the guardrail.

  • contextual_grounding_policy_config (Union[IResolvable, ContextualGroundingPolicyConfigProperty, Dict[str, Any], None]) – Contextual grounding policy config for a guardrail.

  • cross_region_config (Union[IResolvable, GuardrailCrossRegionConfigProperty, Dict[str, Any], None]) – The system-defined guardrail profile that you’re using with your guardrail. Guardrail profiles define the destination AWS Regions where guardrail inference requests can be automatically routed. Using guardrail profiles helps maintain guardrail performance and reliability when demand increases. For more information, see the Amazon Bedrock User Guide .

  • description (Optional[str]) – A description of the guardrail.

  • kms_key_arn (Optional[str]) – The ARN of the AWS KMS key that you use to encrypt the guardrail.

  • sensitive_information_policy_config (Union[IResolvable, SensitiveInformationPolicyConfigProperty, Dict[str, Any], None]) – The sensitive information policy to configure for the guardrail.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – The tags that you want to attach to the guardrail.

  • topic_policy_config (Union[IResolvable, TopicPolicyConfigProperty, Dict[str, Any], None]) – The topic policies to configure for the guardrail.

  • word_policy_config (Union[IResolvable, WordPolicyConfigProperty, Dict[str, Any], None]) – The word policy you configure for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

cfn_guardrail_props = bedrock.CfnGuardrailProps(
    blocked_input_messaging="blockedInputMessaging",
    blocked_outputs_messaging="blockedOutputsMessaging",
    name="name",

    # the properties below are optional
    content_policy_config=bedrock.CfnGuardrail.ContentPolicyConfigProperty(
        filters_config=[bedrock.CfnGuardrail.ContentFilterConfigProperty(
            input_strength="inputStrength",
            output_strength="outputStrength",
            type="type",

            # the properties below are optional
            input_action="inputAction",
            input_enabled=False,
            input_modalities=["inputModalities"],
            output_action="outputAction",
            output_enabled=False,
            output_modalities=["outputModalities"]
        )],

        # the properties below are optional
        content_filters_tier_config=bedrock.CfnGuardrail.ContentFiltersTierConfigProperty(
            tier_name="tierName"
        )
    ),
    contextual_grounding_policy_config=bedrock.CfnGuardrail.ContextualGroundingPolicyConfigProperty(
        filters_config=[bedrock.CfnGuardrail.ContextualGroundingFilterConfigProperty(
            threshold=123,
            type="type",

            # the properties below are optional
            action="action",
            enabled=False
        )]
    ),
    cross_region_config=bedrock.CfnGuardrail.GuardrailCrossRegionConfigProperty(
        guardrail_profile_arn="guardrailProfileArn"
    ),
    description="description",
    kms_key_arn="kmsKeyArn",
    sensitive_information_policy_config=bedrock.CfnGuardrail.SensitiveInformationPolicyConfigProperty(
        pii_entities_config=[bedrock.CfnGuardrail.PiiEntityConfigProperty(
            action="action",
            type="type",

            # the properties below are optional
            input_action="inputAction",
            input_enabled=False,
            output_action="outputAction",
            output_enabled=False
        )],
        regexes_config=[bedrock.CfnGuardrail.RegexConfigProperty(
            action="action",
            name="name",
            pattern="pattern",

            # the properties below are optional
            description="description",
            input_action="inputAction",
            input_enabled=False,
            output_action="outputAction",
            output_enabled=False
        )]
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    topic_policy_config=bedrock.CfnGuardrail.TopicPolicyConfigProperty(
        topics_config=[bedrock.CfnGuardrail.TopicConfigProperty(
            definition="definition",
            name="name",
            type="type",

            # the properties below are optional
            examples=["examples"],
            input_action="inputAction",
            input_enabled=False,
            output_action="outputAction",
            output_enabled=False
        )],

        # the properties below are optional
        topics_tier_config=bedrock.CfnGuardrail.TopicsTierConfigProperty(
            tier_name="tierName"
        )
    ),
    word_policy_config=bedrock.CfnGuardrail.WordPolicyConfigProperty(
        managed_word_lists_config=[bedrock.CfnGuardrail.ManagedWordsConfigProperty(
            type="type",

            # the properties below are optional
            input_action="inputAction",
            input_enabled=False,
            output_action="outputAction",
            output_enabled=False
        )],
        words_config=[bedrock.CfnGuardrail.WordConfigProperty(
            text="text",

            # the properties below are optional
            input_action="inputAction",
            input_enabled=False,
            output_action="outputAction",
            output_enabled=False
        )]
    )
)

Attributes

blocked_input_messaging

The message to return when the guardrail blocks a prompt.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-blockedinputmessaging

blocked_outputs_messaging

The message to return when the guardrail blocks a model response.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-blockedoutputsmessaging

content_policy_config

The content filter policies to configure for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-contentpolicyconfig

contextual_grounding_policy_config

Contextual grounding policy config for a guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-contextualgroundingpolicyconfig

cross_region_config

The system-defined guardrail profile that you’re using with your guardrail.

Guardrail profiles define the destination AWS Regions where guardrail inference requests can be automatically routed. Using guardrail profiles helps maintain guardrail performance and reliability when demand increases.

For more information, see the Amazon Bedrock User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-crossregionconfig

description

A description of the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-description

kms_key_arn

The ARN of the AWS KMS key that you use to encrypt the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-kmskeyarn

name

The name of the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-name

sensitive_information_policy_config

The sensitive information policy to configure for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-sensitiveinformationpolicyconfig

tags

The tags that you want to attach to the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-tags

topic_policy_config

The topic policies to configure for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-topicpolicyconfig

word_policy_config

The word policy you configure for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-guardrail.html#cfn-bedrock-guardrail-wordpolicyconfig