AI0-001 AI Security Practice Question
An AI security engineer is hardening an LLM application against prompt injection. Which TWO controls are most effective? (Select two.)
⚠ Common exam trap
CompTIA often tests the misconception that fine-tuning on safe responses (Option A) is a security control, when in fact it only improves output safety, not input robustness, and that increasing temperature (Option D) has no security benefit and can degrade reliability.
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
✓
Training the model with adversarial examples of prompt injection
Option B is correct because training the model with adversarial examples of prompt injection (adversarial training) exposes it to malicious inputs during fine-tuning, helping it learn to recognize and resist injection attempts rather than comply with them. Option C is correct because input sanitization that strips special characters and known injection patterns (e.g., delimiter tokens, instruction-override phrases) removes or neutralizes the attack surface before the prompt reaches the model, providing a deterministic defense layer. Option A is not the best choice because fine-tuning on safe responses teaches desired output style but does not specifically teach the model to detect or refuse injection attempts, so it offers weak protection against adversarial inputs. Option D is incorrect because increasing temperature makes outputs more random and less predictable, which does not improve security and can even worsen reliability. Option E is incorrect because using a smaller model for faster inference addresses latency and cost, not prompt-injection resistance, and smaller models are often more vulnerable.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Fine-tuning the model on a dataset of safe responses
Why it's wrong here
Fine-tuning adjusts model weights and behaviour; it cannot enforce instruction/data separation at runtime, so injected content still reaches the model. It is tempting because it improves response quality, but that is not an injection defence.
- ✓
Training the model with adversarial examples of prompt injection
Why this is correct
Adversarial training exposes the model to labelled injection examples during fine-tuning, teaching it to recognise and resist instruction-override patterns. This hardens the model itself against the attack class, satisfying the hardening requirement rather than relying solely on perimeter filtering.
- ✓
Input sanitization to strip special characters and known injection patterns
Why this is correct
Sanitising input strips special characters and known injection patterns before they reach the model, blocking delivery of malicious instructions at the application boundary. This directly reduces the attack surface for prompt injection, complementing model-level defences with deterministic pre-processing.
- ✗
Increasing the model's temperature setting
Why it's wrong here
Temperature controls sampling randomness, not instruction hierarchy or input provenance, so raising it does not block injected instructions and may increase erratic output. It is tempting as a creativity tuning knob, but that is its actual purpose.
- ✗
Using a smaller model for faster inference
Why it's wrong here
A smaller model still processes injected instructions as ordinary tokens, so it neither isolates untrusted content nor constrains tool calls; inference speed is unrelated to the attack surface. It is tempting because smaller models genuinely reduce latency and cost in high-throughput deployments, which is a valid optimisation goal — but not a prompt-injection control.
About these practice questions
This AI0-001 question is part of Courseiva's 962-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 AI0-001 practice question is part of Courseiva's free CompTIA 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 AI0-001 exam.