Skip to content

BedrockClient.update_guardrail

rboto-bedrock==0.4.0 · Service index · Types

Model summary (excerpt): Updates a guardrail with the values you specify. Specify a name and optional description . Specify messages for when the guardrail successfully blocks a prompt or a model response in the blockedInputMessaging and blockedOutputsMessaging fields. Specify topics for the guardrail to deny in the topicPolicyConfig object. Each GuardrailTopicConfig object in the topicsConfig list pertains to one...

Install and imports

python -m pip install "rboto[bedrock]==0.4.0"
from rboto import BedrockClient
from rboto_bedrock.types import (
    GuardrailAutomatedReasoningPolicyConfig,
    GuardrailContentPolicyConfig,
    GuardrailContextualGroundingPolicyConfig,
    GuardrailCrossRegionConfig,
    GuardrailSensitiveInformationPolicyConfig,
    GuardrailTopicPolicyConfig,
    GuardrailWordPolicyConfig,
    UpdateGuardrailOutput,
)

Signature

async def update_guardrail(
    *,
    guardrail_identifier: str,
    name: str,
    blocked_input_messaging: str,
    blocked_outputs_messaging: str,
    description: str | None = None,
    topic_policy_config: GuardrailTopicPolicyConfig | None = None,
    content_policy_config: GuardrailContentPolicyConfig | None = None,
    word_policy_config: GuardrailWordPolicyConfig | None = None,
    sensitive_information_policy_config: GuardrailSensitiveInformationPolicyConfig | None = None,
    contextual_grounding_policy_config: GuardrailContextualGroundingPolicyConfig | None = None,
    automated_reasoning_policy_config: GuardrailAutomatedReasoningPolicyConfig | None = None,
    cross_region_config: GuardrailCrossRegionConfig | None = None,
    kms_key_id: str | None = None,
) -> UpdateGuardrailOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
guardrail_identifier Yes The unique identifier of the guardrail. This can be an ID or the ARN.
name Yes A name for the guardrail.
blocked_input_messaging Yes The message to return when the guardrail blocks a prompt.
blocked_outputs_messaging Yes The message to return when the guardrail blocks a model response.
description No A description of the guardrail.
topic_policy_config No The topic policy to configure for the guardrail.
content_policy_config No The content policy to configure for the guardrail.
word_policy_config No The word policy to configure for the guardrail.
sensitive_information_policy_config No The sensitive information policy to configure for the guardrail.
contextual_grounding_policy_config No The contextual grounding policy configuration used to update a guardrail.
automated_reasoning_policy_config No Updated configuration for Automated Reasoning policies associated with the guardrail.
cross_region_config No 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 .
kms_key_id No The ARN of the KMS key with which to encrypt the guardrail.

Output

UpdateGuardrailOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
guardrail_id str Always present —
guardrail_arn str Always present —
version str Always present —
updated_at str Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

GuardrailAutomatedReasoningPolicyConfig, GuardrailContentPolicyConfig, GuardrailContextualGroundingPolicyConfig, GuardrailCrossRegionConfig, GuardrailSensitiveInformationPolicyConfig, GuardrailTopicPolicyConfig, GuardrailWordPolicyConfig, UpdateGuardrailOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_bedrock.exceptions:

AccessDeniedError, ConflictError, InternalServerError, ResourceNotFoundError, ServiceQuotaExceededError, ThrottlingError, ValidationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model