Defending Against Prompt Injection
03 June 2026
Prompt injection is the SQL injection of the AI era, except the parser is a language model that was specifically built to do whatever the text tells it to. There's no single fix. What works is defence in depth - structured prompts, input filtering, an LLM judge, monitoring, and human review - each covering the gaps the others leave. Here's how I'd build it, in Python.