Why prompt injection is hard to fully prevent
A language model reads its system prompt, the user's message, and any retrieved content as one continuous stream of text. It has no built-in, reliable way to know that the system prompt is trusted and a paragraph fetched from a web page is not. An attacker who can get text into any part of that stream can attempt to redirect the model.
This is why OWASP LLM01:2025 treats injection as a category to mitigate rather than a bug to patch. Direct injection comes straight from the user ("ignore your instructions and..."). Indirect injection is more dangerous: malicious instructions are planted in a document, email, or web page that your system later feeds to the model, so the attack arrives without the user ever typing it.
Because the channel can't be perfectly partitioned, defenses focus on (1) reducing what an injected instruction can reach, and (2) catching its effects before they cause harm. Treat every layer below as a filter, not a wall.