# Message Roles

> Tags on chat messages. They say who wrote each one: the app, the person or the model.

**Field:** Artificial Intelligence  
**Category:** LLMs  
**Also known as:** Chat Roles, Chat Message Roles, System, User and Assistant Roles

## Think of it like

It is like a play script. Each line has a name on it, so you know who said it.

## Definition

Message roles are the tags that say who wrote each message in a chat with a language model. The system role holds the app's standing rules. The user role holds what the person typed. The assistant role holds what the model said back. The model reads the whole list in order each time it answers. Some APIs call the first role developer, and some send it as its own field.

## Example

A tutor app sends three messages. The system one says to be a kind maths tutor. The user one asks what 7 x 8 is. The assistant one holds the model's answer, 56.

## Example code

```json
[
  { "role": "system", "content": "You are a kind maths tutor." },
  { "role": "user", "content": "What is 7 x 8?" },
  { "role": "assistant", "content": "7 x 8 is 56." }
]
```

Each message in the list carries a role that says who wrote it.

## Why it matters

Roles let the model tell your rules apart from the user's words. That is how it knows which to follow.

## Common mistake

Putting your app's rules in a user message. The model treats them as one more request, not as rules.

## Three principles

- **System.** The app's standing rules.
- **User.** What the person typed.
- **Assistant.** What the model said back.

## Related terms

- [System Prompt](https://learn.benibix.com/term/ai/system-prompt)
- [Context Window](https://learn.benibix.com/term/ai/context-window)
- [Large Language Model (LLM)](https://learn.benibix.com/term/ai/large-language-model)
- [Prompt (AI)](https://learn.benibix.com/term/ai/prompt)
- [Instruct Model](https://learn.benibix.com/term/ai/instruct-model)
- [Multi-Turn Conversation](https://learn.benibix.com/term/ai/multi-turn-conversation)

## Taught in

- [The LLM Context Window](https://learn.benibix.com/learn/ai-llms/llm-context-window): LLMs, 4/15
- [System Prompts and Roles](https://learn.benibix.com/learn/ai-working-with-ai/system-prompts-and-roles): Prompt Engineering, 3/16

![Three rows, one per role. System, highlighted: the app's standing rules, who the assistant is and what it may do, written by the builder and followed all chat long. User: what the person typed, such as questions, files and follow-ups. Assistant: what the model said back, sent back each turn so it remembers its own words. A note says the model reads the whole list, top to bottom, every time it answers.](https://learn.benibix.com/diagrams/ai2-message-roles.svg)

---

Source: https://learn.benibix.com/term/ai/message-roles
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
