Frodex

Frodex

Beta
EnglishPortuguês (BR)
Foundations
1Introduction2Tokens3Controlling the Model
Communicating with LLMs
4Anatomy of a Good Prompt5System Prompts and Personas6Few-Shot Learning
Structured Outputs
7JSON Mode and Structured Output8Function Calling
Advanced Techniques
9Chain of Thought Reasoning10Managing the Context Window11Embeddings and Semantic Search
Production Systems
12Retrieval-Augmented Generation (RAG)13Streaming Responses14Evaluation and Cost Optimization
Frodex

Frodex

Beta
EnglishPortuguês (BR)
Foundations
1Introduction2Tokens3Controlling the Model
Communicating with LLMs
4Anatomy of a Good Prompt5System Prompts and Personas6Few-Shot Learning
Structured Outputs
7JSON Mode and Structured Output8Function Calling
Advanced Techniques
9Chain of Thought Reasoning10Managing the Context Window11Embeddings and Semantic Search
Production Systems
12Retrieval-Augmented Generation (RAG)13Streaming Responses14Evaluation and Cost Optimization
Communicating with LLMs
15 minLesson 5 of 14

System Prompts and Personas

Shape model behavior with system prompts and personas for specific products and workflows

Learning goals

  • •Understand what system prompts are and how they work
  • •Learn to design effective personas for different use cases
  • •Know common patterns for system prompt design

What Is a System Prompt?

  • Sets persistent behavior rules
  • Defines the AI's role and capabilities
  • Establishes constraints and guidelines
  • Is typically invisible to end users

Most APIs distinguish between "system" and "user" messages, giving system prompts priority.

Designing Effective Personas

Define the Role Clearly ``` You are a senior software architect with 15 years of experience in distributed systems. You prioritize scalability and maintainability. ```

Set Behavioral Rules ``` Rules: - Always ask clarifying questions before providing solutions - Cite trade-offs for every recommendation - Never recommend deprecated technologies ```

Establish Boundaries ``` Limitations: - You can only discuss topics related to software architecture - You cannot write or execute code directly - You must acknowledge uncertainty when applicable ```

System Prompt Patterns

The Expert Pattern Position the model as a domain expert with specific knowledge and approach.

The Persona Pattern Give the model a character with personality traits, speaking style, and values.

The Safety Pattern Include instructions for handling edge cases, sensitive topics, and error conditions.

Common mistakes

×Making system prompts too long—the model may ignore parts of overly complex instructions
×Conflicting instructions—contradictory rules confuse the model
×Not testing edge cases—users will try to break or bypass your system prompt
×Assuming perfect compliance—models may still deviate from system prompt instructions

Key takeaways

+System prompts set persistent behavior rules for the entire conversation
+Define clear roles, rules, and boundaries in your system prompts
+Use patterns like Expert, Persona, and Safety for different use cases
+Test thoroughly—users will find ways to challenge your system prompt

Playground

Try These Experiments

Prompt

Why This Experiment?

See how system prompts change the model's behavior and focus.

Response
No response yet
Choose an experiment above or type your own prompt, then click Run to see the model's response here.

Without a system prompt, you get a generic review. The model doesn't know your standards or what aspects to focus on.