A health-tech startup runs its own chat model on Amazon EC2 instances, not on Amazon Bedrock, because the model was trained in-house. The application must refuse medical-advice topics, and personal identifiers must not reach the model or the user's screen.
The team already has an Amazon Bedrock guardrail that defines these rules. It wants to reuse that guardrail without moving the model to Amazon Bedrock.
Which design meets these requirements?
Choose one answer.
AA. Send each request to the in-house model through the Converse API with the guardrail in guardrailConfig, so Bedrock checks the call before it reaches the EC2 model.
BB. Call the ApplyGuardrail API on the user's message before it goes to the in-house model, and call it again on the model's reply before the reply is shown.
CC. Keep the rules in the system prompt of the in-house model, and check each reply in the web app against a list of banned keywords.
DD. Copy the guardrail's word list into a DynamoDB table, and have the web tier scan each message and reply for matches before it is sent.
Show the answer and explanation
Answer: B
A. Wrong: The Converse API works with Amazon Bedrock models, so it cannot send a request to a model hosted on EC2. The guardrail would never run against the in-house model.
C. Wrong: Prompt rules depend on the model following them, and a keyword list does not catch a medical-advice topic. The design does not enforce the guardrail's rules.
D. Wrong: A word list covers only the words, so it misses the denied topic and the personal-data rules. The team would also maintain a copy of the rules by hand.
Explanation
The ApplyGuardrail API evaluates text against a guardrail without calling a Bedrock model, so the same rules can screen the input and the output of a model hosted elsewhere. The Converse API only works with Bedrock models. Prompt wording and copied word lists do not enforce the topic and personal-data rules.
Want more on Guardrails and securing AI agents? The 5 full-length practice sets have 14 more Guardrails and securing AI agents questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →