
What Is Prompt Engineering? A Plain-English Guide
What it means, the techniques OpenAI, Anthropic and Google recommend, and a before-and-after example you can copy
Prompt engineering is the practice of writing, testing and refining the instructions you give an AI model so it reliably produces the output you need. Here's what that means in plain English, the techniques the major AI companies recommend, and a before-and-after example.
Talha Riaz
Founder, PromptStore
Prompt engineering is the practice of writing, testing and refining the instructions you give an AI model so that it reliably produces the output you need. In practice that means telling the model what the task is, giving it the context it can't guess, showing it what a good answer looks like, and adjusting the wording until the results are consistent. You don't need to code to do it: if you have ever rewritten a ChatGPT request because the first answer missed the point, you have done prompt engineering.
Key takeaways
- A prompt is the input you send to an AI model. Prompt engineering is the repeated cycle of writing a prompt, checking the response and improving the prompt.
- OpenAI, Anthropic and Google all recommend the same core moves: be clear and specific, give context, show examples, and state the output format.
- Most weak AI answers come from missing context, not from a weak model.
- Prompts are model-sensitive. A prompt tuned for ChatGPT may need changes for Claude or Gemini.
- For apps and AI agents, the discipline is widening into context engineering: managing everything the model sees, not just the instruction.
What does prompt engineering mean?
Prompt engineering means designing the input to an AI model on purpose instead of by trial and luck. The three companies behind the most widely used models define it in nearly the same way:
| Source | Definition (paraphrased) |
|---|---|
| OpenAI | Writing effective instructions so a model consistently produces content that meets your requirements |
| Google Cloud | The iterative process of updating prompts and assessing the model's responses |
| Anthropic | Improving a first-draft prompt against success criteria you define and test up front |
The word that keeps recurring is consistently. Getting one good answer is easy. Prompt engineering is about getting a good answer every time, on inputs you haven't seen yet, which is why testing is part of the definition and not an extra step.
What is a prompt made of?
A prompt is any natural-language request you send to a model. Google's documentation lists the parts a prompt can contain: the task, system instructions, few-shot examples and contextual information. In everyday use it helps to think of five building blocks:
- Task: what you want done, stated as an instruction ("Summarize", "Draft", "Compare").
- Context: who it's for, why it matters, and the facts the model can't know: your product, your audience, your deadline.
- Examples: one or more samples of the output you want. Even a single example anchors tone and length better than adjectives like "professional" or "short".
- Format: how the answer should be laid out, such as a bulleted list, a table, a 200-word email or JSON.
- Constraints: what to avoid or stay within, like a word limit, reading level, facts that must not change, or topics to leave out.
You won't need all five every time. A quick question needs only a task. A prompt you'll reuse every week deserves all five.
Prompt engineering example: before and after
Here is a request a small US retailer might type into ChatGPT, Claude or Gemini in November.
Before
Write an email about our holiday hours.
The model will produce something, but it has to invent the store's name, the hours, the tone and the length, so the result is generic and needs heavy editing.
After
You're writing for a family-owned hardware store in Columbus, Ohio. Our customers are
mostly local homeowners and contractors.
Task: write a short email announcing our Thanksgiving week hours.
Facts (do not change these):
- Wednesday, Nov 25: 7 a.m.–8 p.m.
- Thursday, Nov 26 (Thanksgiving): closed
- Friday, Nov 27: 6 a.m.–9 p.m., with early-bird pricing on snow blowers until 10 a.m.
- Saturday and Sunday: regular hours, 8 a.m.–6 p.m.
Format: a subject line under 50 characters, then 3 short paragraphs and the hours as a
bulleted list. Warm and neighborly, no exclamation marks, under 150 words.
The second prompt is longer, but every line removes a guess. It states the task, supplies the context (who the store is and who reads the email), fixes the facts, and spells out the format and constraints. That is prompt engineering in one example: the model didn't get smarter, the instructions did.
What are the main prompt engineering techniques?
The core techniques below appear in the official guides from OpenAI, Anthropic and Google (checked October 2026).
| Technique | What it means | Use it when |
|---|---|---|
| Be clear and direct | State exactly what you want, as an instruction | Always; it's the first item in Anthropic's guide |
| Give context and the reason | Explain the goal and audience, not just the task | The answer feels generic or off-target |
| Zero-shot prompting | Ask with no examples | Simple, common tasks |
| Few-shot prompting | Include a handful of input/output examples | You need a specific style, tone or structure |
| Role or system instructions | Set who the model is and how it should behave for the whole conversation | Chatbots, assistants, any reused setup |
| Structure with delimiters | Separate instructions, data and examples with Markdown headings or XML-style tags | Long prompts that mix instructions with pasted text |
| Specify the output format | Name the layout: list, table, word count, JSON | The output feeds another document or tool |
| Break work into steps (prompt chaining) | Split a big job into several prompts, each feeding the next | Research, long documents, multi-stage tasks |
| Test and iterate (evals) | Run the prompt on real inputs and compare results against what "good" means | Any prompt you'll rely on more than once |
Two notes from the official guides are worth knowing. OpenAI separates its reasoning models, which work through a problem internally before answering, from its faster GPT models, which benefit from more explicit, step-by-step instructions. And OpenAI advises developers to pin production apps to a specific model snapshot, because a prompt that works today can behave differently after a model update.
Why does the same prompt give different results on different models?
Each model was trained differently, so each responds to wording, structure and examples a little differently. That is why OpenAI, Anthropic and Google publish separate prompting guides rather than one shared standard. Anthropic's guide, for example, recommends XML tags to separate the parts of a complex prompt, while OpenAI suggests a mix of Markdown and XML.
You can see this on PromptStore, where prompts are labeled with the models they were written for. The ChatGPT version of a meeting-summary prompt and the Claude version are listed separately for exactly this reason. If you move a prompt between models, test it again rather than assuming it carries over.

What is the difference between prompt engineering and context engineering?
Context engineering is the broader job of deciding everything a model sees at each step, including instructions, documents, tool descriptions, conversation history and memory, not only the prompt you type. Anthropic describes it in Effective context engineering for AI agents as treating the model's context as a finite resource to be curated.
For someone using ChatGPT or Claude in a chat window, prompt engineering is still the skill that matters. Context engineering matters once you build AI agents or apps that run many steps on their own.
Is prompt engineering a real skill or a job?
It is both a skill and, at some companies, a job title. IBM describes a prompt engineer as someone who designs, tests and refines prompts and understands what different models can and can't do. Far more people use the skill without the title: marketers drafting campaigns, analysts summarizing reports, developers writing system prompts, teachers building lesson materials.
The durable part of the skill isn't memorizing tricks. It's the habit of writing a clear brief and checking the output, which works on every model and survives every update.
Is prompt engineering safe? A note on prompt injection
When prompts run inside apps that read emails, web pages or documents, anyone who can put text in front of the model can try to give it instructions. This is called prompt injection, and the OWASP Gen AI Security Project ranks it first in its Top 10 for LLM applications (LLM01:2025). If you build with AI, treat outside text as data, not as instructions, and don't give a model access to anything you wouldn't let an untrusted input control.
For everyday use, the practical rules are simpler: don't paste passwords, customer records or confidential documents into a public AI tool, and check facts, figures and citations before you publish what a model writes.
How to get better at prompt engineering
- Start from a working prompt. Reading a well-structured prompt teaches more than a list of tips. PromptStore's text and agent prompts can be filtered by model and category, and most are free with a free account.
- Change one thing at a time. If you rewrite the whole prompt, you won't know what fixed it.
- Keep a small test set. Save three or four real inputs and rerun them whenever you edit the prompt.
- Write the reusable parts down once. A system prompt for a chatbot is the clearest example: set it once, and every conversation inherits it.
- Read the vendor guide for the model you use. The OpenAI, Anthropic and Google guides linked above are free and kept current.
If you're looking for more ready-made prompts, our guide to where to find free AI prompts compares seven sources. If you write prompts others could use, see how to sell AI prompts.
Troubleshooting common prompt problems
| Problem | Likely cause | Fix |
|---|---|---|
| Answer is generic | No context about audience or goal | Add who it's for and why |
| Wrong length or layout | Format not stated | Name the format and a word or item count |
| Invents facts | Facts weren't supplied | Paste the facts and say "use only these" |
| Ignores part of the request | Instructions buried in pasted text | Put instructions first and wrap the data in tags or headings |
| Tone is off | Adjectives instead of examples | Add one short example of the tone you want |
| Worked yesterday, not today | Model was updated | Retest, and pin a model version if you're using the API |
Summary
Prompt engineering is writing clear instructions for an AI model and refining them until the output is reliably right. The fundamentals are the same across ChatGPT, Claude and Gemini: state the task, give the context, show an example, name the format and set the limits. Then test the prompt on real inputs, because consistency, not one lucky answer, is the goal. To see these patterns in finished prompts, browse the free prompt library on PromptStore.
Frequently asked questions
Prompt engineering is writing clear instructions for an AI model, checking what it gives back, and adjusting the instructions until the output is reliably what you need. It is closer to writing a good brief for a colleague than to programming.