SteelReed

Search

Search posts, questions…

AI & LLMQuestion 3 / 25

Junior

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.

Your instructionsOne token sequenceEmail, web, PDFwith planted instructionsModel can't separate themTools run as the user,server checks

3 points to say:

  1. 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.
  2. Filters, warnings and classifiers only lower the rate; defend by design: user's permissions, human confirmation for irreversible actions, output treated as untrusted data.
  3. 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.