Why Prompt Injection Defense Can't Just Be a Keyword Filter
Published 2026-09-14
What prompt injection actually is
Prompt injection is when text an AI system processes — a user's message, a document it reads, a web page it fetches — contains instructions crafted to override the system's intended behavior, tricking the model into doing something its designer didn't intend.
Why a keyword scanner only catches the obvious cases
A pattern-matching scanner that looks for phrases like "ignore previous instructions" catches attackers who typed exactly that phrase — and essentially nothing else. The same underlying intent can be rephrased endlessly ("disregard the above," "forget your rules," a foreign-language equivalent, a request wrapped in a fictional scenario, text hidden in an image via steganography, or content encoded to slip past a naive filter), and a keyword list has no way to generalize to phrasing it hasn't seen before.
What real defense actually looks like
Robust protection against prompt injection combines several layers: treating any untrusted content (user input, fetched documents, tool results) as data rather than instructions in how the system is architected; giving the model the least privilege necessary for its task, so even a successful injection can't do much damage; requiring human confirmation before consequential actions; and using more sophisticated model-based classifiers as one signal among several, rather than relying on any single filter.
Try it yourself — with the right expectations
Our Prompt Injection Scanner checks text against a list of common, known injection phrasings as a quick first-pass sanity check — useful as one small signal, not as a security guarantee on its own.