v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14108906717.7 KB

Creates a guardrail to block topics and to implement safeguards for your generative AI applications.

You can configure the following policies in a guardrail to avoid undesirable and harmful content, filter out denied topics and words, and remove sensitive information for privacy protection.

  • Content filters - Adjust filter strengths to block input prompts or model responses containing harmful content.

  • Denied topics - Define a set of topics that are undesirable in the context of your application. These topics will be blocked if detected in user queries or model responses.

  • Word filters - Configure filters to block undesirable words, phrases, and profanity. Such words can include offensive terms, competitor names etc.

  • Sensitive information filters - Block or mask sensitive information such as personally identifiable information (PII) or custom regex in user inputs and model responses.

In addition to the above policies, you can also configure the messages to be returned to the user if a user input or model response is in violation of the policies defined in the guardrail.

For more information, see Amazon Bedrock Guardrails in the Amazon Bedrock User Guide.

post/guardrails

Request body

namestring password required

The name to give the guardrail.

descriptionstring password

A description of the guardrail.

blockedInputMessagingstring password required

The message to return when the guardrail blocks a prompt.

blockedOutputsMessagingstring password required

The message to return when the guardrail blocks a model response.

kmsKeyIdstring

The ARN of the KMS key that you use to encrypt the guardrail.

clientRequestTokenstring

A unique, case-sensitive identifier to ensure that the API request completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon S3 User Guide</i>.

Response

Success

guardrailIdstring required

The unique identifier of the guardrail that was created.

guardrailArnstring required

The ARN of the guardrail.

versionstring required

The version of the guardrail that was created. This value will always be <code>DRAFT</code>.

createdAtstring date-time required

The time at which the guardrail was created.