Prompt injection defense
Also known as: injection defense · prompt injection mitigation
Prompt injection defense is the set of techniques for keeping untrusted text (web pages, emails, user input) from hijacking your app’s instructions.
- Treat all external text as untrusted; never as commands.
- Least-privilege: limit what tools/data the model can reach.
- Output filtering and confirmation for sensitive actions.
The honest truth: there is no perfect prompt-injection shield. Defense in depth — isolation, least privilege, and human confirmation for high-stakes actions — is the real strategy.