System Prompt Case Studies
System Prompt Case Library
A collection of real system prompt designs from major AI companies. Study these cases to understand industry best practices, then apply them to your own AI Agent development.
Case Overview
| Company | Product | Core Feature | Learning Value |
|---|---|---|---|
| Anthropic | Claude.ai, Claude Code | RLHF safety design, multi-role | Agent safety boundary design |
| OpenAI | GPT-4o, Agent Mode | Function Calling, message channels | Tool calling conventions |
| Gemini CLI, Guided Learning | Project conventions, workflows | Code agent best practices | |
| xAI | Grok 3/4, Personas | Persona system, X platform integration | Personalized role design |
| Others | Perplexity, Kagi, Raycast | Search strategies, format specs | Vertical domain design |
Anthropic Claude
Claude.ai & Claude Code
Core design philosophy: Safe, helpful, honest
Key features:
- RLHF safety mechanisms: Constitutional AI design
- CLAUDE.md configuration: Users can customize agent behavior
- Tool specifications: Detailed Tool Use constraints
- Multi-role switching: Adapts to different scenarios via system prompt
Best suited for:
- Coding assistant development
- Long document processing
- Applications requiring high safety
Typical design pattern:
You are Claude, made by Anthropic...
You can use tools to complete tasks...
NEVER do X without explicit permission...
Deep dive into Claude System Prompts
OpenAI GPT
GPT-4o & Agent Mode
Core design philosophy: General-purpose, flexible, rich ecosystem
Key features:
- Function Calling: TypeScript Namespace-style tool definitions
- Message channel system: analysis / commentary / final separation
- Financial activity restrictions: Explicit Allowed / Not Allowed lists
- Safe browsing rules: Defense against Prompt Injection
Best suited for:
- Browser automation
- Complex multi-step tasks
- Applications requiring tool calling
Typical design pattern:
namespace tools {
type function_name = (_: { param: string }) => any;
}
Deep dive into GPT System Prompts
Google Gemini
Gemini CLI & Guided Learning
Core design philosophy: Project conventions first, workflow-driven
Key features:
- Project conventions first: NEVER assume — analyze existing code first
- Five-step workflow: Understand → Plan → Implement → Verify Tests → Verify Standards
- Guided learning: Socratic teaching method
- Self-verification loops: Emphasis on testing and standards checks
Best suited for:
- Code agent development
- Educational AI applications
- Scenarios requiring strict workflows
Typical design pattern:
## Software Engineering Tasks
1. Understand: Think about the user's request...
2. Plan: Build a coherent plan...
3. Implement: Use available tools...
4. Verify (Tests): Run project tests...
5. Verify (Standards): Run linting...
Deep dive into Gemini System Prompts
xAI Grok
Grok 3/4 & Persona System
Core design philosophy: Personalization, real-time information, X platform integration
Key features:
- Persona system: Multi-personality role switching
- X platform integration: Native X search and analysis support
- Render components: Dedicated citation and formatting system
- Real-time information: No strict knowledge cutoff date
Available Personas:
- Companion
- Unhinged Comedian
- Loyal Friend
- Homework Helper
- Not a Doctor / Not a Therapist
Best suited for:
- Social media applications
- Personalized chatbots
- Applications requiring real-time information
Typical design pattern:
You are Grok, a [personality] chatbot...
## Style Rules:
- match the user's vulgarity
- always write in lowercase
- use abbreviations like rn ur bc
Deep dive into Grok System Prompts
Other AI Products
Perplexity, Kagi, Raycast AI
Three products, three distinct approaches:
| Product | Positioning | Core Design |
|---|---|---|
| Perplexity | AI search engine | Real-time search strategy, voice interaction specs |
| Kagi Assistant | Premium search assistant | Most detailed format specification system |
| Raycast AI | Desktop productivity tool | User system preference injection |
Learning value:
- Perplexity: How to design search-oriented AI (re-search on every follow-up)
- Kagi: How to design detailed output format specifications
- Raycast: How to integrate user system preferences (language, timezone, units)
Deep dive into other AI product System Prompts
Design Pattern Comparison
From these cases, we can distill several core design patterns:
1. Identity Definition Patterns
| Company | Style |
|---|---|
| Claude | "You are Claude, made by Anthropic" |
| GPT | "You are ChatGPT, a large language model..." |
| Grok | "You are Grok, a [persona] chatbot..." |
2. Tool Definition Patterns
| Company | Style |
|---|---|
| OpenAI | TypeScript Namespace |
| Anthropic | XML-format Tool Definition |
| Grok | XML Function Call |
3. Safety Boundary Patterns
| Company | Approach |
|---|---|
| Claude | NEVER / ALWAYS keywords |
| GPT | Allowed / Not Allowed lists |
| Grok | Boundaries (Never Do) sections |
How to Apply These Cases
1. Choose a Reference Template
Pick the best reference based on your use case:
- Coding assistant → Reference Claude Code, Gemini CLI
- Search application → Reference Perplexity
- Chatbot → Reference Grok Personas
- Browser automation → Reference GPT Agent Mode
2. Reuse Design Patterns
Directly reuse proven design patterns:
SYSTEM_PROMPT = """
# Identity (reference: Claude)
You are [Your Agent Name], a [role] assistant.
# Tools (reference: OpenAI)
You have access to the following tools...
# Constraints (reference: Grok)
## Boundaries (Never Do):
- Never do X without permission
- Never share Y information
# Output (reference: Kagi)
Format your response with proper markdown...
"""
3. Iterate and Optimize
- Start with a simple version
- Observe agent behavior
- Gradually add constraints and examples
- Test edge cases
- Refine safety boundaries
Further Reading
- System Prompt Design in Practice - 10 reusable design patterns
- Prompt Master Course - Systematic Prompt Engineering training
- AI Agent Development - Building autonomous AI agents
These cases all come from real products, showing how top companies approach system prompt design. Study them, then develop your own style.