System Prompts
Initial instructions given to an AI that define its behavior, personality, constraints, and capabilities for the entire conversation.
Also known as: System Messages, System Instructions, Base Prompts, AI Configuration
Category: Techniques
Tags: ai, prompting, llm-techniques, ai-safety, product-development
Explanation
System prompts (or system messages) are foundational instructions provided to an AI at the start of a conversation that shape all subsequent interactions. Unlike user prompts that ask for specific tasks, system prompts define who the AI is and how it should behave.
Key components of effective system prompts:
- **Identity**: Who or what the AI should act as
- **Capabilities**: What the AI can and should do
- **Constraints**: What the AI should avoid or refuse
- **Style guidelines**: Tone, verbosity, formatting preferences
- **Context**: Background information relevant to all interactions
System prompt structure patterns:
```
You are [identity/role].
Your purpose is to [primary goal].
You should:
- [behavior 1]
- [behavior 2]
You should not:
- [constraint 1]
- [constraint 2]
Format your responses as [format guidelines].
```
Best practices:
- Place critical instructions at the beginning and end (primacy/recency effects)
- Be explicit about edge cases and exceptions
- Use clear, unambiguous language
- Test against adversarial inputs
- Iterate based on actual usage patterns
System prompts are essential for:
- Custom AI assistants and chatbots
- Product-specific AI integrations
- Maintaining consistent AI behavior
- Implementing safety guardrails
The effectiveness of a system prompt significantly impacts user experience and safety.
Related Concepts
← Back to all concepts