Skip to main content
The system prompt guides the model’s behavior throughout its interactions with users. It shapes how the model interprets and responds to queries, influencing its tone, actions, and output.

System prompts vs. user prompts

System prompts and user prompts serve different purposes in shaping model behavior. System prompts establish persistent instructions that guide the model across all interactions—defining its role, tone, and boundaries. User prompts are individual queries or tasks submitted during a conversation. Use system prompts to set foundational behavior that should remain consistent. Use user prompts for specific, one-time requests. When both are well-crafted, they work together to produce accurate, relevant responses.

The CARE framework

When crafting a system prompt, use the CARE framework to ensure you’ve covered the essential components: Not every prompt requires all four components, but reviewing each helps identify gaps that could lead to unclear or unhelpful responses.

System prompt best practices

The following practices help you write system prompts that produce consistent, useful responses.

Iterative refinement

Effective system prompts rarely emerge fully formed. Start with a basic prompt that covers your core requirements, then test it against realistic scenarios. Refine based on the results. When your prompt produces unexpected results, use the following guidance to identify and address the problem: Small, targeted adjustments typically yield better results than rewriting prompts from scratch.

Documenting your prompts

As you develop effective system prompts, consider documenting them for reuse and sharing. A consistent format makes prompts easier to maintain and adapt.
PROMPT NAME: [Descriptive name for the prompt]
PURPOSE: [Scenario or use case this prompt addresses]
PROMPT TEXT:
[The full system prompt]

NOTES:
- [Tips for best results]
- [Known limitations or edge cases]

LAST UPDATED: [Date]

Examples

The following system prompt is for a data analyst with access to a database query tool and a Jupyter notebook tool. It demonstrates the tool usage guidance described in the best practices above.
You are a data analyst who helps users explore and understand their data.

When answering questions about data, first use the database query tool. Write clear SQL queries and prefer existing views and tables over ad-hoc joins.

When a question needs custom logic, such as statistical analysis, modeling, or custom visualizations, move the work into a Jupyter notebook. Create or open a notebook, run cells incrementally, and explain each step.

Always:
- State which tool you are using and why.
- Show the query or notebook cell you executed.
- Summarize findings in plain language and call out caveats.
- Ask one clarifying question when the request is ambiguous before running anything.
This prompt tells the model which tool to use for which type of question, establishes a preferred order (database queries first, notebooks for deeper analysis), and sets expectations for how to present results.
The following system prompt incorporates the best practices outlined above for a model without tools.
You are a coding assistant that helps users write, debug, and optimize Python code.

**Role:** Provide clear, step-by-step explanations and working code examples. Follow Python best practices and prioritize efficient solutions.

**Tone:** Professional and supportive. Avoid jargon unless necessary, and define technical terms when you use them.

**Format:** Structure responses as follows when troubleshooting errors:
- **Issue:** [What went wrong]
- **Explanation:** [Why it happened]
- **Solution:** [How to fix it, with code if applicable]

**Boundaries:** Do not provide or reference sensitive information such as API keys, passwords, or user data. Do not offer advice outside Python development.

**Ambiguity:** If the user's input is unclear, ask one or two clarifying questions before proceeding.