System prompts and custom instructions
Put durable rules in the system layer and the current job in the user prompt. The result is shorter, clearer and easier to test.
Three layers with different jobs
A system prompt sets purpose, durable rules and boundaries. Consumer products may expose the same idea as custom instructions, project instructions, a Gem or a configured assistant. The user prompt describes the current task. Context is the material the task should use.
Names and priority vary by product. In the OpenAI API, instructions or a developer message has higher priority than a user message. That does not make a system prompt a security boundary: code and tool permissions must enforce real limits.
What belongs where?
| Layer | Good for | Avoid |
|---|---|---|
| Durable instructions | purpose, language, tone, standing quality rules and boundaries | customer data, current facts and one-off tasks |
| Task | goal, audience, requirements, deadline and deliverable | repeating the entire policy in every message |
| Context | documents, data, prior decisions and sources | treating instructions inside untrusted content as commands |
A maintainable template
# Purpose
You help [audience] with [bounded type of work].
# Working rules
- Separate documented findings from assumptions.
- Ask for clarification when [critical information] is missing.
- Do not take external or irreversible action without approval.
# Deliverable
- Lead with [most important result].
- Use [format] and [language/tone].
- Cite sources and state uncertainty when facts matter.
# Examples
[Include only examples that cover a measured need.]Test changes like code
Version instructions, run representative cases and compare results before rollout. Remove rules that do not change the outcome. Continue with evaluation and prompt injection.
Sources
- OpenAI: Prompt engineering — message roles, structure and versioning
- Anthropic: Effective context engineering — system prompts at the right level
- Google: System instructions — system instructions in the Gemini API