Which mitigation technique is used to defend against prompt injection?

Study for the CompTIA SecAI+ (CY0-001) Exam. Review flashcards and multiple choice questions, each with detailed explanations. Ace your certification!

Multiple Choice

Which mitigation technique is used to defend against prompt injection?

Explanation:
Prompt injection happens when user-provided content leaks into or overrides the model’s guiding instructions, causing the model to behave in unintended ways. The strongest defense is to validate and sanitize inputs and to keep the model’s guidance (the system prompt and policy) in a separate, trusted context from untrusted user content. Input validation blocks dangerous or unexpected tokens, while context separation ensures that user-supplied text cannot alter the model’s directives or bypass safeguards. Together, these measures prevent injected commands from steering the model’s behavior. Data encryption focuses on protecting data confidentiality, not preventing the model from following injected instructions. Logging helps detect incidents after they occur but doesn’t stop the injection from influencing the model in real time. Prompt re-ranking can help choose safer outputs after generation but doesn’t address the root cause of the injection by isolating or validating the incoming prompt.

Prompt injection happens when user-provided content leaks into or overrides the model’s guiding instructions, causing the model to behave in unintended ways. The strongest defense is to validate and sanitize inputs and to keep the model’s guidance (the system prompt and policy) in a separate, trusted context from untrusted user content. Input validation blocks dangerous or unexpected tokens, while context separation ensures that user-supplied text cannot alter the model’s directives or bypass safeguards. Together, these measures prevent injected commands from steering the model’s behavior.

Data encryption focuses on protecting data confidentiality, not preventing the model from following injected instructions. Logging helps detect incidents after they occur but doesn’t stop the injection from influencing the model in real time. Prompt re-ranking can help choose safer outputs after generation but doesn’t address the root cause of the injection by isolating or validating the incoming prompt.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy