Create a guardrail component - Amazon Bedrock Studio

Amazon Bedrock Studio, renamed to Amazon Bedrock IDE, is now available in Amazon SageMaker Unified Studio. Amazon Bedrock Studio will be available until February 28, 2025. You may access existing workspaces in this previous version through February 28, 2025, but you may not create new workspaces. To access the enhanced GA version of Amazon Bedrock Studio with additional features and capabilities, you can create a new Amazon SageMaker Unified Studio domain. To learn about Amazon Bedrock Studio IDE, see the documentation.

Create a guardrail component

You can create a guardrail as a component in a Amazon Bedrock Studio project. You can then add the guardrail component to a chat app. You can also create a guardrail component while you are creating a chat app. For an example, see Add a guardrail to your chat app.

Warning

The name and description of a guardrail component are visible to all members of the Amazon Bedrock Studio workspace. We recommend that you don't store sensitive data in these two fields. Project-based access control ensures only authorized members of a project can edit the name, description, and other fields in the project.

To create a guardrail component
  1. Open your Amazon Bedrock Studio workspace.

  2. Make sure that you are in Build mode, by choosing Build at the top right of the page.

  3. In the Project dropdown list, choose the project that you want to add a guardrail to.

  4. In the Components section, choose Create component and then Guardrail. The Create guardrail pane is shown.

  5. For Guardrail name. enter a name for the guardrail.

  6. For Guardrail description enter a description for the guardrail.

  7. In Content filters do the following.

    1. Select Enable content filters to turn on content filtering.

    2. For Filter for prompts, choose the filters that you want to apply to prompts. For more information, see Content filters.

    3. If you want the filter to apply to responses that the model generates, select Apply the same filters for responses.

  8. In Blocked messsaging do the following:

    1. For Blocked messaging for prompts enter a message to display when the guardrail blocks content in the prompt.

    2. If you want to show a different message when the guardrail blocks content from a model's response, do the following:

      1. Clear Apply the same message for blocked responses.

      2. For Blocked messaging for responses, enter a message to display when the guardrail blocks content in the response from the model.

  9. Add a denied topic filter by doing the following:

    1. Choose Use advanced features.

    2. Choose Denied topics.

    3. Choose Add topic.

    4. For Name, enter a name for the filter.

    5. For Definition for topic, enter a definition for the content that you want to deny.

    6. (Optional) To help guide the guardrail, do the folllowing:

      1. Choose Sample phrases - optional.

      2. For Sample phrases, enter a phrase.

      3. Choose Add phrase.

      4. Add up to four more phrases by repeating the previous two steps.

      5. Choose Save.

    For information about denied topics, see Denied topics.

  10. Choose Create to create the guardrail.

  11. Add the guardrail component to a chat app by doing Add a guardrail component to a chat app.