Prompts
System prompt examples for real developer use cases
20 original, free system prompts for the jobs developers actually build: support bots, coding helpers, RAG, JSON extraction, SQL, agents and classifiers. Each one explains why every section is there, how it fails, and what it costs to send with every request.
20 system prompts
- Customer support agent with escalationAnswers from your help centre, never invents policy, and hands off to a person on clear, testable triggers.Assistants · 522 tokens
- Voice assistant for spoken repliesWrites replies meant to be read aloud by text-to-speech: short, no formatting, numbers spoken naturally.Assistants · 298 tokens
- Tutor that guides instead of answeringTeaches by hints and questions, gives answers only after real attempts, and checks understanding at the end.Assistants · 373 tokens
- Coding assistant for TypeScript and ReactPairs on a TypeScript, React and Node codebase: follows your conventions, reads before claiming, and shows minimal diffs.Coding · 371 tokens
- Code reviewerReviews a diff for correctness, security and maintainability, ranked by severity, with each finding tied to a line.Coding · 359 tokens
- Unit test writerWrites focused unit tests for a function or module: behaviour over implementation, edge cases included, code under test left alone.Coding · 299 tokens
- Pull request description writerTurns a diff and a ticket into a clear PR description: why, what, how to test and the risks, without padding.Coding · 284 tokens
- RAG assistant that cites sourcesAnswers only from retrieved documents, cites every claim, says when the documents don’t cover it, and flags conflicts.RAG and search · 340 tokens
- Search query rewriter for RAGRewrites the latest chat message into standalone search queries for your retriever, as JSON, without answering.RAG and search · 277 tokens
- JSON-only extraction serviceExtracts fields from emails, invoices or forms into a fixed JSON shape, with null for anything missing.Data and extraction · 258 tokens
- SQL analyst with read-only safetyAnswers data questions by writing read-only SQL against your schema, with limits, assumptions stated and results explained.Data and extraction · 371 tokens
- Tool-using agent that confirms risky actionsRuns multi-step tasks with tools, acts freely on reversible steps and asks before anything destructive or visible to others.Agents · 390 tokens
- Inbox assistant that treats email as untrustedSummarises the inbox and drafts replies, treats every email as untrusted, and never sends or forwards on its own.Agents · 382 tokens
- Incident triage assistant for logs and alertsReads alerts and log excerpts, separates evidence from hypotheses, and suggests the safest next diagnostic step.Agents · 331 tokens
- Content moderation classifierLabels user content against your written policy, cites the rule, and sends borderline cases to a human.Classification and evaluation · 262 tokens
- Support ticket triage and routingLabels each incoming ticket with team, urgency and sentiment, extracts key details, and returns JSON for routing.Classification and evaluation · 365 tokens
- LLM-as-judge evaluatorGrades another model’s answer against a rubric, criterion by criterion, with evidence before each score.Classification and evaluation · 285 tokens
- Meeting summariserTurns a transcript into decisions, owned action items and open questions, and marks anything unclear instead of guessing.Writing · 294 tokens
- Technical writer for developer docsDrafts and edits developer docs: task-first, consistent terms, runnable examples, and questions instead of invented details.Writing · 326 tokens
- Translator that keeps your glossary and codeLocalises UI strings and docs: follows your glossary, preserves placeholders, code and markup, and flags anything ambiguous.Writing · 337 tokens
Steps
How to use the system prompt library
- Search or filter the library for the job your assistant does.
- Open a prompt and read the design notes, so you know which parts matter for your case.
- Replace the {{variables}} with your values, or open it in the prompt builder to fill them and get the exact API request.
- Check the failure modes against your own test messages before you ship it.
- Price it at your traffic with the prompt caching calculator.
Method
How it works
A system prompt is the part of an AI feature you write once and send every time. It sets the assistant’s role, what it may and may not do, and the shape of its answers, while the user’s message changes with each request. The prompts in this library were written for this site, not copied from any product, and each comes with notes on why it is built the way it is.
What the prompts have in common
Most share a structure that follows the providers’ own guidance. A one-sentence role comes first; Anthropic’s guide says even a single sentence of role focuses the model’s behaviour. Next comes the goal and the reason behind it, because explaining why a rule exists helps the model apply it to cases you didn’t list. Rules are concrete and observable (“escalate after two unsuccessful answers”, not “escalate when appropriate”), which is Google’s advice to give clear, specific instructions and constraints. The output format is shown rather than described. OpenAI suggests the same order for a developer message: identity, instructions, examples, context.
Two habits run through every prompt. They give the model an honest way out (“say the documents don’t cover it”, “write owner unclear”), which Anthropic lists first among ways to reduce hallucinations. And they treat anything the model reads, whether documents, tickets, emails or logs, as data rather than instructions.
Variables are per deployment, not per request
Placeholders such as {{company}} are filled once when you set the assistant up. Anything that changes per request, such as the user’s name, today’s date or retrieved documents, belongs in the user turn. That keeps the system prompt byte-for-byte identical across requests, which is what prompt caching needs: Anthropic’s cache only hits on a 100% identical prefix, and OpenAI recommends putting repeated content at the start of the prompt.
What a system prompt costs
The prompts here run from 258 to 522 tokens, 337 in the middle, counted with OpenAI’s o200k_base tokenizer. Sent with 10,000 requests a day, even a short prompt adds up, so each page prices it for a month on current models, with and without caching. Caching only applies above a minimum length: 512 tokens on Claude Sonnet 5.5, 512 tokens on Claude Haiku 5.5, 1,024 tokens on GPT-6.1 Sol and 4,096 tokens on Gemini 3.8 Flash. Below that, the prompt is billed in full every time; together with tool definitions, which sit in front of it in the cached prefix, it may cross the line.
Where it goes in each API
The text stays the same across providers; the field it goes in doesn’t.
| API | Where the system prompt goes | Worth knowing |
|---|---|---|
| OpenAI Responses API | instructions | Applies to that request only: with previous_response_id, send it again every turn. |
| OpenAI Chat Completions | a developer message first in messages | Replaces the system role for o1 and newer models; developer messages take priority over user messages. |
| Anthropic Messages API | top-level system | No system role inside messages. Pass it as a text block with cache_control to cache it. |
| Gemini generateContent | systemInstruction | Text only. Still supported; Google recommends the Interactions API for new work. |
| Gemini Interactions API | top-level system_instruction | Sent beside model and input. Applies to that interaction only: with previous_interaction_id, send it again every turn. |
# The same system prompt in each API (Python SDKs).
SYSTEM_PROMPT = open("support-agent.txt").read() # fixed per deployment
# OpenAI Responses API
openai_client.responses.create(model=MODEL, instructions=SYSTEM_PROMPT, input=user_message)
# Anthropic Messages API (cached once it passes the model's minimum length)
anthropic_client.messages.create(
model=MODEL, max_tokens=1024,
system=[{"type": "text", "text": SYSTEM_PROMPT, "cache_control": {"type": "ephemeral"}}],
messages=[{"role": "user", "content": user_message}],
)
# Gemini generateContent (google-genai SDK)
genai_client.models.generate_content(
model=MODEL, contents=user_message,
config=types.GenerateContentConfig(system_instruction=SYSTEM_PROMPT),
)Every claim in the design notes was checked against the providers’ documentation on 2026-10-14. For a prompt you are writing from scratch, the prompt builder lays out the sections and shows the exact request; for one you are changing, the prompt diff shows what changed and what it costs.
Examples
Worked examples
FAQ
Frequently asked questions
What is a system prompt?
A system prompt is the set of standing instructions a developer sends with every request: the assistant’s role, its rules, the tools it may use and the format of its answers. It is kept apart from what the user types, and the model gives it more weight. Each API has its own field for it: instructions or a developer message at OpenAI, system at Anthropic and systemInstruction at Gemini. The glossary entry has more.
Are these real system prompts from ChatGPT, Claude or other products?
No. Every prompt here was written for this site and is free to copy and adapt. We don’t publish leaked or reconstructed system prompts from commercial products: they may be inaccurate, they belong to someone else, and they’re written for a different product than yours. The design notes explain the reasoning instead, so you can write your own.
How long should a system prompt be?
As long as the job needs and no longer. The prompts here run from 258 to 522 tokens. Every token is billed on every request, and rules that rarely matter compete with the ones that do. Put reference material in retrieval or tools instead of the prompt, and measure what’s left with the token counter.
Should I write system prompts with XML tags or Markdown?
Either works if you use it consistently. Anthropic recommends XML tags to separate instructions, context and examples, and OpenAI says Markdown headings and lists help mark sections while XML tags mark where a document starts and ends. Most prompts here use XML tags; the voice assistant uses Markdown headings, partly because Anthropic notes the prompt’s style can influence the reply’s style.
Can a system prompt stop prompt injection or jailbreaks?
It can make them less likely, not impossible. Users can ask the model to ignore its rules, and documents, emails or tool results can carry instructions of their own. Treat the system prompt as guidance and put the real controls in code: limited permissions, output validation, and human approval before actions that can’t be undone.
Does prompt caching make a long system prompt free?
Cheaper, not free, and only above a minimum length. Cached reads cost a fraction of the input price, but a prompt shorter than the provider’s minimum isn’t cached at all, and the cache only holds while requests keep arriving. Anything that changes per request, such as the date or the user’s name, should go after the fixed part. The prompt caching calculator works it out for your traffic.
Where do the token counts come from?
Each prompt was counted with OpenAI o200k_base (gpt-tokenizer 4.0.0), with its variables left as placeholders, and a test recounts them on every build. That is the exact count for GPT-5-family models. Claude’s and Gemini’s tokenizers aren’t public, so for them the count is an estimate and the real number may differ.
Related
Related tools
- Prompt BuilderBuild prompts with variables and a live token count.
- Prompt DiffCompare two prompt versions side by side.
- AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.
- Prompt Caching CalculatorEstimate savings from prompt caching.
- LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.
- CLAUDE.md GeneratorGenerate a CLAUDE.md and AGENTS.md for your project.