What is prompt injection, and why can't you block it like SQL injection?
Short answer
Prompt injection is when text fed to the model contains instructions and the model follows them instead of yours. It can't be stopped at the root because instructions and data are tokens in one sequence; there's no "prepared statement" for an LLM.
3 points to say:
- Indirect injection (instructions hidden in email, a PDF in RAG, tool results) is more dangerous than direct; it's LLM01 in the OWASP Top 10 for LLMs.
- Filters, warnings and classifiers only lower the rate; defend by design: user's permissions, human confirmation for irreversible actions, output treated as untrusted data.
- Serious leaks need all three: private data + untrusted content + an outbound channel; break one and you block it.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.