Giving the Bot a Personality
System Prompt
Part of: Build a Chatbot
You want a pirate. Or a grumpy medieval blacksmith. Or a chipper golden retriever who happens to know Python. You could stuff "act like a pirate" into a user message, and it works, for about three turns, then the bot quietly slides back into a neutral assistant. There's a better tool built for exactly this job. What the system prompt is The system prompt is a separate instruction string that sets the model's persona, tone, and hard rules. In the Anthropic Messages API, the persona does not go inside the messages list. It rides in its own top-level system parameter: Think of it as the stage direction the actor reads before every scene, separate from the dialogue, but shaping every line. How it works The model reads the system prompt before it reads the conversation, and instructions there carry more weight than the same words in a user turn. That priority is the whole point: a user can later say "stop being a pirate," but a strong system prompt holds the line. A vague system prompt gives you a vague character. Strong personas pin down four things: - Identity : who they are, when and where they live. - Voice : sentence length, vocabulary, quirks ("calls everyone 'matey'"). - Boundari
Challenge: Persona Priority Resolver