AI0-001 AI Concepts and Techniques Practice Question
A company is deploying an LLM-powered application that answers questions based on internal documents. They want to minimize prompt injection attacks where users trick the model into ignoring instructions. Which THREE measures should they implement? (Select THREE)
⚠ Common exam trap
The AI0-001 exam often tests the misconception that reducing model temperature or randomness can mitigate security threats, when in fact temperature only affects output creativity, not instruction adherence or input safety.
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 a system-level prompt that clearly defines allowed behavior and boundaries
Option A is correct because a system-level prompt that clearly defines allowed behavior and boundaries establishes the model's operating rules and helps it distinguish trusted instructions from untrusted user content, which is a core defense against prompt injection. Option D is correct because a separate classifier trained to detect and block injection attempts adds an independent detection layer that can catch malicious prompts before they reach the LLM, reducing the chance that a user overrides system instructions. Option E is correct because sanitizing user inputs to remove special tokens or known injection patterns prevents attackers from injecting delimiters, role markers, or instruction-like text that could confuse the model's instruction hierarchy. Option B is not correct because setting temperature to 0.0 only makes output more deterministic and does not prevent prompt injection. Option C is not correct because allowing the model to execute arbitrary code from user prompts dramatically increases risk and is the opposite of a security control.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a system-level prompt that clearly defines allowed behavior and boundaries
Why this is correct
A system-level prompt establishes persistent instructions that take precedence over user turns, defining permitted behaviour and boundaries. This constrains the model's response space so user input is less able to override the application's original directives.
- ✗
Set temperature to 0.0 for all queries
Why it's wrong here
Temperature controls sampling randomness, not instruction hierarchy; a deterministic output still obeys injected text embedded in retrieved documents. It is tempting because low temperature reduces creative drift in factual answering tasks, but it provides no separation between system instructions and untrusted user content.
- ✗
Allow the model to execute any code from user prompts for flexibility
Why it's wrong here
Arbitrary code execution from prompts hands attackers the execution environment, escalating injection into remote code execution. It is tempting where dynamic tool use or data transformation is required, but that demands sandboxed, allow-listed functions invoked through validated schemas, not unrestricted interpreter access.
- ✓
Implement a separate classifier to detect and block injection attempts
Why this is correct
A dedicated classifier inspects incoming prompts and flags or blocks known injection patterns before they reach the LLM, adding a detection layer independent of the model's own instruction-following, which satisfies the requirement to minimise prompt injection.
- ✓
Sanitize user inputs to remove special tokens or injection patterns
Why this is correct
Sanitising inputs strips special tokens and known injection patterns that could override system instructions, preventing user text from being interpreted as commands. This directly reduces the attack surface for prompt injection in the document-questioning application.
About these practice questions
One of 962 original AI0-001 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 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.