Prompt Injection: Why Do Attacks Succeed?
Prompt Injection is one of the most serious security threats facing LLM-based applications. It shares the same root cause as SQL injection: data and instructions share the same channel.
User input is mixed into SQL commands
User input is mixed into system instructions
Root Cause: Lack of Parameterization
The ultimate solution to SQL injection is parameterized queries: data and instructions are completely separated.
But LLM message lists lack this mechanism: text from system, user, and assistant roles is all concatenated into one string and fed to the model. The model cannot distinguish between "this is an instruction" and "this is user data."
This is the fundamental reason Prompt Injection exists.
Here's what an actual Message List looks like ↓
5 Major Attack Types (detailed examples on the next slide)
Privilege Escalation Injection
Identity spoofing, authorization forgery, incremental privilege escalation
Role-Play Escape
DAN jailbreak, grandmother exploit, emotional manipulation
Few-Shot Malicious Injection
Bias planting, output format hijacking
Structural Symbol Injection
JSON hijacking, HTML concealment, delimiter spoofing
Metaphor and Disguise
Classical literature wrapping, coding tutorial disguise, reverse psychology