The Complete Guide to Writing Great Prompts
A practical, research-backed guide to writing prompts that work: structure, clarity, examples, reasoning, output formats, chaining, grounding, evaluation, safety, and worked before-and-after examples.
On this page
- 1. What a prompt is (and is not)
- 2. The anatomy of a strong prompt
- Try these prompts: building blocks
- 3. Clarity and specificity
- Try these prompts: clarity and constraints
- 4. Delimiters and structure
- Where to put things in a long prompt
- Try these prompts: long documents and structure
- 5. Step-by-step prompting, reasoning, and when not to use it
- Try these prompts: reasoning and decomposition
- 6. System messages versus user messages
- Try these prompts: system prompts and custom instructions
- 7. Examples: zero-shot, one-shot, few-shot
- Try these prompts: examples and style matching
- 8. Controlling the output: tables, JSON, Markdown, length
- Try these prompts: output formats
- 9. Iteration and refinement loops
- Try these prompts: iteration and critique
- 10. Prompt chaining and decomposition
- Try these prompts: chaining and workflows
- 11. Grounding: using sources you paste, and handling uncertainty
- Try these prompts: grounding and uncertainty
- 12. Evaluating prompts: rubrics, test sets, and regression checks
- Try these prompts: evaluation
- 13. A map of prompt patterns
- Try these prompts: patterns by task
- 14. Model differences: why one prompt does not fit all
- 15. Safety, privacy, and trust
- Try these prompts: safety and governance
- 16. Templates and worked before/after examples
- Template 1: general-purpose
- Template 2: analyse a document
- Template 3: interview first
- Before and after 1: a vague request
- Before and after 2: a messy analysis request
- Before and after 3: a risky factual request
- Try these prompts: general templates
- 17. Common mistakes
- 18. Checklist before you press send
- 19. Quick-start cheat sheet
- 20. Glossary
- Where to go next
- Sources
TL;DR
- A good prompt tells the model who it is working for, what to do, what to use, what limits apply, what the answer should look like, and how you will judge it.
- Be specific, put the task first, separate instructions from pasted material, show one or two examples, and say what to do when the answer is not in the material.
- Treat the first answer as a draft. Iterate: change one thing, compare, keep what works.
- Ask for step-by-step reasoning on non-reasoning models when a task is multi-step. Do not bolt it onto reasoning models; check your model's own documentation.
- For anything important, ground the answer in text you provide, ask for quotes or citations, and verify the result yourself.
- Never paste passwords, keys, or other people's private data into a prompt you would not want stored.
Last checked against the sources below on 2026-10-17. Model behaviour changes quickly, so treat model-specific advice as "as of" that date.
1. What a prompt is (and is not) #
A prompt is everything you give a model before it answers: your instruction, any pasted text, examples, rules, and in chat tools the earlier conversation. Language models work by producing the most plausible continuation of what they are given. Microsoft's documentation makes this point directly: the model is not running a separate question-answering routine, it is continuing text in a way that fits the input, and a question tends to be followed by an answer simply because that is what usually follows [14].
Three consequences matter for everyday writing:
- The model cannot see what is in your head. Anything you leave out, it fills with a typical guess. Vague in, generic out.
- Wording, order and format all steer the result. Small changes can change answers, and what works on one model may not on another [14][24].
- A prompt is a draft of a specification. Anthropic's guidance starts from the idea that you should know what success looks like and have a way to test it before you tune wording [1].
A useful mental picture from Anthropic: treat the model like a capable new colleague who knows nothing about your situation. If a person with no background would be confused by your message, the model probably will be too [2].
Prompt versus other things people confuse it with
| Term | What it is | Typical use |
|---|---|---|
| Prompt | The input you send for one task | Chat and API calls |
| System / developer message | Standing rules set by the app builder or by you in settings | Persona, boundaries, format |
| Custom instructions | Standing preferences saved in a chat product | Tone, audience, defaults |
| Prompt template | A prompt with blanks to fill in | Repeated tasks |
| Agent instructions | A prompt plus tools and a loop | Multi-step work (see the Agents guide) |
2. The anatomy of a strong prompt #
Vendors describe the same building blocks under different names. Microsoft lists instructions, primary content, examples, cues, and supporting content [14]. Microsoft Copilot's own guidance uses goal, context, source, and expectations, and says only the goal is required [15]. OpenAI suggests an order of identity, instructions, examples, then context [8]. Combining these gives seven parts you can use as a checklist:
| Part | Question it answers | Example |
|---|---|---|
| Role / audience | Who is this for, and from whose viewpoint? | "I run a three-person bakery. Write for busy local customers." |
| Context | What background changes the answer? | "We raised prices 8 percent in March." |
| Task | What exactly should be done? | "Draft a short email explaining the change." |
| Constraints | What limits apply? | "Under 120 words, no apology, no discount offer." |
| Format | What shape should the output take? | "Subject line, then two short paragraphs." |
| Examples | What does good look like? | One past email you liked, in a labelled block |
| Success criteria | How will you judge it? | "A customer should know the new price and the date in 10 seconds." |
You do not need every part every time. A quick question may need only a task. A reusable workplace prompt usually benefits from all seven.
ROLE AND AUDIENCE
I run a three-person bakery. The reader is a regular customer.
CONTEXT
Prices rise 8 percent on 1 April because of flour costs.
TASK
Write a customer email announcing the change.
CONSTRAINTS
Under 120 words. Plain, warm tone. Do not apologise or offer discounts.
FORMAT
A subject line, then two short paragraphs.
SUCCESS CRITERIA
A reader knows what changes, when, and why after one read.The role line deserves a note. Role prompts such as "you are a tax accountant" can help set tone and focus, but current guidance from Anthropic says heavy role-play is less necessary than clear context about the task and audience [3]. Prefer "who is the reader and what do they need" over a grand job title.
Try these prompts: building blocks #
create-ai-prompt-writing-0001: Vague Request to Strong Prompt Rewritecreate-ai-prompt-writing-0002: Make the AI Ask Questions Firstcreate-ai-prompt-writing-0003: Role Context Task Format Prompt Buildercreate-ai-prompt-writing-0006: Output Format Specification Writercreate-ai-prompt-writing-0007: Constraint Writer for Length Tone and Banned Phrasescreate-ai-prompt-writing-0008: When to Use a Role in a Prompt Decision Treecreate-ai-prompt-writing-0017: Negative Instructions to Positive Instructions Rewritecreate-ai-custom-instructions-assistants-0011: Reusable Prompt Template System With Variablescreate-ai-custom-instructions-assistants-0001: Custom Instructions for a Writing Assistantcreate-ai-prompt-patterns-by-task-0011: Constraint-Led Writing: Word Caps and Format Rules
3. Clarity and specificity #
Almost every vendor guide opens with the same advice: say exactly what you want [2][3][8][13][14]. Practical ways to do it:
- Name the deliverable. "A one-page brief" beats "help with the project."
- State the purpose. Explaining why a rule exists lets the model apply it sensibly. Anthropic's example: a text-to-speech app should avoid ellipses because the engine cannot pronounce them, which generalises better than a bare "never use ellipses" [2].
- Say what to do, not only what to avoid. Positive instructions tend to be easier to follow than lists of prohibitions [3].
- Give numbers. Length, count of options, reading level, deadline.
- Define loose words. "Professional," "short," "simple" mean different things to different people. Replace them with an example or a measure.
- Order the steps with a numbered list when sequence matters [2].
- Do not shout. Capital letters and threats can make some models rigid and over-literal [10].
| Vague | Specific |
|---|---|
| "Summarise this." | "Summarise this meeting transcript in 5 bullets for a manager who missed it. Put decisions first, then open questions." |
| "Make it better." | "Edit for clarity: cut 20 percent of the words, keep my numbers, keep the first-person voice." |
| "Ideas for a talk." | "Give 8 titles for a 20-minute talk to school governors on data privacy, each under 10 words, mixing practical and provocative." |
Try these prompts: clarity and constraints #
create-ai-prompt-writing-0001: Vague Request to Strong Prompt Rewritecreate-ai-prompt-writing-0007: Constraint Writer for Length Tone and Banned Phrasescreate-ai-prompt-writing-0009: Summarization Prompt With Audience and Length Controlcreate-ai-prompt-writing-0017: Negative Instructions to Positive Instructions Rewritecreate-ai-prompt-patterns-by-task-0001: Plain-Language Rewrite With a Banned-Phrase Listcreate-ai-prompt-patterns-by-task-0004: Turn Rough Notes Into a Clean Draft Without Adding Factscreate-ai-prompt-patterns-by-task-0011: Constraint-Led Writing: Word Caps and Format Rulescreate-ai-prompt-patterns-by-task-0012: Critique My Draft Without Flatterycreate-ai-prompt-patterns-by-task-0002: ELI5 Explainer With a Check Questioncreate-ai-prompt-patterns-by-task-0005: Jargonize and De-Jargonize Pair
4. Delimiters and structure #
When a prompt mixes instructions with pasted material, mark where each begins and ends. Microsoft recommends clear syntax such as separators and headings, and notes that models have seen a lot of Markdown and XML [14]. OpenAI advises Markdown headings and lists for sections and XML-style tags to wrap supplied data [8]. Google's Gemini guidance says to pick consistent delimiters and stick to one style [13].
Summarise the email thread below for a busy manager.
<thread>
...pasted emails...
</thread>
Return: 3 bullets of what happened, 1 line on what I must decide.Rules of thumb:
- Use one delimiter style per prompt.
- Label each pasted block (
<contract>,<notes>,<style_sample>). - Wrap examples separately from data so the model does not mistake them for the input.
- With multiple documents, give each a name or number so you can ask for references later.
Where to put things in a long prompt #
For long inputs, order matters. Anthropic recommends putting long documents first and your question or instructions at the end, reporting better results in its tests [2]. Google's Gemini 3 guidance says the same thing: supply all the context first, then the question [13]. OpenAI's older GPT-4.1 guide suggests repeating key instructions before and after long material, and putting them above if you can only do one [10]. Research on long inputs found that models use information at the start and end more reliably than the middle [19], and Microsoft notes recency bias, where text near the end can weigh more [14]. Practical takeaway: keep critical instructions near an edge, and repeat a one-line reminder at the end of long prompts.
Try these prompts: long documents and structure #
create-ai-prompt-writing-0018: Long Document Prompt Layoutcreate-ai-prompt-writing-0010: Information Extraction From Messy Text Promptcreate-ai-prompt-writing-0009: Summarization Prompt With Audience and Length Controlcreate-ai-prompt-writing-0006: Output Format Specification Writercreate-ai-prompt-patterns-by-task-0003: TL;DR Summary With Key Decisions and Open Questionscreate-ai-prompt-patterns-by-task-0004: Turn Rough Notes Into a Clean Draft Without Adding Factscreate-ai-prompt-testing-improvement-0009: Prompt Compression Before and Aftercreate-ai-custom-instructions-assistants-0004: Knowledge Base Answer-Only-From-Sources Instructions
5. Step-by-step prompting, reasoning, and when not to use it #
What the research found. In 2022, Google researchers showed that giving worked examples with intermediate steps ("chain-of-thought") improved large models on arithmetic and reasoning tasks [16]. Another team found that even a plain "think step by step" cue helped without any examples [18]. Follow-up ideas include sampling several reasoning paths and keeping the most common answer [17], and splitting a hard problem into easier sub-questions answered in order [22].
Why it matters less now. Many current models do their own reasoning before replying. OpenAI's reasoning guide advises keeping prompts short and not asking for step-by-step explanations, because the model reasons internally and the request can add nothing or even hurt [9]. Microsoft's page likewise warns that its step-by-step techniques are not recommended for reasoning models [14]. For non-reasoning models, OpenAI says step-by-step prompting can still improve results at the cost of more words and delay [10].
| Situation | Use step-by-step wording? | Better move |
|---|---|---|
| Multi-step arithmetic or logic on a standard chat model | Yes | "Work through this in numbered steps, then give the final answer on its own line." |
| Same task on a model that has a built-in reasoning mode | Usually no | State constraints and success criteria; turn on reasoning if the product has the option |
| Simple lookup, rewrite, or classification | No | Direct instruction; extra reasoning wastes time |
| You need to audit the logic | Yes | Ask for the assumptions and checks, not a stream of thoughts |
| Hard task, wrong answers keep appearing | Maybe | Decompose into sub-steps or chain prompts (section 10) |
Two cautions. First, written reasoning can sound confident and still be wrong [24]. Second, some providers do not want users extracting hidden reasoning by prompt tricks; Microsoft's page says to use the supported reasoning-summary option instead [14]. Ask for justification of the answer (evidence, assumptions, checks), which is useful to you either way.
Task: decide which of the three suppliers is cheapest over 2 years.
Steps: (1) list each supplier's yearly cost, (2) add setup fees,
(3) total for 24 months, (4) state the cheapest and the margin.
Show the arithmetic in a table, then the answer in one sentence.Try these prompts: reasoning and decomposition #
create-ai-prompt-patterns-by-task-0007: Step-by-Step Reasoning Request With Visible Checkscreate-ai-prompt-writing-0005: Prompt Chain Planner for Complex Taskscreate-ai-prompt-writing-0013: Analysis Prompt That Requires Evidencecreate-ai-prompt-writing-0016: Prompts That Cite Sources and Admit Uncertaintycreate-ai-prompt-testing-improvement-0008: Consistency Check Across Repeated Runscreate-ai-prompt-patterns-by-task-0012: Critique My Draft Without Flatterycreate-ai-workflow-design-0002: Choose Between a Script, a No-Code Flow and an AI Agentcreate-ai-agent-prompts-tools-0007: Planner and Executor Prompt Paircreate-ai-agent-prompts-tools-0019: Planner and Executor Prompts for a Multi-Step Task
6. System messages versus user messages #
In an API or a configurable assistant, instructions are split into layers. OpenAI describes developer messages as the application's rules and user messages as the inputs, a bit like a function definition and its arguments, and says developer messages take priority [8]. Microsoft describes the system message as the place for persona and rules, with few-shot examples added as example user and assistant turns [14].
In everyday chat tools the same idea appears as custom instructions, projects, or assistants. Put things there that stay true across tasks and keep the task-specific part in the message.
| Put in the standing instructions | Put in each message |
|---|---|
| Who you are and who you write for | The specific task |
| Tone, reading level, spelling variant | The pasted material |
| Things never to do (privacy, tone) | The deadline and length for this piece |
| Default output format | Any one-off example |
Keep standing instructions short and test them; contradictory standing rules are a common cause of strange answers. Anthropic suggests moving persistent guidance into configuration files or skills rather than repeating it in every prompt [3].
Try these prompts: system prompts and custom instructions #
create-ai-custom-instructions-assistants-0001: Custom Instructions for a Writing Assistantcreate-ai-custom-instructions-assistants-0002: Customer Support Assistant System Prompt With Guardrailscreate-ai-custom-instructions-assistants-0003: Assistant Persona Guide and Boundariescreate-ai-custom-instructions-assistants-0004: Knowledge Base Answer-Only-From-Sources Instructionscreate-ai-custom-instructions-assistants-0009: Escalation and Refusal Rules for an Assistantcreate-ai-custom-instructions-assistants-0012: Company AI Output Style Guidecreate-ai-custom-instructions-assistants-0013: Assistant Memory and Privacy Rulescreate-ai-agent-prompts-tools-0001: System Prompt for a Single-Purpose Assistantcreate-ai-agent-prompts-tools-0023: Persona and Boundary Prompt for a Customer-Facing Assistantcreate-ai-custom-instructions-assistants-0005: Socratic Tutor Assistant Instructions
7. Examples: zero-shot, one-shot, few-shot #
A prompt with no examples is zero-shot. Adding one or more input-and-output pairs is one-shot or few-shot. The examples do not retrain the model; they condition the current response [14]. Anthropic calls examples one of the most reliable ways to steer format, tone, and structure and recommends relevant, varied, clearly labelled ones, with three to five for best results on harder cases [2]. Google adds two cautions: keep formatting consistent across examples, and avoid so many that the model copies them too closely [13]. Research on prompting also finds that which examples you choose and their order can swing results [24].
Design rules
- Use real or realistic examples of your task.
- Make them different from each other (short and long, easy and awkward) so the model does not learn a quirk.
- Show the exact output format you want, including punctuation.
- Label them, and mark where your real input starts.
- Include one edge case, such as "not enough information," if that is a legal answer.
- If outputs come back too similar to the examples, change or remove one.
Classify each support message as BILLING, BUG, or OTHER. Reply with the label only.
<example>
Message: "I was charged twice in May."
Label: BILLING
</example>
<example>
Message: "The export button does nothing on Safari."
Label: BUG
</example>
<example>
Message: "Do you have a student discount?"
Label: OTHER
</example>
Message: "{{message}}"
Label:For reasoning models, OpenAI suggests trying without examples first and adding a few only if needed [9].
Try these prompts: examples and style matching #
create-ai-prompt-writing-0004: Few-Shot Example Designer for a Classification Taskcreate-ai-prompt-writing-0011: Rewrite in a Target Voice With Examples Promptcreate-ai-prompt-patterns-by-task-0010: Few-Shot Style Matching From My Samplescreate-ai-prompt-patterns-by-task-0004: Turn Rough Notes Into a Clean Draft Without Adding Factscreate-ai-prompt-patterns-by-task-0001: Plain-Language Rewrite With a Banned-Phrase Listcreate-ai-prompt-writing-0010: Information Extraction From Messy Text Promptcreate-ai-prompt-testing-improvement-0002: Prompt Test Set Buildercreate-ai-evaluation-testing-0015: Golden Examples Set: Collecting and Maintaining Reference Answers
8. Controlling the output: tables, JSON, Markdown, length #
Say the format explicitly and, when machines will read the output, show the exact shape. Microsoft suggests asking for output in a defined structure and notes that tables are an efficient way to hand data to a model [14]. Google lists format, length, and structure among the main levers [13]. A short opening phrase that begins the answer in the right form (a "cue") also helps; Microsoft calls this priming the output [14].
| Format | Ask like this | Watch for |
|---|---|---|
| Bullets | "5 bullets, each under 15 words" | Fragments that lose meaning |
| Table | "Columns: option, cost, risk, next step" | Missing cells; ask to mark unknown as "n/a" |
| Markdown | "Use H2 headings and short paragraphs" | Chat apps may render differently |
| JSON | "Return valid JSON with keys a, b, c and nothing else" | Extra prose around the JSON; invented keys |
| Email / memo | "Subject line, 3 short paragraphs, sign-off" | Filler openers |
| Word count | "About 150 words" | Models approximate counts; check |
For software, prefer features that enforce structure. OpenAI's Structured Outputs constrain a reply to a JSON Schema you supply, whereas basic JSON mode only guarantees well-formed JSON, not that your keys are present [11]. In a chat window you cannot enforce a schema, so state it and validate the result.
Extract the invoice details as JSON with exactly these keys:
vendor (string), date (YYYY-MM-DD), total (number), currency (3 letters).
If a value is missing, use null. Return only the JSON.Try these prompts: output formats #
create-ai-prompt-writing-0006: Output Format Specification Writercreate-ai-prompt-writing-0010: Information Extraction From Messy Text Promptcreate-ai-prompt-writing-0009: Summarization Prompt With Audience and Length Controlcreate-ai-agent-prompts-tools-0024: Output Format Contracts: Make Agent Responses Machine-Safecreate-ai-prompt-patterns-by-task-0003: TL;DR Summary With Key Decisions and Open Questionscreate-ai-prompt-patterns-by-task-0011: Constraint-Led Writing: Word Caps and Format Rulescreate-ai-custom-instructions-assistants-0012: Company AI Output Style Guidecreate-ai-prompt-writing-0014: Code Generation Prompt With Tests
9. Iteration and refinement loops #
Every guide treats prompting as iterative [13][2]. A simple loop:
- Write a first prompt with task, context, and format.
- Run it on two or three realistic inputs, not just your favourite.
- Look for the specific gap (too long, wrong tone, missing step, invented fact).
- Change one thing and note it.
- Compare against the previous version.
- Save the version that wins, with a note about what it is good for.
Useful follow-ups in a chat:
- "Keep what you have, but cut it by a third and put the decision first."
- "Which of my instructions did you find ambiguous? Ask me about them."
- "List three weaknesses of this draft, then fix the two most serious."
The last form is a critique loop. A research paper on self-refinement found that having a model draft, critique its own output, and revise improved results by about 20 percentage points on average across tasks in its tests, with no extra training [20]. Anthropic describes the same pattern as the most common chain: draft, review against criteria, refine, with each step logged separately so you can inspect it [2]. Models still miss their own mistakes, so give the critique specific criteria rather than "make it better."
Interview-first is another good loop: "Before you answer, ask me up to five questions that would most change your answer." It surfaces missing context and reduces guessing.
Try these prompts: iteration and critique #
create-ai-prompt-writing-0002: Make the AI Ask Questions Firstcreate-ai-prompt-testing-improvement-0001: Prompt Debugging Interviewcreate-ai-prompt-testing-improvement-0003: Prompt A/B Comparison Plancreate-ai-prompt-testing-improvement-0013: Prompt Version Log and Changelog Templatecreate-ai-prompt-testing-improvement-0016: Skeptical Colleague Prompt Review Role-Playcreate-ai-prompt-patterns-by-task-0012: Critique My Draft Without Flatterycreate-ai-prompt-testing-improvement-0009: Prompt Compression Before and Aftercreate-ai-prompt-testing-improvement-0006: Prompt Regression Test Checklistcreate-ai-evaluation-testing-0016: Regression Log for Prompt Changescreate-ai-prompt-testing-improvement-0004: Rubric for Grading AI Outputs
10. Prompt chaining and decomposition #
When one prompt tries to do too much, split it. Microsoft observes that models often do better when the task is broken into smaller steps, for example first extracting claims, then generating checks [14]. Google's guide also describes chaining and parallel prompts for complex tasks [13]. Anthropic notes that explicit chaining is still useful when you want to inspect intermediate results or enforce a fixed pipeline, even though newer models handle many multi-step tasks internally [2].
A typical chain for turning a long report into a briefing:
Step 1 Extract: list every number and date in the report with its page.
Step 2 Cluster: group the facts into themes; flag anything contradictory.
Step 3 Draft: write a one-page briefing for a non-expert using only the themes.
Step 4 Check: compare the briefing to the Step 1 list; mark unsupported lines.Why chains help: each step is smaller, so errors are easier to see; you can swap a step; and you can check the output of one step before it feeds the next. The cost is time, and errors can still pass from step to step, so add a check step.
Try these prompts: chaining and workflows #
create-ai-prompt-writing-0005: Prompt Chain Planner for Complex Taskscreate-ai-workflow-design-0001: Map a Repetitive Task Into an Automation Speccreate-ai-workflow-design-0002: Choose Between a Script, a No-Code Flow and an AI Agentcreate-ai-workflow-design-0004: Meeting-to-Tasks Pipelinecreate-ai-workflow-design-0007: Content Repurposing Workflowcreate-ai-workflow-design-0008: Weekly Report Compilation Flowcreate-ai-agent-prompts-tools-0007: Planner and Executor Prompt Paircreate-ai-agent-prompts-tools-0014: Agent Handoff Note Between Two Toolscreate-ai-workflow-design-0018: Weekly Report Agent: From Raw Updates to a One-Page Summarycreate-ai-workflow-design-0023: Content Repurposing Agent: One Source, Many Formats
11. Grounding: using sources you paste, and handling uncertainty #
Models can state false things fluently. This is usually called hallucination. You cannot prompt it away completely, and Anthropic's documentation says so plainly, but several habits cut the risk [5]:
- Provide the source text and say to answer only from it. Microsoft calls this grounding and notes that the closer your source is to the form of the answer you want, the less the model has to invent [14].
- Give an exit. Tell the model what to say when the answer is not there, such as "Not in the document." Both Anthropic and Microsoft recommend giving the model an "out" [5][14].
- Quote first. For long documents, ask for relevant word-for-word quotes before the analysis, and base the analysis only on those quotes [5].
- Cite inline. Microsoft argues that citations placed beside the claim they support are a stronger guard than citations at the end, because the model must produce a source for each statement as it writes [14].
- Verify. Ask the model to find a supporting quote for each claim and remove claims with none [5]; run the question several times and treat disagreement as a warning sign [5]; and check the important facts yourself.
- Restrict outside knowledge when you need it: "Use only the attached text, not what you already know" [5].
Answer using only the text in <policy>. For each answer, give the exact sentence
you relied on in quotation marks, then your answer. If the policy does not say,
write: "The policy does not say." Do not guess.
<policy>
...paste...
</policy>
Question: Can a part-time employee carry over unused leave?Remember what grounding cannot do: it does not make the pasted source correct, and it does not stop a model from misreading it. Microsoft's own guidance reminds users to validate outputs even with a well-built prompt [14], and Microsoft Copilot's support page says to check answers against trusted sources [15].
Try these prompts: grounding and uncertainty #
create-ai-prompt-writing-0016: Prompts That Cite Sources and Admit Uncertaintycreate-ai-custom-instructions-assistants-0004: Knowledge Base Answer-Only-From-Sources Instructionscreate-ai-custom-instructions-assistants-0008: Research Assistant Instructions With Citationscreate-ai-evaluation-testing-0004: Hallucination Check for Summariescreate-ai-prompt-testing-improvement-0007: Hallucination Reduction Checklist for a Promptcreate-ai-prompt-testing-improvement-0012: Summary Faithfulness Evaluationcreate-ai-agent-prompts-tools-0003: Research Agent Instructions With Source Rulescreate-ai-agent-prompts-tools-0020: Retrieval Instructions: How an Agent Should Use Search Resultscreate-ai-prompt-writing-0013: Analysis Prompt That Requires Evidencecreate-ai-prompt-testing-improvement-0008: Consistency Check Across Repeated Runs
12. Evaluating prompts: rubrics, test sets, and regression checks #
If you reuse a prompt, test it. Anthropic and OpenAI both say to define success first, then build evaluations from realistic inputs [4][12]. Good success criteria are specific and measurable ("at least 9 of 10 summaries include the deadline"), not "good" [4].
A minimal evaluation kit
- Test set: 10 to 30 real inputs including easy, awkward and adversarial ones [12].
- Rubric: 4 to 6 criteria scored 1 to 5 (accuracy, completeness, tone, format, safety), each with a one-line description.
- Pass line: what score counts as good enough.
- Run log: prompt version, date, model, scores, notes.
- Regression check: re-run the test set whenever you change the prompt or the model [8][12].
OpenAI recommends pinning production use to specific model snapshots and using tests to catch behaviour changes [8]. Hamel Husain describes three levels of checking: cheap assertions, human review of logged outputs, and A/B tests, and stresses reading real outputs rather than relying on spot-checks [28]. If you use another model as a judge, compare it to human ratings and watch for bias toward longer answers [12].
| Method | Good for | Weak at |
|---|---|---|
| Exact-match checks | Labels, extraction, formats | Open writing |
| Rubric by a human | Quality, tone | Cost, consistency |
| Model-graded rubric | Scale | Needs calibration against humans [12] |
| Repeat-run comparison | Spotting instability [5] | Does not prove correctness |
Try these prompts: evaluation #
create-ai-evaluation-rubrics-0001: Rubric Builder for Any Written Deliverablecreate-ai-evaluation-rubrics-0002: Rubric for Chatbot Reply Qualitycreate-ai-prompt-testing-improvement-0002: Prompt Test Set Buildercreate-ai-prompt-testing-improvement-0003: Prompt A/B Comparison Plancreate-ai-prompt-testing-improvement-0004: Rubric for Grading AI Outputscreate-ai-prompt-testing-improvement-0006: Prompt Regression Test Checklistcreate-ai-prompt-testing-improvement-0013: Prompt Version Log and Changelog Templatecreate-ai-prompt-testing-improvement-0014: Adversarial Input Generator for Testingcreate-ai-evaluation-testing-0003: Regression Check Before Changing a Promptcreate-ai-evaluation-testing-0009: Compare Two Models on My Own Taskscreate-ai-evaluation-testing-0015: Golden Examples Set: Collecting and Maintaining Reference Answersaudit-ai-evaluation-0002: Prompt Change Impact Audit: Before and After Comparison
13. A map of prompt patterns #
Researchers have catalogued dozens of prompting techniques and tried to standardise the vocabulary [21]. For everyday use, a dozen patterns cover most needs.
| Pattern | What it does | Prompt skeleton |
|---|---|---|
| Instruction | Direct request | "Do X for Y in format Z." |
| Role / audience | Sets viewpoint and register | "Write as a school bursar to parents." |
| Zero-shot | No examples | Plain instruction |
| Few-shot | Shows the pattern | Two or three labelled examples, then the new input |
| Structured output | Fixed fields | "Return JSON with keys..." |
| Critique / self-review | Draft, then improve | "List 3 flaws, then fix them." |
| Interview-first | Missing context | "Ask me up to five questions before answering." |
| Decomposition | Break the task | "First list the sub-questions; then answer each." |
| Transformation | Change form, keep content | "Turn these notes into an agenda. Add no new facts." |
| Comparison | Weigh options | "Compare A, B, C on cost, risk, effort in a table." |
| Brainstorming | Generate range | "10 options, at least 3 unusual, each in one line." |
| Analysis | Find patterns, causes | "Identify the three biggest drivers; cite evidence from the data." |
| Planning | Order actions | "Build a 4-week plan with weekly goals and risks." |
| Red team / devil's advocate | Test an idea | "Argue against this plan as a sceptical finance director." |
Combine them. A strong analysis prompt is often role + structured output + evidence requirement + exit for uncertainty.
Try these prompts: patterns by task #
create-ai-prompt-patterns-by-task-0001: Plain-Language Rewrite With a Banned-Phrase Listcreate-ai-prompt-patterns-by-task-0002: ELI5 Explainer With a Check Questioncreate-ai-prompt-patterns-by-task-0003: TL;DR Summary With Key Decisions and Open Questionscreate-ai-prompt-patterns-by-task-0004: Turn Rough Notes Into a Clean Draft Without Adding Factscreate-ai-prompt-patterns-by-task-0005: Jargonize and De-Jargonize Paircreate-ai-prompt-patterns-by-task-0007: Step-by-Step Reasoning Request With Visible Checkscreate-ai-prompt-patterns-by-task-0009: Role-Play a Difficult Stakeholder for Practicecreate-ai-prompt-patterns-by-task-0010: Few-Shot Style Matching From My Samplescreate-ai-prompt-patterns-by-task-0011: Constraint-Led Writing: Word Caps and Format Rulescreate-ai-prompt-patterns-by-task-0012: Critique My Draft Without Flatterycreate-ai-prompt-writing-0012: Brainstorming Prompt With Constraintscreate-ai-prompt-writing-0013: Analysis Prompt That Requires Evidencecreate-ai-prompt-writing-0009: Summarization Prompt With Audience and Length Control
14. Model differences: why one prompt does not fit all #
Vendors say plainly that behaviour varies by model [14][24]. As of 2026-10-17, the official documents I read point to these differences:
- Reasoning versus standard models. OpenAI says reasoning models do well with high-level goals and short prompts, while smaller or non-reasoning GPT models are faster and cheaper but need more explicit instructions [8][9]. Microsoft says its older step-by-step techniques are not recommended for reasoning models [14].
- Literalness. OpenAI's GPT-4.1 guide describes a model that follows instructions literally and rewards a clear, firm sentence over repeated shouting [10]. Anthropic reports that its models respond to explicit instructions and that "go beyond" behaviour must be asked for [2].
- Structure preferences. OpenAI found Markdown a good default for structuring prompts and XML also strong, while JSON did poorly for large document sets in its tests [10]. Anthropic recommends XML-style tags for separating content types, though its newer blog notes they are often unnecessary on modern models [2][3]. Google suggests any consistent delimiter [13].
- Settings. Temperature and similar settings alter randomness. Microsoft advises changing one at a time, and Google's page says to keep temperature settings at their defaults for some Gemini 3 models [13][14]; read your model's page for the current recommendation.
- Product wrappers. A chat product may add its own hidden instructions, memory, and tools, so the same text can behave differently in the app than through an API.
Portable habit: keep a "core" prompt with task, context, constraints, format; add a small model-specific tail if tests show a need. [VERIFY] model names and features on the vendor's page on the day you read this; they change often.
15. Safety, privacy, and trust #
Do not paste secrets. Passwords, API keys, one-time codes, full card numbers, and other people's sensitive data do not belong in a prompt unless your organisation has approved the tool for that purpose. Check the product's data settings and the provider's privacy policy; settings differ by product and plan and change over time. [VERIFY] before relying on any retention claim.
Redact first. Replace names, account numbers, and addresses with placeholders such as [CLIENT_A], then restore them yourself.
Treat pasted content as untrusted. If you paste an email, web page, or file, hidden text inside it can try to give the model new instructions. This is called prompt injection. OWASP lists it as a top risk, says there is no foolproof prevention, and recommends least privilege, labelling untrusted content, validating outputs, and human approval before risky actions [26]. Simon Willison's explanation stresses that the danger rises sharply once a model can act through tools, such as sending email [27].
Verify before you rely. For legal, medical, financial, or safety decisions, use the output as a draft for a qualified person to review. NIST's AI Risk Management Framework frames this as an ongoing risk process (govern, map, measure, manage) rather than a one-time check [30].
Disclose where required. Some workplaces, publishers, and schools require you to say when AI helped. Check the rules where you work.
Try these prompts: safety and governance #
create-ai-governance-safety-0004: Data Handling Rules for Promptscreate-ai-governance-safety-0001: AI Use Policy for a Small Teamcreate-ai-governance-safety-0016: Data Handling Rules for Assistants: What Goes In, What Stays Outcreate-ai-governance-safety-0005: Model Output Disclosure Wordingcreate-ai-prompt-testing-improvement-0010: Prompt Injection Risk Reviewcreate-ai-evaluation-testing-0005: Prompt Injection Test Cases for My Assistantcreate-ai-prompt-testing-improvement-0011: Bias and Fairness Check for a Promptcreate-ai-custom-instructions-assistants-0015: Safe AI Use Training Outline for Staffcreate-ai-custom-instructions-assistants-0013: Assistant Memory and Privacy Rulesaudit-ai-safety-0001: Prompt Injection Exposure Audit for Your Own Assistant (Defensive)audit-ai-safety-0003: Human-in-the-Loop Design Audit: Where Approvals Add Safety and Where They Add Noisecreate-ai-governance-safety-0003: Human-in-the-Loop Approval Design
16. Templates and worked before/after examples #
Template 1: general-purpose #
I am [ROLE/SITUATION]. The reader is [AUDIENCE].
Background: [CONTEXT].
Task: [WHAT TO PRODUCE].
Use only: [SOURCES, or "my notes below"].
Limits: [LENGTH, TONE, THINGS TO AVOID].
Format: [STRUCTURE].
If something is missing or uncertain, say so and ask me; do not guess.Template 2: analyse a document #
<document>
[PASTE]
</document>
Task: identify the 3 main risks to [WHO] in this document.
For each risk: quote the exact sentence, explain it in one plain-English line,
and rate severity high/medium/low with a reason.
If the document does not contain enough to judge, say "insufficient evidence."Template 3: interview first #
I want to [GOAL]. Before you draft anything, ask me up to 5 questions, one at a
time, that would most improve the result. After my answers, produce the draft.Before and after 1: a vague request #
Before
Write something about our new returns policy.Problems: no audience, no length, no format, no facts.
After
I run customer service at an online shoe shop. Write a short notice for our
website explaining the new 30-day returns policy (previously 14 days; items must
be unworn; we pay return postage for faulty items only). Audience: existing
customers. Tone: friendly, plain. Length: under 120 words. Format: a headline
and two short paragraphs. Do not promise anything not listed above.Before and after 2: a messy analysis request #
Before
Look at this feedback and tell me what's wrong.After
Here are 40 customer comments from our survey (below, between <comments> tags).
Group them into themes. For each theme give: a name, the number of comments, two
short example quotes, and one suggested action. Put the themes in a table sorted
by number of comments. If a comment fits two themes, count it once under the main
one. Flag any comment that mentions safety.Before and after 3: a risky factual request #
Before
What does the law say about my deposit?After
I rent a flat in [REGION]. My landlord kept part of my deposit. I am not asking
for legal advice. Please list the questions I should ask a local tenant advice
service or read on my government's official tenancy page, in priority order, and
explain any terms I might not know. Say clearly where rules depend on location,
and do not state specific deadlines or amounts as facts.Try these prompts: general templates #
create-ai-prompt-writing-0001: Vague Request to Strong Prompt Rewritecreate-ai-prompt-writing-0003: Role Context Task Format Prompt Buildercreate-ai-prompt-writing-0002: Make the AI Ask Questions Firstcreate-ai-custom-instructions-assistants-0011: Reusable Prompt Template System With Variablescreate-ai-prompt-patterns-by-task-0004: Turn Rough Notes Into a Clean Draft Without Adding Factscreate-ai-prompt-writing-0013: Analysis Prompt That Requires Evidencecreate-ai-prompt-writing-0009: Summarization Prompt With Audience and Length Controlcreate-ai-prompt-writing-0012: Brainstorming Prompt With Constraintscreate-ai-prompt-writing-0014: Code Generation Prompt With Testscreate-ai-prompt-writing-0015: Image Prompt Builder With Structure
17. Common mistakes #
| Mistake | Why it hurts | Fix |
|---|---|---|
| Asking for "something good" | No standard to aim at | State audience, purpose, format, success test |
| Packing five tasks into one prompt | Quality drops; hard to debug | Chain or number the tasks |
| Mixing data and instructions without markers | Model may follow text inside the data | Use labelled delimiters |
| Leaving out the "not found" path | Invites invented answers | Give an exit phrase |
| Copying a prompt that worked on another model | Behaviour differs [14][24] | Test on your own model |
| Telling the model what NOT to do only | Hard to apply | Add the positive version [3] |
| Shouting in capitals | Over-literal behaviour [10] | One clear sentence with the reason |
| Piling on every technique | Longer is not better; Anthropic advises starting simple and testing each addition [3] | Add one element at a time |
| Judging by one run | Outputs vary [15] | Run several; use a test set |
| Trusting facts and citations blindly | Fluent errors [5] | Verify against sources |
| Pasting private data | Retention and exposure risk | Redact; check settings |
| Ignoring the system layer | Standing rules conflict with your request | Review custom instructions |
18. Checklist before you press send #
- [ ] Is the task the first or last thing, and stated in one sentence?
- [ ] Have I said who the reader is and why this matters?
- [ ] Are length, tone, and format specific?
- [ ] Is pasted material fenced and labelled?
- [ ] Did I give an example if format or style matters?
- [ ] Did I say what to do when the answer is not in the material?
- [ ] Do I need sources or quotes, and did I ask for them?
- [ ] Have I removed private or secret data?
- [ ] Do I know how I will check the answer?
- [ ] If this is reusable, have I saved it with a version note and a test?
19. Quick-start cheat sheet #
1. Goal in one sentence.
2. Audience + purpose.
3. Paste material in <tags>.
4. Limits: length, tone, do/do not.
5. Format: bullets / table / JSON / email.
6. Example if style matters.
7. Exit: "If not in the text, say so."
8. Review: ask for flaws, then revise.| If you need... | Try this phrase |
|---|---|
| Fewer wrong facts | "Use only the text below. Quote the sentence you relied on." |
| Less waffle | "Maximum 100 words. Lead with the answer." |
| Better ideas | "Give 10 options, 3 unusual, one line each, then pick 2 and say why." |
| Stronger drafts | "List the 3 biggest weaknesses of this draft, then rewrite fixing them." |
| Clearer thinking | "State your assumptions first, then give the answer." |
| Missing context found | "Ask me up to 5 questions before you start." |
20. Glossary #
- Prompt: the full input the model receives for a task.
- System / developer message: standing instructions that frame later user messages.
- Zero-shot / one-shot / few-shot: prompts with no, one, or several examples.
- Chain-of-thought: prompting that elicits intermediate reasoning steps before an answer.
- Self-consistency: sampling several reasoning paths and picking the most common answer.
- Decomposition: splitting a task into smaller sub-tasks.
- Prompt chaining: running several prompts in sequence, each using the previous output.
- Delimiter: a marker (tag, heading, fence) separating parts of a prompt.
- Grounding: supplying source text so the answer rests on it.
- Hallucination: a confident output that is false or unsupported.
- Context window: the amount of text a model can consider at once.
- Token: a chunk of text (part of a word) that models count; limits are in tokens.
- Temperature: a setting that changes how varied outputs are.
- Structured output: output that follows a fixed format such as a JSON schema.
- Eval (evaluation): a repeatable test of output quality against criteria.
- Rubric: scored criteria for judging an output.
- Regression test: a re-run of old tests to check that a change did not break something.
- Prompt injection: hidden or malicious instructions in content that try to override your intent.
- Context engineering: deciding everything that enters the model's context, not just the prompt wording [6].
- Agent: a model that plans and uses tools in a loop (see the Agents guide).
Where to go next #
- Hands-on practice: Anthropic's nine-chapter interactive tutorial walks through structure, clarity, roles, separating data, formats, step-by-step reasoning, examples and hallucinations with exercises [7]. Its authors note it was written for older models, so check current best practices where they differ [1].
- A short neutral primer on zero-shot, few-shot, and prompt elements is in the DAIR.AI guide [25].
- One research team proposed 26 phrasing principles and tested them on several models [23]; treat them as ideas to try, not rules.
- For building products, Eugene Yan groups evals, guardrails, caching and feedback loops as separate patterns [29]; the Agents guide in this Academy continues from there.
Sources #
All sources accessed 2026-10-17. Dates are the publication or "updated" date shown on the page, or "none shown" when the page gave none. Numbers match the bracketed citations above.
- Prompt engineering overview. Anthropic. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview (no date shown)
- Prompting best practices. Anthropic. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices (no date shown)
- Best practices for prompt engineering for 2026. Anthropic. https://claude.com/blog/best-practices-for-prompt-engineering (2025-11-10)
- Define success criteria and build evaluations. Anthropic. https://platform.claude.com/docs/en/test-and-evaluate/develop-tests (no date shown)
- Reduce hallucinations. Anthropic. https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations (no date shown)
- Effective context engineering for AI agents. Anthropic Engineering. https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents (2025-09-29)
- Prompt Engineering Interactive Tutorial. Anthropic (GitHub). https://github.com/anthropics/prompt-eng-interactive-tutorial (no date shown)
- Prompt engineering. OpenAI. https://developers.openai.com/api/docs/guides/prompt-engineering (no date shown)
- Reasoning best practices. OpenAI. https://developers.openai.com/api/docs/guides/reasoning-best-practices (no date shown)
- GPT-4.1 Prompting Guide (archived). OpenAI Cookbook. https://developers.openai.com/cookbook/examples/gpt4-1_prompting_guide (no date shown)
- Structured model outputs. OpenAI. https://developers.openai.com/api/docs/guides/structured-outputs (no date shown)
- Designing reliable evals for LLM applications. OpenAI. https://developers.openai.com/api/docs/guides/evaluation-best-practices (no date shown)
- Prompt design strategies. Google AI for Developers. https://ai.google.dev/gemini-api/docs/prompting-strategies (last updated 2026-10-13)
- Prompt engineering techniques. Microsoft Learn. https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/prompt-engineering (updated 2026-06-05)
- Get started writing prompts in Microsoft Copilot. Microsoft Support. https://support.microsoft.com/en-us/topic/learn-about-copilot-prompts-f6c3b467-f07c-4db1-ae54-ffac96184dd5 (updated September 2026)
- Wei et al. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. arXiv. https://arxiv.org/abs/2201.11903 (2022; v6 2023)
- Wang et al. Self-Consistency Improves Chain of Thought Reasoning in Language Models. arXiv. https://arxiv.org/abs/2203.11171 (2022; rev. 2023)
- Kojima et al. Large Language Models are Zero-Shot Reasoners. arXiv. https://arxiv.org/abs/2205.11916 (2022; rev. 2023)
- Liu et al. Lost in the Middle: How Language Models Use Long Contexts. arXiv. https://arxiv.org/abs/2307.03172 (2023)
- Madaan et al. Self-Refine: Iterative Refinement with Self-Feedback. arXiv. https://arxiv.org/abs/2303.17651 (2023)
- Schulhoff et al. The Prompt Report: A Systematic Survey of Prompt Engineering Techniques. arXiv. https://arxiv.org/abs/2406.06608 (2024; v6 2025)
- Zhou et al. Least-to-Most Prompting Enables Complex Reasoning in Large Language Models. arXiv. https://arxiv.org/abs/2205.10625 (2022; rev. 2023)
- Bsharat et al. Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4. arXiv. https://arxiv.org/abs/2312.16171 (2023)
- Weng, L. Prompt Engineering. Lil'Log. https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/ (2023-03-15)
- Basics of Prompting. DAIR.AI Prompt Engineering Guide. https://www.promptingguide.ai/introduction/basics (no date shown)
- LLM01:2025 Prompt Injection. OWASP Gen AI Security Project. https://genai.owasp.org/llmrisk/llm01-prompt-injection/ (2025)
- Willison, S. Prompt injection: What's the worst that can happen? https://simonwillison.net/2023/Apr/14/worst-that-can-happen/ (2023-04-14)
- Husain, H. Your AI Product Needs Evals. https://hamel.dev/blog/posts/evals/ (2024-03-29)
- Yan, E. Patterns for Building LLM-based Systems & Products. https://eugeneyan.com/writing/llm-patterns/ (about 2023, no date shown)
- AI Risk Management Framework. NIST. https://www.nist.gov/itl/ai-risk-management-framework (released 2023-01-26)
Last updated: 2026-10-17