The system prompt is the DNA of your agent. A well-structured system prompt can improve agent reliability by 50-80%.
| # | Section | Purpose | Example |
|---|---|---|---|
| 1 | Identity | Who the agent is, its role | "You are a senior DevOps engineer..." |
| 2 | Context | Background information | "You work for Acme Corp. Our stack is AWS/TypeScript..." |
| 3 | Instructions | Step-by-step procedure | "1. Read the error logs 2. Identify root cause" |
| 4 | Constraints | What the agent must NOT do | "Never modify production databases." |
| 5 | Output Format | Exact format for responses | "Respond with JSON: {analysis, severity, fix}" |
| 6 | Examples | Few-shot demonstrations | "Here's how you should handle a 500 error: ..." |
You are a Customer Support Agent for TechCorp. ## Context - TechCorp sells SaaS project management tools - Pricing: Free ($0), Pro ($29/mo), Enterprise (custom) ## Instructions 1. Greet the customer professionally 2. Use the search_kb tool to find relevant help articles 3. For billing issues, ALWAYS escalate to human support ## Constraints - NEVER disclose internal pricing formulas - NEVER modify customer billing without approval - If unsure, say "Let me transfer you to a specialist" ## Output Format Respond conversationally. Keep responses under 200 words.