Skip to content

get_guardrail

Operation

get_guardrail

get_guardrail(request: GetGuardrailInput | GetGuardrailInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetGuardrailInputDict]) -> GetGuardrailOutput

Gets details about a guardrail. If you don't specify a version, the response returns details for the DRAFT version.

Parameters:

Name Type Description Default
request GetGuardrailInput | GetGuardrailInputDict | 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[GetGuardrailInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetGuardrailOutput

An instance of GetGuardrailOutput.

get_guardrail async

get_guardrail(request: GetGuardrailInput | GetGuardrailInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetGuardrailInputDict]) -> GetGuardrailOutput

Gets details about a guardrail. If you don't specify a version, the response returns details for the DRAFT version.

Parameters:

Name Type Description Default
request GetGuardrailInput | GetGuardrailInputDict | 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[GetGuardrailInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetGuardrailOutput

An instance of GetGuardrailOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

GetGuardrailInputDict

Bases: TypedDict

Dictionary form of GetGuardrailInput.

Attributes

guardrail_identifier instance-attribute
guardrail_identifier: Required[str]

The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.

guardrail_version instance-attribute
guardrail_version: str | None

The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the DRAFT version.

GetGuardrailInput dataclass

Bases: _SerdeShape

Dataclass for GetGuardrailInput structure.

Attributes

guardrail_identifier class-attribute instance-attribute
guardrail_identifier: str | None = ...

The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.

guardrail_version class-attribute instance-attribute
guardrail_version: str | None = ...

The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the DRAFT version.

Output

GetGuardrailOutput dataclass

Bases: _SerdeShape

Dataclass for GetGuardrailOutput structure.

Attributes

automated_reasoning_policy class-attribute instance-attribute
automated_reasoning_policy: GuardrailAutomatedReasoningPolicy | None = ...

The current Automated Reasoning policy configuration for the guardrail, if any is configured.

blocked_input_messaging instance-attribute
blocked_input_messaging: str

The message that the guardrail returns when it blocks a prompt.

blocked_outputs_messaging instance-attribute
blocked_outputs_messaging: str

The message that the guardrail returns when it blocks a model response.

content_policy class-attribute instance-attribute
content_policy: GuardrailContentPolicy | None = ...

The content policy that was configured for the guardrail.

contextual_grounding_policy class-attribute instance-attribute
contextual_grounding_policy: GuardrailContextualGroundingPolicy | None = ...

The contextual grounding policy used in the guardrail.

created_at instance-attribute
created_at: datetime

The date and time at which the guardrail was created.

cross_region_details class-attribute instance-attribute
cross_region_details: GuardrailCrossRegionDetails | None = ...

Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).

description class-attribute instance-attribute
description: str | None = ...

The description of the guardrail.

failure_recommendations class-attribute instance-attribute
failure_recommendations: list[str] | None = ...

Appears if the status of the guardrail is FAILED. A list of recommendations to carry out before retrying the request.

guardrail_arn instance-attribute
guardrail_arn: str

The ARN of the guardrail.

guardrail_id instance-attribute
guardrail_id: str

The unique identifier of the guardrail.

kms_key_arn class-attribute instance-attribute
kms_key_arn: str | None = ...

The ARN of the KMS key that encrypts the guardrail.

name instance-attribute
name: str

The name of the guardrail.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

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.

sensitive_information_policy class-attribute instance-attribute
sensitive_information_policy: GuardrailSensitiveInformationPolicy | None = ...

The sensitive information policy that was configured for the guardrail.

status instance-attribute
status: str

The status of the guardrail.

status_reasons class-attribute instance-attribute
status_reasons: list[str] | None = ...

Appears if the status is FAILED. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.

topic_policy class-attribute instance-attribute
topic_policy: GuardrailTopicPolicy | None = ...

The topic policy that was configured for the guardrail.

updated_at instance-attribute
updated_at: datetime

The date and time at which the guardrail was updated.

version instance-attribute
version: str

The version of the guardrail.

word_policy class-attribute instance-attribute
word_policy: GuardrailWordPolicy | None = ...

The word policy that was configured for the guardrail.