AI0-001 AI Security Practice Question
A financial services firm has deployed an AI-powered document summarization service that processes internal memos. To reduce the risk of prompt injection attacks that could manipulate the model's output, the security team wants to implement a defense that inspects and filters the input text before it reaches the model. Which of the following is the MOST appropriate technique to achieve this?
⚠ Common exam trap
Many exam-takers confuse privacy-preserving techniques like differential privacy with input validation defenses, which operate at different stages of the AI lifecycle.
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
✓
Implement input sanitization by removing or escaping special characters and known prompt injection patterns.
Prompt injection attacks rely on malicious text entering the model's context. Input sanitization removes or escapes dangerous characters and known injection patterns before the model processes the input, directly mitigating the risk. Differential privacy, adversarial training, and output encoding address different concerns and do not filter input at inference time, so they fail to meet the scenario's specific requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Implement input sanitization by removing or escaping special characters and known prompt injection patterns.
Why this is correct
Input sanitization directly addresses the scenario by stripping or neutralizing malicious characters and known injection strings before they reach the model. This reduces the attack surface for prompt injection, as the model receives only cleaned input. It is a proactive, lightweight defense that can be integrated into the preprocessing pipeline without altering the model itself.
- ✗
Apply differential privacy during model training to limit the influence of any single input.
Why it's wrong here
Differential privacy is designed to protect individual data records from being memorized or inferred, not to prevent prompt injection at inference time. It adds noise during training, which does not filter malicious input during runtime. Therefore, it does not address the scenario's need to inspect and filter incoming text before it reaches the model.
- ✗
Use adversarial training by generating adversarial examples and retraining the model to be robust.
Why it's wrong here
Adversarial training improves model robustness against small perturbations in input features, but it is not specifically designed to detect or block prompt injection strings. It requires retraining and may not generalize to novel injection patterns. In this scenario, the goal is to filter input at inference time, not to make the model itself more robust through retraining.
- ✗
Enforce strict output encoding to prevent cross-site scripting in the summarization results.
Why it's wrong here
Output encoding protects against cross-site scripting when displaying model output in a web interface, but it does not prevent prompt injection from manipulating the model's behavior. The attack occurs at the input stage, so filtering the output is too late. This technique addresses a different vulnerability and does not satisfy the requirement to inspect input text.
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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
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.