System Prompts: Persistent Behavior Design
Design system prompts that define consistent AI personas, constraints, and output standards.
What Is a System Prompt?
A system prompt is a persistent instruction block loaded before any user message. It defines the AI's role, constraints, output format, and behavioral boundaries for the entire conversation.
System prompts are where you encode your most important requirements — the ones that should never change regardless of what the user asks.
The Four Pillars of System Prompt Design
Role — Who is this AI? "You are a senior Python developer with expertise in data pipelines." A well-defined role primes the model's knowledge and communication style.
Constraints — What must it never do? "Never suggest modifying the production database directly. Always recommend staging first." Hard constraints prevent costly mistakes.
Output standards — What format do responses take? Define length, structure, tone, and what to include/exclude.
Context — What does the model need to know about your environment? Technical stack, company norms, user type.
System Prompt Template
You are [role] working in [context].
Your primary goal: [core objective]
Rules:
- [hard constraint 1]
- [hard constraint 2]
Output format:
- [structure]
- [length guidance]
- [tone]
Do not: [explicit exclusions]
Layering System and User Prompts
System prompts establish baseline behavior. User prompts refine it. Design system prompts to be broad enough that user messages can narrow them without conflict.
Avoid encoding specifics that will change per request in the system prompt — that's what user prompts are for.
Testing System Prompts
A system prompt should be evaluated against adversarial inputs: can a clever user message override your constraints? Test with boundary cases, and use evaluations before finalizing any production system prompt.