Manage a guardrail
You can modify an existing guardrail to add new configuration policies or edit an existing policy. When you've reached a configuration for your guardrail that you're satisfied with, you can create a static version of the guardrail to use with your models or agents. For more information, see Deploy a guardrail.
View information about your guardrails
- Console
-
To view information about your guardrails
-
Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/
. -
Choose Guardrails from the left navigation pane. Then, select a guardrail in the Guardrails section.
-
The Guardrail overview section displays the configurations of the guardrail that apply to all versions.
-
To view more information about the working draft, select the Working draft in the Working draft section.
-
To view more information about a specific version of the guardrail, select the version from the Versions section.
To learn more about the working draft and guardrail versions, see Deploy a guardrail.
-
- API
-
To get information about a guardrail, send a GetGuardrail request and include the ID and version of the guardrail. If you don't specify a version, the response returns details for the
DRAFT
version.The following is the request format:
GET /guardrails/
guardrailIdentifier
?guardrailVersion=guardrailVersion
HTTP/1.1The following is the response format:
HTTP/1.1 200 Content-type: application/json { "blockedInputMessaging": "string", "blockedOutputsMessaging": "string", "contentPolicy": { "filters": [ { "type": "string", "inputStrength": "string", "outputStrength": "string" } ] }, "wordPolicy": { "words": [ { "text": "string" } ], "managedWordLists": [ { "type": "string" } ] }, "sensitiveInformationPolicy": { "piiEntities": [ { "type": "string", "action": "string" } ], "regexes": [ { "name": "string", "description": "string", "regex": "string", "action": "string" } ] }, "createdAt": "string", "description": "string", "failureRecommendations": [ "string" ], "guardrailArn": "string", "guardrailId": "string", "kmsKeyArn": "string", "name": "string", "status": "string", "statusReasons": [ "string" ], "topicPolicyConfig": { "topics": [ { "definition": "string", "examples": [ "string" ], "name": "string", "type": "DENY" } ] }, "updatedAt": "string", "version": "string" }
To list information about all your guardrails, send a ListGuardrails request.
The following is the request format:
GET /guardrails?guardrailIdentifier=
guardrailIdentifier
&maxResults=maxResults
&nextToken=nextToken
HTTP/1.1-
To list the
DRAFT
version of all your guardrails, don't specify theguardrailIdentifier
field. -
To list all versions of a guardrail, specify the ARN of the guardrail in the
guardrailIdentifier
field.
You can set the maximum number of results to return in a response in the
maxResults
field. If there are more results than the number you set, the response returns anextToken
that you can send in anotherListGuardrails
request to see the next batch of results.The following is the response format:
HTTP/1.1 200 Content-type: application/json { "guardrails": [ { "arn": "string", "createdAt": "string", "description": "string", "id": "string", "name": "string", "status": "string", "updatedAt": "string", "version": "string" } ], "nextToken": "string" }
-
Edit a guardrail
- Console
-
To edit a guardrail
-
Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/
. -
Choose Guardrails from the left navigation pane. Then, select a guardrail in the Guardrails section.
-
To edit the name, description, tags, or model encryption settings for the guardrail, select Edit in the Guardrail overview section.
-
To edit specific configurations for the guardrail, select Working draft in the Working draft section.
-
Select Edit for the sections containing the settings that you want to change.
-
Make the edits that you need and then select Save and exit to implement the edits.
-
- API
-
To edit a guardrail, send a UpdateGuardrail request. Include both fields that you want to update as well as fields that you want to keep the same.
The following is the request format:
PUT /guardrails/
guardrailIdentifier
HTTP/1.1 Content-type: application/json { "blockedInputMessaging": "string", "blockedOutputsMessaging": "string", "contentPolicyConfig": { "filtersConfig": [ { "inputStrength": "NONE | LOW | MEDIUM | HIGH", "outputStrength": "NONE | LOW | MEDIUM | HIGH", "type": "SEXUAL | VIOLENCE | HATE | INSULTS" } ] }, "description": "string", "kmsKeyId": "string", "name": "string", "tags": [ { "key": "string", "value": "string" } ], "topicPolicyConfig": { "topicsConfig": [ { "definition": "string", "examples": [ "string" ], "name": "string", "type": "DENY" } ] } }The following is the response format:
HTTP/1.1 202 Content-type: application/json { "guardrailArn": "string", "guardrailId": "string", "updatedAt": "string", "version": "string" }
Delete a guardrail
You can delete a guardrail when you no longer need to use it. Be sure to disassociate the guardrail from all the resources or applications that use it before you delete the guardrail in order to avoid potential errors.
- Console
-
To delete a guardrail
-
Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/
. -
Choose Guardrails from the left navigation pane. Then, select a guardrail in the Guardrails section.
-
In the Guardrails section, select a guardrail that you want to delete and then choose Delete.
-
Enter
delete
in the user input field and choose Delete to delete the guardrail.
-
- API
-
To delete a guardrail, send a DeleteGuardrail request and only specify the ARN of the guardrail in the
guardrailIdentifier
field. Don't specify theguardrailVersion
The following is the request format:
DELETE /guardrails/
guardrailIdentifier
?guardrailVersion=guardrailVersion
HTTP/1.1Warning
If you delete a guardrail, all of its versions will be deleted.
If the deletion is successful, the response returns an HTTP 200 status code.