mediumMultiple ChoiceObjective-mapped
AIF-C01 Practice Question: A team is deploying a sentiment analysis…
A team is deploying a sentiment analysis application using Amazon Bedrock. They need to ensure the model returns only 'positive', 'negative', or 'neutral'. Which prompt engineering technique is BEST suited for this requirement?
⚠ Common exam trap
A common misconception is that Bedrock Guardrails can be used to enforce output format constraints like restricting responses to specific words. However, Guardrails are designed for content safety and policy-based filtering, not for controlling the structure or vocabulary of model responses. The correct approach is to use clear instructions in the prompt.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Include an instruction like 'Classify the sentiment as one of: positive, negative, neutral. Output only that word.'
It directly constrains the model's output format using a clear, explicit instruction. This is the most reliable prompt engineering technique for enforcing a strict set of allowed labels, as it leverages the model's instruction-following capability without relying on reasoning chains or external filtering.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a chain-of-thought prompt to reason about sentiment
Why it's wrong here
Chain-of-thought improves reasoning, not output format control.
- ✗
Provide few-shot examples of the three labels in the prompt
Why it's wrong here
Few-shot examples encourage but do not enforce the output format strictly.
- ✗
Use a Bedrock Guardrail to block any response not matching the three labels
Why it's wrong here
Guardrails can filter after generation but are not a prompt engineering technique.
- ✓
Include an instruction like 'Classify the sentiment as one of: positive, negative, neutral. Output only that word.'
Why this is correct
Clear instruction with constrained output is the most direct prompt engineering technique.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AIF-C01 question from scratch — 619 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.