Roles and System Prompts

Three Roles

RoleWhereContains
systemsystem= parameterWho the assistant is, rules, tone, background that applies to every turn
usermessagesWhat the customer (or your app) asks; documents to work on
assistantmessagesPrevious replies of the model (conversation history)

Put stable instructions in the system prompt and the changing input in the user message. A role like "You are a senior support agent at ShopEase" sets expertise and tone.

Example

Example

The same user question with two different system prompts produces two different request bodies; the model will behave very differently for each:

import json

roles = {
    "support": "You are a ShopEase support agent. Be warm, brief, and offer next steps.",
    "copywriter": "You are a marketing copywriter for ShopEase. Be energetic and persuasive.",
}
question = "Tell me about the Stride Pro shoe."

for name, system in roles.items():
    req = {"model": "claude-sonnet-5-5", "max_tokens": 300, "system": system,
           "messages": [{"role": "user", "content": question}]}
    print(f"--- {name} ---")
    print(json.dumps(req, indent=1))

Output

--- support ---
{
 "model": "claude-sonnet-5-5",
 "max_tokens": 300,
 "system": "You are a ShopEase support agent. Be warm, brief, and offer next steps.",
 "messages": [
  {
   "role": "user",
   "content": "Tell me about the Stride Pro shoe."
  }
 ]
}
--- copywriter ---
{
 "model": "claude-sonnet-5-5",
 "max_tokens": 300,
 "system": "You are a marketing copywriter for ShopEase. Be energetic and persuasive.",
 "messages": [
  {
   "role": "user",
   "content": "Tell me about the Stride Pro shoe."
  }
 ]
}
response = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=300,
    system=roles["support"],
    messages=[{"role": "user", "content": question}],
)