Courseiva
Implement generative AI solutionseasyMultiple SelectObjective-mapped

AI-102 Implement generative AI solutions Practice Question

You are using Azure OpenAI Service to generate code snippets. The output must be safe and free of security vulnerabilities. Which TWO practices should you follow? (Select TWO.)

⚠ Common exam trap

Candidates often assume the model's built-in safety features are sufficient (Option B) or that increasing temperature (Option A) improves safety by adding randomness, when in fact Azure AI Content Safety is the explicit, exam-tested tool for output filtering in generative AI solutions.

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

Use Azure AI Content Safety to filter outputs

Azure AI Content Safety is a dedicated service that provides an additional layer of filtering for harmful or inappropriate content, including security vulnerabilities, beyond what the model itself offers. It allows you to define custom severity thresholds and blocklists, ensuring that generated code snippets are safe before they reach the user. This is a recommended practice for production deployments to mitigate risks like injection attacks or exposure of sensitive patterns.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Increase the temperature parameter to encourage diversity

    Why it's wrong here

    Higher temperature may increase errors and security risks.

  • Rely on the model's built-in safety features

    Why it's wrong here

    Built-in safety is not sufficient; additional measures are needed.

  • Use Azure AI Content Safety to filter outputs

    Why this is correct

    Content safety can detect and block harmful code.

  • Fine-tune the model with a dataset of secure code examples

    Why it's wrong here

    Fine-tuning is costly and may not guarantee security for all prompts.

  • Include a system message instructing the model to follow secure coding practices

    Why this is correct

    Guides the model to generate secure code.

About these practice questions

Courseiva writes every AI-102 question from scratch — 945 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.