System Prompts — The Complete Guide
How to write effective system prompts for any AI
System prompts are the foundation of effective prompt engineering in India and globally. Whether you are an Indian developer building a customer service bot, a student creating a study assistant, or a business automating workflows with ChatGPT or Claude, the system prompt defines how the AI thinks, responds, and limits itself throughout every interaction. This guide teaches you to write system prompts that actually work — with India-specific examples and ready-to-use templates.
What You'll Learn
- What system prompts are and how they differ from regular messages
- The four-part structure that produces reliable system prompts
- How to set system prompts in ChatGPT and Claude
- What to include and what to avoid
- 5 ready-to-use system prompt templates
What System Prompts Do
In most AI applications, there are three types of messages:
- System: Instructions set before the conversation, invisible to users
- User: What the user types
- Assistant: What the AI responds
The system prompt runs before everything else. It establishes:
- Role: Who the AI is in this context (a helpful tax advisor, a strict code reviewer, a friendly tutor)
- Persona: How it should talk (formal, casual, technical, simple)
- Rules: What it should and should not do
- Format: How to structure responses
Once set, the system prompt influences every response in the conversation without the user repeating instructions.
The Four-Part Structure
A reliable system prompt has four components. Not all are required for every use case, but together they produce consistent, specialized behavior.
Part 1: Role Definition
You are a senior software architect specializing in Python and cloud infrastructure.
You have 15 years of experience building distributed systems.
Part 2: Context
You are helping engineers at an Indian fintech startup building payment processing infrastructure.
The tech stack is Python, FastAPI, PostgreSQL, and Azure.
Indian regulatory context: PCI-DSS compliance and RBI guidelines apply.
Part 3: Rules and Constraints
Rules:
- Always recommend the simplest solution that meets requirements
- Mention security implications for every technical decision
- When suggesting third-party services, always include an open-source alternative
- Do not provide code for handling real payment card data without flagging PCI-DSS requirements
- If you are uncertain, say so clearly rather than guessing
Part 4: Response Format
Response format:
- Lead with a direct answer (1-2 sentences)
- Then provide explanation with context
- Include code examples when relevant (with comments)
- End with any important caveats or "you should know" items
- Keep responses under 500 words unless detail is specifically requested
Setting System Prompts in ChatGPT
ChatGPT uses "Custom Instructions" as the user-accessible version of system prompts.
How to set:
- Click your profile icon → Customize ChatGPT
- Two fields appear:
- "What would you like ChatGPT to know about you?" → Your background and context
- "How would you like ChatGPT to respond?" → Rules and format preferences
Example custom instructions:
What to know about me:
I am a second-year BTech student at an NIT studying Computer Science.
I am learning Python and working on my first Django project.
I have basic understanding of HTML/CSS and SQL.
I sometimes need explanations in simple terms.
How to respond:
- Explain concepts with real-world analogies when possible
- For code, always add comments explaining what each part does
- If I ask something that suggests a misconception, correct it kindly
- Use Indian examples (rupees not dollars, Indian companies as examples)
- Keep responses concise — I will ask for more detail if needed
For ChatGPT API users, the system prompt is the system role in the messages array.
🇮🇳 India Note: Adding "Use Indian examples and context where relevant — Indian companies, INR currency, Indian educational system" to your ChatGPT custom instructions significantly improves relevance for Indian users.
Setting System Prompts in Claude
In Claude.ai (the web interface), system prompts are set per Project:
- Create a new Project (left sidebar)
- Click Project Instructions
- Enter your system prompt
- Every new conversation in that project uses this system prompt
For the Claude API, the system prompt is a separate system parameter in the request.
Claude-specific tip: Claude responds better to system prompts that use XML tags for structure:
<role>You are an expert in Indian taxation and CA exam preparation.</role>
<context>You are helping CA students understand complex tax concepts.
Students are preparing for IPCC and Final exams.</context>
<rules>
<rule>Always cite the relevant section of the Income Tax Act or GST Act</rule>
<rule>Provide numerical examples with INR amounts</rule>
<rule>Flag recent amendments (post-2024) explicitly</rule>
</rules>
<format>
Explain concepts clearly, then provide a worked example.
End each response with "Key takeaway:" in one sentence.
</format>
5 Ready-to-Use System Prompt Templates
1. Personal Study Assistant (JEE/NEET/UPSC)
You are an expert tutor helping Indian students prepare for competitive exams.
Your specialization: [JEE Physics | NEET Biology | UPSC Current Affairs — choose one].
Rules:
- Explain concepts from first principles before introducing formulas
- For JEE/NEET: always explain why, not just what
- For UPSC: connect topics to current events and policy implications
- When a student makes an error, ask them to spot it before correcting
- Use NCERT as the base reference; mention when topics go beyond NCERT
Format: Concept → Example → Practice question → Common mistake to avoid
2. Code Reviewer
You are a strict but fair senior code reviewer.
You review for correctness, security, performance, and maintainability.
Rules:
- Find ALL issues, not just major ones (minor issues still matter)
- Rate every issue: Critical / Major / Minor / Suggestion
- For every problem you identify, suggest the specific fix
- Do not rewrite entire code — point to specific lines and changes needed
- If the code is good, say so explicitly (do not invent problems)
Format: List issues by severity. Include line references.
3. Indian Business Advisor
You are a business consultant familiar with India's startup ecosystem, regulations, and market.
Context: India 2026 startup and SME environment.
Rules:
- All financial figures in INR unless specifically asked otherwise
- Consider Indian-specific factors: GST compliance, MSME schemes, Startup India benefits
- When recommending tools or services, mention India availability and pricing
- Consider typical Indian internet infrastructure and mobile-first user behavior
- Reference relevant government schemes when applicable (PLI, DPIIT, etc.)
Format: Direct recommendation first, then rationale, then implementation steps.
4. Writing Editor
You are a professional editor who improves writing quality without changing the author's voice.
Rules:
- Preserve the author's unique style and voice
- Fix grammar and clarity, not personality
- Suggest rather than rewrite — show what to change and why
- Do not make writing more formal unless asked
- Flag repetitive phrases, weak verbs, and vague language
- For Indian English: accept standard Indian English usage, do not "American-ize" unnecessarily
Format: Show original → Show suggested change → Brief explanation of why
5. Customer Support Bot
You are a helpful customer support agent for [Company Name], an Indian e-commerce platform.
Context: You handle questions about orders, returns, payments, and product information.
Rules:
- Always be polite and empathetic — the customer may be frustrated
- For order status queries, ask for the order ID if not provided
- For return requests: confirm eligibility first (within 7 days, product condition)
- Never make promises you cannot keep (e.g., "Your refund will arrive tomorrow")
- Escalate to human agent when: abuse, threats, legal complaints, complex disputes
- Available return window: 7 days. Refund processing: 5-7 business days.
Format: Acknowledge their issue first, then provide solution or next steps.
How to Write a System Prompt Step by Step
Step 1: Define the Role and Persona
Begin every system prompt with a clear role statement. The role anchors every subsequent response — the AI will maintain this identity throughout the conversation. Be specific: "a senior Python developer" outperforms "a helpful assistant." Include experience level, domain, and any persona details that change how the AI communicates (formal vs casual, technical depth, language preference).
Step 2: Add Context Relevant to Your Use Case
Context is what makes a system prompt truly powerful. Tell the AI who it is serving, what platform or product it is operating within, and any domain-specific constraints. For Indian use cases, include details like currency (INR), regulatory context (GST, RBI guidelines, DPIIT rules), language preferences (Hindi/English/regional), and the specific Indian audience being served. The more relevant context you provide, the fewer clarifying questions the AI needs to ask.
Step 3: Write Clear Rules and Constraints
Rules govern what the AI should and should not do. Keep each rule atomic — one instruction per rule. Avoid vague instructions like "be helpful"; instead write "always provide a numbered list of action items at the end of each response." Include explicit escalation rules (when to say it cannot help), format rules (bullet points vs paragraphs, word limits), and any hard constraints (never discuss competitor pricing, always include a disclaimer for medical advice).
Step 4: Specify the Output Format
The final part of the four-part structure is the output format. Tell the AI exactly how to structure its responses: headers, bullet points, code blocks, tables, or flowing paragraphs. Specify length guidance ("keep responses under 300 words unless the user asks for detail"). For API use cases, specifying JSON output format in the system prompt is especially valuable for downstream processing.
System Prompt Comparison: ChatGPT vs Claude vs Gemini
| Feature | ChatGPT (Custom Instructions) | Claude (Project Instructions) | Gemini (System Instructions) |
|---------|-------------------------------|-------------------------------|-------------------------------|
| Access method | Settings → Customize ChatGPT | Project → Project Instructions | API system_instruction field |
| Persistence | Across all chats (global) | Per project | Per API call |
| Character limit | ~1,500 characters | ~200,000 tokens | ~8,000 tokens |
| Formatting support | Plain text, markdown | Markdown and XML tags | Plain text, markdown |
| Best for | Personal assistant customization | Specialized project workflows | Developer API integrations |
| Free tier availability | Yes (ChatGPT Free) | Yes (Claude Free) | Yes (Gemini Free) |
| India pricing | Free / ₹1,650/month Plus | Free / ₹1,650/month Pro | Free / via Google One |
Frequently Asked Questions
What is a system prompt? A system prompt is a set of instructions given to the AI before the conversation starts. It defines the AI's role, behavior, rules, and output format for every interaction in that session. Unlike regular messages, system prompts persist throughout the entire conversation without being repeated.
How do I set a system prompt in ChatGPT?
In ChatGPT, go to Settings and use Custom Instructions. For the API, include a system message with role system as the first message in your conversation array. Indian users can set instructions like "use INR for all currency examples" to get locally relevant responses.
What should a good system prompt include? A good system prompt has four parts: the AI's role and persona, context about the task or domain (including India-specific context if relevant), specific rules and constraints, and the desired output format. Starting with these four parts produces reliable, specialized behavior in any AI model.
Can system prompts make AI responses more accurate? Yes. A well-written system prompt significantly improves consistency and accuracy because the AI follows your specified constraints and format throughout every response. For domain-specific use cases — Indian tax advice, UPSC preparation, or fintech compliance — a good system prompt is the difference between generic and genuinely useful output.
How are system prompts different from regular prompts? A system prompt runs before the conversation and persistently shapes all responses, while a regular prompt is a single one-time message. System prompts set permanent rules; regular prompts ask one-off questions. For building reliable AI assistants — whether for personal productivity or Indian business workflows — system prompts are essential.
What to Avoid in System Prompts
Overly long prompts — 500+ word system prompts often get partially ignored. Keep to essentials.
Contradictory rules — "Always be concise" AND "Always provide detailed explanations" will produce inconsistent behavior.
Trying to prevent all possible bad behavior — You cannot enumerate every edge case. Focus on the most important rules.
Repeating the prompt in every message — That is what the system prompt is for. Do not re-explain your rules in every user message.
Official Resources
- Anthropic Prompt Engineering Guide — Claude system prompt best practices
- OpenAI System Messages Guide — OpenAI's documentation
- ChatGPT Custom Instructions — How to set custom instructions
- PromptAndSkills Templates — Community prompt templates
- Anthropic Model Documentation — Claude model capabilities and context
Community Questions
0No questions yet. Be the first to ask!