update_guardrail¶
Operation¶
update_guardrail
async
¶
update_guardrail(input: UpdateGuardrailInput, plugins: list[Plugin] | None = None) -> 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 |
|---|---|---|---|
input
|
UpdateGuardrailInput
|
An instance of |
required |
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
|
Returns:
| Type | Description |
|---|---|
UpdateGuardrailOutput
|
An instance of |
Input¶
UpdateGuardrailInput
dataclass
¶
Dataclass for UpdateGuardrailInput structure.
Attributes¶
automated_reasoning_policy_config
class-attribute
instance-attribute
¶
automated_reasoning_policy_config: GuardrailAutomatedReasoningPolicyConfig | None = None
Updated configuration for Automated Reasoning policies associated with the guardrail.
blocked_input_messaging
class-attribute
instance-attribute
¶
blocked_input_messaging: str | None = field(repr=False, default=None)
The message to return when the guardrail blocks a prompt.
blocked_outputs_messaging
class-attribute
instance-attribute
¶
blocked_outputs_messaging: str | None = field(repr=False, default=None)
The message to return when the guardrail blocks a model response.
content_policy_config
class-attribute
instance-attribute
¶
content_policy_config: GuardrailContentPolicyConfig | None = None
The content policy to configure for the guardrail.
contextual_grounding_policy_config
class-attribute
instance-attribute
¶
contextual_grounding_policy_config: GuardrailContextualGroundingPolicyConfig | None = None
The contextual grounding policy configuration used to update a guardrail.
cross_region_config
class-attribute
instance-attribute
¶
cross_region_config: GuardrailCrossRegionConfig | None = 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 = field(repr=False, default=None)
A description of the guardrail.
guardrail_identifier
class-attribute
instance-attribute
¶
guardrail_identifier: str | None = 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 = None
The ARN of the KMS key with which to encrypt the guardrail.
name
class-attribute
instance-attribute
¶
name: str | None = field(repr=False, default=None)
A name for the guardrail.
sensitive_information_policy_config
class-attribute
instance-attribute
¶
sensitive_information_policy_config: GuardrailSensitiveInformationPolicyConfig | None = None
The sensitive information policy to configure for the guardrail.
topic_policy_config
class-attribute
instance-attribute
¶
topic_policy_config: GuardrailTopicPolicyConfig | None = None
The topic policy to configure for the guardrail.
word_policy_config
class-attribute
instance-attribute
¶
word_policy_config: GuardrailWordPolicyConfig | None = None
The word policy to configure for the guardrail.