Skip to content
Learn Netverks

Lesson

Step 13/36 36% through track

message-roles-system-user

System, User, and Assistant Roles

Last reviewed May 28, 2026 Content v20260528
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
beginner

This lesson

This lesson teaches System, User, and Assistant Roles: generative AI patterns—LLMs, prompting, retrieval, safety, and integration habits for real assistants and copilots.

Teams apply System, User, and Assistant Roles in every serious Generative AI project—skipping it leaves blind spots in analysis and reviews.

You will apply System, User, and Assistant Roles in contexts like: Chat products, code assistants, search augmentation, and internal knowledge tools.

Study explanations, case studies, and MCQs—this topic is read/quiz focused without a code runner.

When you can explain the previous lesson's ideas in your own words.

Chat APIs structure messages by role so the model separates policy from user content—critical for safety and RAG boundaries.

Roles

  • system — persistent rules, persona, tool policies
  • user — end-user input (may include retrieved context)
  • assistant — prior model replies in multi-turn chat
  • tool (vendor-specific) — function results fed back

System prompt hygiene

Keep system text stable across turns. Do not let users edit system instructions in the UI without authorization. Version system prompts like code.

Delimiters against injection

user_block = f"""### USER_INPUT_START
{sanitize(user_text)}
### USER_INPUT_END"""

Important interview questions and answers

  1. Q: Why separate system from user?
    A: System rules should not be trivially overridden by a later user line saying ignore previous instructions.

Self-check

  1. What goes in the system role?
  2. Why delimit user input?

Pitfall: Letting users edit the system prompt in production—treat as authorization bug.

Interview prep

System role?

Stable policy and persona separate from untrusted user content.

Delimiters?

Mark user data boundaries to reduce injection confusion.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • System vs user?
  • Delimiter why?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump