Index Ai Academy
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.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write