Which prompting approach can help defend against prompt-injection attacks?
Choose an answer
Tap an option to check your answer.
Correct answer: Adversarial prompting.
Why this is the answer
Adversarial prompting is a technique where you intentionally craft prompts that attempt to bypass or manipulate the model's safety mechanisms, similar to how an attacker might. By doing this in a controlled environment, you can identify vulnerabilities and then develop more robust defenses against prompt injection attacks. Zero-shot, least-to-most, and chain-of-thought prompting are all techniques to improve a model's performance or reasoning abilities for legitimate tasks, not primarily to defend against prompt injection. While they might indirectly make a model more robust by improving its understanding, they are not designed as a direct defense mechanism against malicious prompts.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed