AI-102 Implement an agentic solution Practice Question
Your Azure AI Agent Service agent occasionally calls a 'createOrder' tool with plausible but incorrect item codes. You must ensure that the order is created only when the item code exists in the product database, and that invalid calls are rejected before any order is written. Which approach should you take?
⚠ Common exam trap
The trap here is believing that prompt instructions or lower temperature can enforce a business rule, when only code executing at the side-effect boundary can guarantee it.
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
✓
Validate the item code inside the function tool implementation and return an error result to the agent when the code is unknown.
Validation belongs in the tool implementation, where it runs deterministically before any write occurs. The model may still propose a bad code, but the tool rejects it and returns an error the agent can act on, guaranteeing that only codes present in the product database result in orders.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Validate the item code inside the function tool implementation and return an error result to the agent when the code is unknown.
Why this is correct
Executing validation in the tool implementation puts a deterministic check between the model's proposal and the side effect. If the code is unknown, the tool refuses to create the order and returns an error the model can reason about, so no invalid order is written regardless of what the model suggested. This enforces the constraint where it cannot be bypassed.
- ✗
Add the full product database to the agent's instructions so the model can check codes itself before calling the tool.
Why it's wrong here
Embedding a product database in instructions is impractical at any real scale and still relies on the model's judgment rather than an authoritative check. It also consumes context and becomes stale immediately. Instructions cannot guarantee rejection of invalid codes, so this does not meet the requirement that no invalid order is written.
- ✗
Enable content filtering on the model deployment and add a blocklist entry for malformed item codes.
Why it's wrong here
Content filtering and blocklists target harmful or prohibited text categories, not domain-specific validation against a product database. A nonexistent item code is not a content-safety violation, so it would pass filtering. This control addresses a different risk entirely and leaves the invalid-order problem unsolved.
- ✗
Increase the model temperature to zero and add a system message telling the model to verify item codes before calling the tool.
Why it's wrong here
Lower temperature makes outputs more deterministic but does not guarantee factual correctness, and instructions are advisory rather than enforced. A model can still emit a nonexistent code with full confidence. Because the requirement is that no invalid order is ever written, prompt-level guidance alone cannot satisfy it.
Go deeper
Related to this question
About these practice questions
One of 761 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This AI-102 practice question is part of Courseiva's free Microsoft 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 AI-102 exam.