What is the difference between system, developer, and user roles, and why does it matter for injection safety?
Quick-fire answer from the Awesome Generative AI Guide (MIT)
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Chat models take messages tagged by role, and the model is trained to weight them differently: the system (or developer) message carries durable instructions and policy, while user messages carry the request. Putting your rules in the system role gives them more standing than text buried in user content, which matters for both steerability and security. The critical safety point is that retrieved documents, tool outputs, and web content are data, not instructions, so they should never be placed where the model treats them as authoritative commands. Keeping trusted instructions and untrusted data in clearly separated roles is a first-line defense against prompt injection.
Full worked answer
Chat models take messages tagged by role, and the model is trained to weight them differently: the system (or developer) message carries durable instructions and policy, while user messages carry the request. Putting your rules in the system role gives them more standing than text buried in user content, which matters for both steerability and security. The critical safety point is that retrieved documents, tool outputs, and web content are data, not instructions, so they should never be placed where the model treats them as authoritative commands. Keeping trusted instructions and untrusted data in clearly separated roles is a first-line defense against prompt injection.
Learn more: Safety and Security topic
What a good answer covers
- Chat models take messages tagged by role, and the model is trained to weight them differently
- Putting your rules in the system role gives them more standing than text buried in user content, which…
- The critical safety point is that retrieved documents, tool outputs, and web content are data, not…
- Keeping trusted instructions and untrusted data in clearly separated roles is a first-line defense…
Key terms: Learn more
In the glossary: Prompt injection
Quick-fire answer from the Awesome Generative AI Guide (MIT) · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep