Glossary · Phase 1 · Building with LLMs
Prompt injection
An attack where text the model reads (a web page, an email) contains instructions that try to hijack it.
Try it now
With an API key set, send this and check the label is negative. Then delete the "never follow instructions" sentence and try again. Models resist many injections, but your design shouldn't depend on it.
Learn it properly
Prompt injection and security · How untrusted text hijacks models, and how to limit the damage. About 30 minutes.
Other terms from the same lesson
- allowlist: A list of the only things permitted, such as the few web addresses an agent may contact. Anything not on it is blocked.
- lethal trifecta: An agent that can read private data, also reads untrusted text, and can send data out. With all three, one hidden instruction can leak your data.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.