CfnGuardrailProps

class aws_cdk.aws_bedrock.CfnGuardrailProps(*, blocked_input_messaging, blocked_outputs_messaging, name, content_policy_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]) – Content policy config for a guardrail.

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

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

  • sensitive_information_policy_config (Union[IResolvable, SensitiveInformationPolicyConfigProperty, Dict[str, Any], None]) – Sensitive information policy config for a guardrail.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Metadata that you can assign to a guardrail as key-value pairs. For more information, see the following resources:. - Tag naming limits and requirements - Tagging best practices

  • topic_policy_config (Union[IResolvable, TopicPolicyConfigProperty, Dict[str, Any], None]) – Topic policy config for a guardrail.

  • word_policy_config (Union[IResolvable, WordPolicyConfigProperty, Dict[str, Any], None]) – Word policy config for a 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"
        )]
    ),
    description="description",
    kms_key_arn="kmsKeyArn",
    sensitive_information_policy_config=bedrock.CfnGuardrail.SensitiveInformationPolicyConfigProperty(
        pii_entities_config=[bedrock.CfnGuardrail.PiiEntityConfigProperty(
            action="action",
            type="type"
        )],
        regexes_config=[bedrock.CfnGuardrail.RegexConfigProperty(
            action="action",
            name="name",
            pattern="pattern",

            # the properties below are optional
            description="description"
        )]
    ),
    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"]
        )]
    ),
    word_policy_config=bedrock.CfnGuardrail.WordPolicyConfigProperty(
        managed_word_lists_config=[bedrock.CfnGuardrail.ManagedWordsConfigProperty(
            type="type"
        )],
        words_config=[bedrock.CfnGuardrail.WordConfigProperty(
            text="text"
        )]
    )
)

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

Content policy config for a guardrail.

See:

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

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 used 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

Sensitive information policy config for a guardrail.

See:

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

tags

.

See:

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

Type:

Metadata that you can assign to a guardrail as key-value pairs. For more information, see the following resources

topic_policy_config

Topic policy config for a guardrail.

See:

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

word_policy_config

Word policy config for a guardrail.

See:

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