Use a guardrail with inference operations to evaluate user input - Amazon Bedrock

Use a guardrail with inference operations to evaluate user input

You can use guardrails with the base inference operations, InvokeModel and InvokeModelWithResponseStream (streaming). This section covers how you selectively evaluate user input and how you can configure streaming response behavior. Note that for conversational applications, you can achieve the same results with the Converse API.

For example code that calls the base inference operations, see Submit a single prompt with InvokeModel. For information about using a guardrail with the base inference operations, follow the steps in the API tab of Test a guardrail.