What is prompt injection? Definition, examples and defenses

The TeamSep 7, 20269 minagent-security
What is prompt injection? Definition, examples and defenses

FAQ

Frequently asked questions

What is prompt injection in one sentence?

Prompt injection is an attack in which a text contains instructions that a language model treats as a command and executes, even though they come neither from the user nor from the operator.

What is the difference between direct and indirect prompt injection?

In direct prompt injection the attacker types the instruction themselves, for example in the chat. In indirect prompt injection the instruction sits inside content the model processes: a web page, an email, a PDF or the output of a tool. The user often never sees the instruction.

Is prompt injection the same as a jailbreak?

No, but they are related. A jailbreak tries to override a model's safety rules so it produces content it should refuse. Prompt injection redirects a model inside an application so it leaks data or performs actions. Detectors like Wolf Defender catch both.

Can prompt injection be prevented completely?

No. As long as a model processes instructions and data in the same channel, a residual risk remains. That is why you combine detection at the input, privilege separation for tools, human approval for consequential actions and monitoring of the output.

How does a model like Wolf Defender detect prompt injection?

Wolf Defender is a classifier that learned from hundreds of thousands of examples how injection instructions are structured, even when obfuscated: Unicode tricks, Base64, HTML comments, line breaks. It scores a text in milliseconds on the device and returns a probability a policy can work with.