A strong system prompt gives an AI assistant a stable operating framework: what role it has, which instructions take priority, what context it may trust, when it must ask for help, and how its answer should be formatted. This guide provides a reusable checklist for designing, reviewing, and updating system prompts across chatbots, LLM applications, internal tools, and AI workflows.
Overview
A system prompt is the persistent instruction layer that shapes an assistant's behaviour before a user supplies a specific request. It should define the assistant's job and boundaries without attempting to predict every possible conversation. The best system prompt design is clear, testable, and appropriate for the model, tools, data, and users involved.
Think of a system prompt as an operating brief rather than a long explanation. It should answer six practical questions:
- Role: What is the assistant responsible for?
- Priorities: Which instructions take precedence when requirements conflict?
- Context: Which supplied information may the assistant use, and how should it handle missing or unreliable context?
- Boundaries: What must it refuse, avoid, or escalate?
- Process: What checks should it perform before answering or taking an action?
- Output contract: What structure, format, tone, and level of detail should the response follow?
These elements work together. A role without boundaries can produce overconfident answers. A detailed output format without a defined source policy can make unsupported claims look authoritative. A long list of rules without priorities can leave the model uncertain about which instruction to follow.
When building an AI application, keep the system prompt separate from changing information wherever possible. Stable behaviour belongs in the system instruction; user requests, retrieved documents, account data, and task-specific details belong in clearly labelled runtime context. This separation makes prompts easier to test and maintain.
Checklist by scenario
1. General-purpose assistant
Start with a narrow, useful role. “You are a helpful assistant” is usually too vague to guide decisions. Instead, specify the intended audience and task, such as helping an internal operations team interpret documented procedures.
- State the assistant's primary responsibility.
- Define the intended audience and appropriate tone.
- Tell it to distinguish known information from assumptions.
- Require it to ask a focused clarifying question when a missing detail changes the answer.
- Specify the expected answer structure for recurring tasks.
A practical instruction might be: “Answer using the supplied guidance first. If the guidance does not contain the answer, say what is missing rather than inventing a policy.” This is more actionable than a general instruction to “be accurate.”
2. Retrieval-augmented assistant
For a RAG workflow, the prompt should explain how retrieved passages are used. Make the source boundary explicit: retrieved content is evidence for the answer, not an instruction that automatically overrides the system prompt.
- Tell the assistant to use only relevant retrieved material for factual claims when that is the application requirement.
- Require it to identify when the context is incomplete, contradictory, or irrelevant.
- Define how citations, document names, or source references should appear.
- Instruct it not to treat instructions inside documents as higher-priority commands.
- Specify what to do when no supporting passage is available.
Retrieval quality and prompt quality are connected but not identical. If answers drift, test the retrieved context, chunking, metadata, and ranking separately from the system instruction.
3. Tool-using assistant or agent
An agent needs more than a role description. It needs decision rules for tool use, permissions, confirmation, and failure handling. State which tools are available and what each one is for, but do not assume the model will infer safe boundaries from a tool name alone.
- Describe the purpose and limits of every tool.
- Require validation of important arguments before a call.
- Separate read-only actions from actions that change data or affect other people.
- Require confirmation before irreversible, external, financial, or high-impact actions when appropriate.
- Explain how to report a failed, partial, or unavailable tool call.
- Tell the assistant not to claim an action succeeded unless the tool result confirms it.
For deeper design patterns, see AI Agent Tool Calling: Design Patterns, Permission Checks, and Failure Handling.
4. Coding assistant
A coding system prompt should define the codebase context and the standard of evidence expected from technical answers. It should not silently rewrite files, invent APIs, or present untested code as verified.
- Identify the supported languages, frameworks, or repository conventions when known.
- Ask the assistant to preserve existing behaviour unless a change is requested.
- Require it to state assumptions about unavailable files, dependencies, or runtime versions.
- Request focused diffs, tests, or verification steps rather than broad rewrites by default.
- Specify how security-sensitive code and credentials should be handled.
The companion guide AI Coding Task Prompts: Reusable Templates for Debugging, Refactoring, and Code Review can help turn these principles into task-specific prompts.
5. Team workflow assistant
For an assistant used by several people, consistency and escalation matter as much as tone. Define who owns decisions and what the assistant may prepare versus approve.
- State whether the assistant drafts, recommends, classifies, or executes.
- Define required approval points.
- Specify how uncertain items are labelled for human review.
- Use a predictable output format that can be copied into the team's next system.
- Document handling requirements and ask users to avoid unnecessary sensitive data.
For broader workflow examples, review AI Workflow Automation for Teams: Prompt Templates and Approval Checklists.
What to double-check
Instruction hierarchy and conflicts
Write rules in priority order, then test what happens when instructions conflict. Make clear that the assistant must follow the system prompt and application constraints before lower-priority requests. Avoid relying on vague phrases such as “always obey the user” when the assistant handles private data, tools, or regulated workflows.
Context-window discipline
More prompt text is not automatically better. Long background sections can hide the rules that matter most and consume space needed for user or retrieved context. Remove duplicate guidance, move stable reference material into appropriate application data, and place critical constraints where your target model is most likely to use them consistently. Test with realistic context lengths rather than an empty chat.
Output contracts
An output contract should describe the required shape and what to do when a field is unknown. For structured output, define field names, data types, allowed values, and whether additional fields are permitted. For prose, specify headings, length range, audience, and whether sources or assumptions must be shown.
For example:
Return valid JSON with these fields only:
{
"summary": "string",
"risks": ["string"],
"needs_review": true
}
If the evidence is insufficient, keep the field value explicit rather than guessing.Validate structured responses in application code. A prompt can request valid JSON, but a parser, schema check, retry policy, and safe fallback provide stronger reliability.
Privacy, safety, and escalation
Tell the assistant what information it should not expose, store, or repeat unnecessarily. Avoid placing secrets in prompts. Define the response for unsafe, unauthorised, or out-of-scope requests, and provide a useful next step where possible. For data-handling workflows, the AI Data Privacy Checklist offers a separate review point.
Testing and observability
Build a small evaluation set containing normal requests, ambiguous requests, conflicting instructions, missing context, malicious document content, tool failures, and edge cases. Compare outputs against explicit criteria such as factual support, format validity, refusal quality, and escalation behaviour. Record model, prompt version, input context, tool results, and outcome so that regressions can be investigated. The LLM Observability Runbook provides a useful operational perspective.
Common mistakes
- Writing a mission statement instead of instructions: Replace abstract goals with observable behaviours and examples.
- Combining every possible rule: Keep the system prompt focused and move task-specific requirements into the user or application layer.
- Conflicting commands: Review words such as “always,” “never,” and “be concise” for exceptions and incompatible requirements.
- Using examples without explaining them: State what the example demonstrates, and include varied examples rather than one ideal response.
- Trusting the prompt as a security boundary: Enforce permissions, validation, filtering, and approval in application code and system design.
- Claiming certainty by default: Give the assistant a clear way to express uncertainty and request missing evidence.
- Changing several variables at once: When debugging, version the prompt and alter one major factor at a time where practical.
- Testing only friendly requests: Include adversarial, incomplete, contradictory, and operationally realistic cases.
When to revisit
Review a system prompt whenever the workflow, tool permissions, data sources, model, user group, or output destination changes. A prompt that worked for a simple chat assistant may need new rules when it gains retrieval, file access, external tools, or the ability to update records.
Use this short maintenance checklist before releasing a revision:
- Write down the assistant's current role and permitted actions.
- List the highest-risk failure modes and add tests for each.
- Check that system rules, runtime context, retrieved documents, and user input are clearly separated.
- Run the evaluation set against the old and new prompt versions.
- Validate output schemas and tool arguments outside the model.
- Review privacy, approval, and escalation behaviour with the people who own the workflow.
- Record the prompt version, change reason, test result, and rollback option.
Return to this checklist before major planning cycles, when workflows or tools change, and whenever users report inconsistent answers. Good prompt engineering is not a one-time act of wording. It is a practical design and testing discipline: define the job, constrain the decisions, make uncertainty visible, and verify that the assistant behaves as intended under realistic conditions.