mediumMultiple ChoiceObjective-mapped
AIF-C01 Practice Question: A company uses Amazon Bedrock to power a code…
A company uses Amazon Bedrock to power a code generation assistant. They notice that the generated code sometimes contains security vulnerabilities. Which approach would BEST address this issue without sacrificing code quality?
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
✓
Fine-tune the model on a curated dataset of secure code and use Bedrock Guardrails to block insecure patterns
Guardrails can filter harmful content, but for code-specific vulnerabilities, a more targeted approach is to fine-tune on secure code examples or use a specialised model. However, among the options, applying guardrails for code safety is a practical step.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Switch to a smaller model to reduce the chance of generating complex vulnerable code
Why it's wrong here
Model size is not directly correlated with security vulnerabilities.
- ✗
Increase the temperature parameter to make output more deterministic
Why it's wrong here
Lowering temperature reduces randomness but does not guarantee security.
- ✓
Fine-tune the model on a curated dataset of secure code and use Bedrock Guardrails to block insecure patterns
Why this is correct
Fine-tuning on secure code teaches the model best practices, while guardrails add a safety layer.
- ✗
Use a longer prompt that instructs the model to avoid vulnerabilities
Why it's wrong here
Prompting alone is insufficient; it may be ignored and does not provide a systematic filter.
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.