Skip to main content
Lesson 6 of 16 · Mastering Prompts with Mistral

Role-Playing and Personas

Lesson 6 of 16 Updated July 28, 2026 Beginner
On this page
  1. Assigning a Role to the Model
  2. Building an Effective Persona
  3. Three Ready-to-Adapt Personas
  4. Advanced System Prompt: Combining Persona and Business Rules
  5. Testing and Iterating on Your Personas
  6. Key Takeaways

Assigning a Role to the Model

One of the most powerful techniques with Mistral models is assigning them a specific role via the system prompt. By clearly defining who the model is, what it knows, and how it should behave, you drastically steer the quality and relevance of responses. The fundamental pattern boils down to one sentence: “You are a [role], your mission is to [task].” This instruction helps the model immediately understand expectations and adapt its vocabulary, level of detail, and approach.

Why does this work so well? Because a role condenses hundreds of micro-decisions into a few words. Assign the model the role of a legal expert, and its vocabulary adapts: it won’t speak like a community manager. Make it a senior consultant, and the level of detail adjusts: it will summarize where a trainer would elaborate. Priorities shift too—an auditor spontaneously looks for risks, a salesperson for opportunities—and the format follows: a developer produces code, a writer produces prose. Each of these adjustments stems automatically from the role, without you having to prescribe them one by one.

Building an Effective Persona

A good persona goes beyond a simple title. Writing “You are an expert” adds almost nothing; what matters is what you put behind it. Four dimensions structure a complete persona.

The first is professional identity, with enough precision to anchor expertise: “You are a senior cloud architect with 15 years of experience, specialized in AWS infrastructures and migrations from on-premise systems.” Every detail—seniority, specialization—steers responses toward the expected level.

The second is communication style. Specify how this character expresses itself: “You communicate in a direct, technical manner. You use analogies when a concept is complex. You do not hesitate to say ‘I don’t know’ rather than speculate on topics outside your expertise.” This last phrase, in particular, visibly reduces hallucinated responses.

The third dimension, too often forgotten, concerns role limits: what the character refuses to do. “You do NOT give legal or financial advice. If a question touches on these areas, you recommend consulting a specialist.” In an application exposed to real users, these guardrails are as important as the expertise itself.

The fourth is target audience: who the character is addressing. “You are addressing CTOs and lead developers evaluating a cloud migration. They know the technical vocabulary but need help with strategy and pricing.” The model then knows what to explain and what to take for granted.

Three Ready-to-Adapt Personas

Let’s see how these dimensions come together in complete personas. First case, the technical expert:

system_prompt = """You are a senior Python developer specialized in data engineering.
Your role:
- Write clean, documented, and tested code
- Use best practices (PEP 8, type hints, docstrings)
- Propose performant and maintainable solutions
- Flag pitfalls and edge cases

When you write code:
- Add explanatory comments
- Include error handling
- Propose unit tests when relevant"""

Second case, the professional translator—notice how the rules translate real trade-offs, literalness vs. clarity, handling ambiguities:

system_prompt = """You are a professional French-English translator
specialized in technical documentation and B2B marketing content.

Translation rules:
- Prioritize clarity over literalness
- Adapt idiomatic expressions to the target cultural context
- Keep recognized English technical terms (API, SaaS, cloud)
- Flag ambiguous passages with [TRANSLATOR NOTE: ...]
- Maintain the formal register of the source text"""

Third case, the editorial proofreader, showing that a persona can also impose a workflow and output format:

system_prompt = """You are a professional proofreader-editor for a
French publishing house.

Your work:
1. Correct spelling, grammar, and syntax errors
2. Improve flow without changing the meaning
3. Flag inconsistencies in style or tone
4. Respect French typographic conventions
   (non-breaking spaces, French quotation marks, etc.)

Output format:
- The corrected text first
- Then the list of modifications with justification"""

Advanced System Prompt: Combining Persona and Business Rules

For production applications, the persona alone is no longer enough: you need to add precise business rules, delimited knowledge, and an objective. Here is a complete sales assistant, structured in sections:

system_prompt = """# Role
You are the sales assistant for TechCorp, a French company
providing SaaS solutions for project management.

# Behavior
- Professional and enthusiastic tone (without excess)
- Maintain a formal tone
- Concise responses (3-5 sentences per point)

# Knowledge
- You know the 3 plans: Starter (€29/month), Pro (€79/month), Enterprise (quote upon request)
- You know the key features of each plan
- You do NOT know technical implementation details

# Limits
- NEVER give a discount without manager validation
- NEVER compare directly with named competitors
- If the question exceeds your scope, propose a meeting
  with an expert: "I suggest organizing a call with our
  technical team to delve deeper into this point."

# Objective
Qualify the prospect's need and steer them toward the suitable plan."""

Note the “Knowledge” section which also defines what the assistant does not know: this prevents it from improvising risky technical answers. And the ready-made fallback phrase in the limits guarantees an elegant exit when the question exceeds the scope.

Testing and Iterating on Your Personas

A persona is never perfect on the first try, and that’s normal: you discover its flaws through use. Adopt a five-step iteration approach: write an initial version with the role, style, and limits; test it with 5 to 10 questions representative of your real use cases; identify gaps between the obtained response and the desired response; add targeted rules to correct each gap; then retest, and repeat until satisfied. A sales assistant that uses informal address with a prospect during testing isn’t a failure—it’s a “Maintain a formal tone” rule that just earned its place in the system prompt.

Key Takeaways

  • Assigning a role to the model steers its vocabulary, tone, and priorities
  • A good persona includes identity, style, limits, and target audience
  • The system prompt is the ideal place to define a persistent persona
  • Combine persona and business rules for professional applications
  • Test and iterate on your personas with representative questions