update_guardrail¶
Operation¶
update_guardrail
¶
update_guardrail(request: UpdateGuardrailInput | UpdateGuardrailInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateGuardrailInputDict]) -> UpdateGuardrailOutput
Updates a guardrail with the values you specify.
-
Specify a
nameand optionaldescription. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessagingandblockedOutputsMessagingfields. -
Specify topics for the guardrail to deny in the
topicPolicyConfigobject. Each GuardrailTopicConfig object in thetopicsConfiglist pertains to one topic. -
Give a
nameanddescriptionso that the guardrail can properly identify the topic. -
Specify
DENYin thetypefield. -
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the
exampleslist. -
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the
contentPolicyConfigobject. Each GuardrailContentFilterConfig object in thefiltersConfiglist pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig. -
Specify the category in the
typefield. -
Specify the strength of the filter for prompts in the
inputStrengthfield and for model responses in thestrengthfield of the GuardrailContentFilterConfig. -
(Optional) For security, include the ARN of a KMS key in the
kmsKeyIdfield.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateGuardrailInput | UpdateGuardrailInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateGuardrailInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateGuardrailOutput
|
An instance of |
update_guardrail
async
¶
update_guardrail(request: UpdateGuardrailInput | UpdateGuardrailInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateGuardrailInputDict]) -> UpdateGuardrailOutput
Updates a guardrail with the values you specify.
-
Specify a
nameand optionaldescription. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessagingandblockedOutputsMessagingfields. -
Specify topics for the guardrail to deny in the
topicPolicyConfigobject. Each GuardrailTopicConfig object in thetopicsConfiglist pertains to one topic. -
Give a
nameanddescriptionso that the guardrail can properly identify the topic. -
Specify
DENYin thetypefield. -
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the
exampleslist. -
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the
contentPolicyConfigobject. Each GuardrailContentFilterConfig object in thefiltersConfiglist pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig. -
Specify the category in the
typefield. -
Specify the strength of the filter for prompts in the
inputStrengthfield and for model responses in thestrengthfield of the GuardrailContentFilterConfig. -
(Optional) For security, include the ARN of a KMS key in the
kmsKeyIdfield.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateGuardrailInput | UpdateGuardrailInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateGuardrailInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateGuardrailOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
UpdateGuardrailInputDict
¶
Bases: TypedDict
Dictionary form of UpdateGuardrailInput.
Attributes¶
automated_reasoning_policy_config
instance-attribute
¶
automated_reasoning_policy_config: GuardrailAutomatedReasoningPolicyConfig | GuardrailAutomatedReasoningPolicyConfigDict | None
Updated configuration for Automated Reasoning policies associated with the guardrail.
blocked_input_messaging
instance-attribute
¶
The message to return when the guardrail blocks a prompt.
blocked_outputs_messaging
instance-attribute
¶
The message to return when the guardrail blocks a model response.
content_policy_config
instance-attribute
¶
content_policy_config: GuardrailContentPolicyConfig | GuardrailContentPolicyConfigDict | None
The content policy to configure for the guardrail.
contextual_grounding_policy_config
instance-attribute
¶
contextual_grounding_policy_config: GuardrailContextualGroundingPolicyConfig | GuardrailContextualGroundingPolicyConfigDict | None
The contextual grounding policy configuration used to update a guardrail.
cross_region_config
instance-attribute
¶
cross_region_config: GuardrailCrossRegionConfig | GuardrailCrossRegionConfigDict | None
The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.
For more information, see the Amazon Bedrock User Guide.
guardrail_identifier
instance-attribute
¶
The unique identifier of the guardrail. This can be an ID or the ARN.
kms_key_id
instance-attribute
¶
kms_key_id: str | None
The ARN of the KMS key with which to encrypt the guardrail.
sensitive_information_policy_config
instance-attribute
¶
sensitive_information_policy_config: GuardrailSensitiveInformationPolicyConfig | GuardrailSensitiveInformationPolicyConfigDict | None
The sensitive information policy to configure for the guardrail.
topic_policy_config
instance-attribute
¶
topic_policy_config: GuardrailTopicPolicyConfig | GuardrailTopicPolicyConfigDict | None
The topic policy to configure for the guardrail.
word_policy_config
instance-attribute
¶
word_policy_config: GuardrailWordPolicyConfig | GuardrailWordPolicyConfigDict | None
The word policy to configure for the guardrail.
UpdateGuardrailInput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateGuardrailInput structure.
Attributes¶
automated_reasoning_policy_config
class-attribute
instance-attribute
¶
automated_reasoning_policy_config: GuardrailAutomatedReasoningPolicyConfig | None = ...
Updated configuration for Automated Reasoning policies associated with the guardrail.
blocked_input_messaging
class-attribute
instance-attribute
¶
blocked_input_messaging: str | None = ...
The message to return when the guardrail blocks a prompt.
blocked_outputs_messaging
class-attribute
instance-attribute
¶
blocked_outputs_messaging: str | None = ...
The message to return when the guardrail blocks a model response.
content_policy_config
class-attribute
instance-attribute
¶
content_policy_config: GuardrailContentPolicyConfig | None = ...
The content policy to configure for the guardrail.
contextual_grounding_policy_config
class-attribute
instance-attribute
¶
contextual_grounding_policy_config: GuardrailContextualGroundingPolicyConfig | None = ...
The contextual grounding policy configuration used to update a guardrail.
cross_region_config
class-attribute
instance-attribute
¶
cross_region_config: GuardrailCrossRegionConfig | None = ...
The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.
For more information, see the Amazon Bedrock User Guide.
description
class-attribute
instance-attribute
¶
description: str | None = ...
A description of the guardrail.
guardrail_identifier
class-attribute
instance-attribute
¶
guardrail_identifier: str | None = ...
The unique identifier of the guardrail. This can be an ID or the ARN.
kms_key_id
class-attribute
instance-attribute
¶
kms_key_id: str | None = ...
The ARN of the KMS key with which to encrypt the guardrail.
sensitive_information_policy_config
class-attribute
instance-attribute
¶
sensitive_information_policy_config: GuardrailSensitiveInformationPolicyConfig | None = ...
The sensitive information policy to configure for the guardrail.
topic_policy_config
class-attribute
instance-attribute
¶
topic_policy_config: GuardrailTopicPolicyConfig | None = ...
The topic policy to configure for the guardrail.
word_policy_config
class-attribute
instance-attribute
¶
word_policy_config: GuardrailWordPolicyConfig | None = ...
The word policy to configure for the guardrail.
Output¶
UpdateGuardrailOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateGuardrailOutput structure.
Attributes¶
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.