Exam AI-103 Topic 1 Question 132 Discussion
Actual exam question for Microsoft's AI-103 exam
Question #: 132
Topic #: 1
Question #: 132
Topic #: 1
You have a configurable guardrail in a Microsoft Foundry project.
You have a Python application. A text blocklist named Conf identialTerns already contains terms that must be detected in user messages. The application stores each incoming user message in a variable named inpot_text.
You plan to moderate input_text before the text is sent to a language model.
You need to analyze input_text by using the existing blocklist.

You have a Python application. A text blocklist named Conf identialTerns already contains terms that must be detected in user messages. The application stores each incoming user message in a variable named inpot_text.
You plan to moderate input_text before the text is sent to a language model.
You need to analyze input_text by using the existing blocklist.

Suggested Answer:

Explanation:
AnalyzeTextOptions
request = AnalyzeTextOptions(
text=input_text,
blocklist_names=[blocklist_name],
halt_on_blocklist_hit=True
)
response = client.analyze_text(request)
AnalyzeTextOptions is the request model used by the Azure AI Content Safety Python SDK to submit text for moderation. Its text property contains the user message, while blocklist_names identifies one or more existing custom blocklists that must be applied during analysis. The value must be supplied as a list, so the correct assignment is [blocklist_name]. The request is then passed to ContentSafetyClient.analyze_text(), which returns an AnalyzeTextResult containing any blocklist matches and applicable harm-category analysis.
Setting halt_on_blocklist_hit=True stops additional harm-category processing when a blocklisted term is detected. This is appropriate when a blocklist match alone is sufficient to prevent the message from reaching the language model.
AddOrUpdateTextBlocklistItemsOptions manages terms within a blocklist; it does not analyze input.
AnalyzeImageOptions is intended for image moderation, and TextBlocklist represents blocklist metadata rather than a text-analysis request.
Study Guide alignment: configure safety filters, guardrails, blocklists, risk detection, and content moderation for Azure AI applications.
by Andy at Aug 21, 2026, 05:18 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).