GetGuardrail - Amazon Bedrock

GetGuardrail

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

Request Syntax

GET /guardrails/guardrailIdentifier?guardrailVersion=guardrailVersion HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

guardrailIdentifier

The unique identifier of the guardrail for which to get details.

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: ^(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))$

Required: Yes

guardrailVersion

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.

Pattern: ^(([1-9][0-9]{0,7})|(DRAFT))$

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "blockedInputMessaging": "string", "blockedOutputsMessaging": "string", "contentPolicy": { "filters": [ { "inputStrength": "string", "outputStrength": "string", "type": "string" } ] }, "createdAt": "string", "description": "string", "failureRecommendations": [ "string" ], "guardrailArn": "string", "guardrailId": "string", "kmsKeyArn": "string", "name": "string", "sensitiveInformationPolicy": { "piiEntities": [ { "action": "string", "type": "string" } ], "regexes": [ { "action": "string", "description": "string", "name": "string", "pattern": "string" } ] }, "status": "string", "statusReasons": [ "string" ], "topicPolicy": { "topics": [ { "definition": "string", "examples": [ "string" ], "name": "string", "type": "string" } ] }, "updatedAt": "string", "version": "string", "wordPolicy": { "managedWordLists": [ { "type": "string" } ], "words": [ { "text": "string" } ] } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

blockedInputMessaging

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 500.

blockedOutputsMessaging

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 500.

contentPolicy

The content policy that was configured for the guardrail.

Type: GuardrailContentPolicy object

createdAt

The date and time at which the guardrail was created.

Type: Timestamp

description

The description of the guardrail.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 200.

failureRecommendations

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

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 100 items.

Length Constraints: Minimum length of 1. Maximum length of 200.

guardrailArn

The ARN of the guardrail that was created.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: ^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+$

guardrailId

The unique identifier of the guardrail.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 64.

Pattern: ^[a-z0-9]+$

kmsKeyArn

The ARN of the AWS KMS key that encrypts the guardrail.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^arn:aws(-[^:]+)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$

name

The name of the guardrail.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 50.

Pattern: ^[0-9a-zA-Z-_]+$

sensitiveInformationPolicy

The sensitive information policy that was configured for the guardrail.

Type: GuardrailSensitiveInformationPolicy object

status

The status of the guardrail.

Type: String

Valid Values: CREATING | UPDATING | VERSIONING | READY | FAILED | DELETING

statusReasons

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

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 100 items.

Length Constraints: Minimum length of 1. Maximum length of 200.

topicPolicy

The topic policy that was configured for the guardrail.

Type: GuardrailTopicPolicy object

updatedAt

The date and time at which the guardrail was updated.

Type: Timestamp

version

The version of the guardrail.

Type: String

Pattern: ^(([1-9][0-9]{0,7})|(DRAFT))$

wordPolicy

The word policy that was configured for the guardrail.

Type: GuardrailWordPolicy object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The request is denied because of missing access permissions.

HTTP Status Code: 403

InternalServerException

An internal server error occurred. Retry your request.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

HTTP Status Code: 404

ThrottlingException

The number of requests exceeds the limit. Resubmit your request later.

HTTP Status Code: 429

ValidationException

Input validation failed. Check your request parameters and retry the request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: