What Is Prompt Engineering?
Prompt engineering is the craft of telling an AI model exactly what you want, in a way it can act on. A prompt can be a single question or several pages of instructions, background and examples.
The idea is simple. Language models respond to the words you give them. Our explainer on large language models explains how they predict text. Clearer, richer input usually leads to better output.
The major AI developers publish their own guides, and they agree on the basics. OpenAI, Anthropic and Google all recommend clear instructions, relevant context, examples and a defined output format.123
The term sounds technical, but most of it is plain communication. If you can brief a new colleague well, you already have most of the skills. The difference is that the model knows nothing about your situation unless you tell it.
Why Prompt Engineering Matters
The same AI tool can give a vague, generic answer or a precise, useful one, depending on the prompt.
- Better accuracy: context and source material reduce guessing.
- Less rework: clear format instructions mean less editing afterward.
- More consistency: a well-tested prompt gives similar quality every time, which matters for business use.
- Lower cost: in paid tools and apps, fewer retries mean fewer tokens and less spend.
- Safer use: clear limits help keep the model within the task you intended.
Prompting is not a cure for every weakness. Models can still make mistakes, and some tasks need better tools or data rather than better wording. But for everyday work, prompting is the fastest and cheapest way to improve results.
The Building Blocks of a Good Prompt
Strong prompts usually contain a few of the same parts, even if they are written as normal sentences.
| Part | What it does | Example wording |
|---|---|---|
| Task | Says exactly what to do | Write a 150-word product description |
| Context | Gives the background the model needs | The product is a refillable steel water bottle for hikers |
| Audience | Says who the output is for | For first-time buyers who care about weight |
| Format | Defines the shape of the answer | One short paragraph, then three bullet points |
| Tone and style | Sets the voice | Friendly, plain English, no jargon |
| Constraints | Sets limits and rules | Do not mention competitors or make health claims |
| Examples | Shows what good looks like | Here is a description we liked last month |
You do not need every part every time. A quick question needs only the task. A business process that runs hundreds of times deserves all of them, tested and refined.
Core Prompt Engineering Techniques
A handful of techniques cover most of what you need, and the major AI developers recommend them.123
1. Be Clear and Specific
Say exactly what you want rather than hinting. Instead of asking for something about marketing, ask for five email subject lines for a spring sale on running shoes, each under 50 characters. Specific requests leave less room for the model to guess.
2. Give Context and Reference Material
Paste in the facts, documents or data the answer should use. Ask the model to base its answer only on that material. OpenAI’s guide notes that giving reference text can help reduce invented answers.1 This matters most for facts the model could not know, such as your prices or internal policies.
3. Assign a Role
Telling the model to act as an experienced editor, a patient tutor or a careful analyst can shape its tone and focus. Anthropic’s guidance describes role prompting as a way to improve performance on specialist tasks.2
4. Show Examples
Include one or more examples of the output you want. This is often called few-shot prompting. Google’s guidance recommends examples to show the model the pattern to follow.3 Use varied examples, so the model copies the pattern rather than one specific answer.
5. Define the Output Format
Ask for a table, a numbered list, a set word count, headings or a structured format such as JSON. Clear formats make output easier to check and reuse.
6. Ask for Step-by-Step Work
For problems with several stages, such as calculations or decisions, ask the model to work through the steps before giving a final answer. This often improves accuracy on reasoning tasks. Many newer models do some of this on their own, but asking can still help.
7. Break Big Tasks Into Smaller Ones
Instead of one giant request, split the work. First ask for an outline, then each section, then a review. Each step is easier to check, and errors are caught early.
8. Separate Instructions From Content
Use clear markers, such as headings, quotation marks or tags, to separate your instructions from the text you want processed. Anthropic suggests using tags like these to keep parts of a prompt distinct.2
9. Iterate
Treat the first answer as a draft. Tell the model what to change and why, such as making it shorter, more formal or focused on a different audience. Prompting is usually a short conversation, not a single shot.
Prompt Examples: Before and After
Small changes in wording can lead to very different results.
| Goal | Weak prompt | Stronger prompt |
|---|---|---|
| Summarize a report | Summarize this. | Summarize the report below in five bullet points for a busy manager. Focus on costs, risks and decisions needed. |
| Explain a concept | Explain inflation. | Explain inflation to a 15-year-old in under 200 words, with one everyday example. |
| Write an email | Write a follow-up email. | Write a polite follow-up to a client who has not paid an invoice due 10 days ago. Keep it under 120 words and offer a quick call. |
| Brainstorm | Give me blog ideas. | Suggest 10 blog post titles for a bakery’s website, aimed at people planning birthday parties, each under 60 characters. |
Notice the pattern. Each stronger prompt names the audience, the length and the focus. None of them uses special tricks or secret phrases.
Get One Clear Tech Explainer a Week
AI, tech and the tools you use every day in plain English: one explainer every Thursday.
Get the Newsletter →A Simple Prompt Template
If you are unsure where to start, fill in a simple template and adjust it.
- Role: You are a [type of expert].
- Task: I need you to [do this specific thing].
- Context: Here is the background: [facts, audience, goal].
- Material: Use only the information between the markers below.
- Format: Reply as [a list, a table, an email] in about [length].
- Rules: Do not [things to avoid]. If you are unsure, say so.
The last rule is especially useful. Inviting the model to say it does not know reduces the pressure to invent an answer. Our explainer on AI hallucinations explains why models sometimes fill gaps with made-up details.
Prompt Engineering for AI Agents and Apps
When AI is built into products or agents, prompts become part of the software and need testing like any other code.
Developers usually write a system prompt, a set of standing instructions that shapes every reply. It sets the assistant’s role, rules, tone and what tools it may use. User messages then arrive on top of it.
For agents that take actions, such as sending emails or browsing websites, prompts also define what the agent may and may not do, and when it must ask a person first. Our explainer on agentic AI covers how these systems work.
Good teams keep a set of test questions and check every prompt change against them. A small wording change can improve one case and break another, so testing protects quality.
Risks: Prompt Injection and Misuse
Prompts can also be used against AI systems, and the main risk is called prompt injection.
Prompt injection happens when an attacker hides instructions inside content an AI reads, such as a web page, email or document. The AI might then follow those hidden instructions instead of the user’s. NIST’s Generative AI Profile lists prompt injection among the information security risks of generative AI.4
- Treat outside content as data, not commands. Well-designed tools separate instructions from material they read.
- Limit what AI tools can do. An assistant that can send money or delete files needs strict permissions and human approval.
- Be wary of unexpected behavior. If a tool suddenly asks for passwords or tries to send data somewhere new, stop and check.
- Protect accounts. Strong passwords and two-factor authentication limit the damage if an AI-assisted scam steals a password.
Never paste passwords, card numbers or highly sensitive personal data into prompts unless you know exactly how the tool stores and uses them.
Prompting Different Kinds of AI Tools
The same principles apply across tools, but each type of AI responds best to slightly different details.
- Chat assistants: benefit most from context, audience and format. Follow-up messages refine the answer.
- Image generators: respond to visual details such as subject, setting, lighting, style, colors and composition. Describing what to leave out can help too.
- Coding assistants: work best with the relevant code, the error message, the language and version, and a clear description of the expected behavior.
- Search-connected assistants: benefit from asking for sources, so you can check where claims come from.
- Data tools: need column names, sample rows and the exact question you want answered.
Whatever the tool, review the output with the same care. An image may contain odd details, code may run but contain bugs and a summary may leave out the one point that mattered most.
Saving and Reusing Good Prompts
Once a prompt works well, save it so you and your team can reuse it. Repeated tasks are where prompting pays off most.
Keep a simple library in a shared document. For each prompt, note what it is for, when it was last tested and any known weak spots. Many AI tools now let you save instructions or create custom assistants that remember them.
Review saved prompts when the underlying model changes. A prompt tuned for one version may behave differently on the next, so a quick retest avoids surprises.
Is Prompt Engineering a Career?
Prompt engineering is more often a skill within many jobs than a job title on its own.
Some companies hire specialists to design, test and maintain prompts for AI products. More commonly, prompting is part of the work of developers, writers, marketers, analysts and support teams who use AI every day.
As models improve, they need less careful wording for simple tasks. But clear thinking about goals, context and quality checks remains valuable. Those skills transfer to any tool. Our explainer on generative AI covers the wider field.
A Worked Example
Here is a made-up example of improving a prompt over three rounds.
Ana runs a small travel agency. Her first prompt is simply a request for a three-day Lisbon itinerary. The answer is generic and suggests expensive restaurants her clients would not choose.
Her second prompt adds context: a retired couple, a budget of about $150 a day, a dislike of steep walks and an interest in history and food. The plan improves but runs too long, with some days far too packed.
Her third prompt adds format and limits: no more than three activities a day, a rest break each afternoon, a short note on transport between each stop and a reminder to check opening hours. The result is close to ready. She checks prices and times herself before sending it to the clients.
Common Prompting Mistakes
Most poor results come from a few avoidable habits.
- Being too vague and expecting the model to guess your goal.
- Leaving out key facts, then being surprised when the model invents them.
- Asking for everything at once instead of breaking the task down.
- Accepting the first answer without asking for improvements.
- Not checking facts, especially names, numbers, dates and quotes.
- Sharing sensitive data in prompts without checking the tool’s privacy settings.
Key Terms Explained
- Prompt: the instruction, question or input you give an AI model.
- System prompt: standing instructions set by a developer that shape every reply.
- Few-shot prompting: including examples in a prompt to show the pattern you want.
- Zero-shot prompting: asking for a task without any examples.
- Prompt injection: hidden instructions in content that try to hijack an AI system.
- Context window: the amount of text a model can consider at once.
The Bottom Line
Prompt engineering is mostly clear communication: say what you want, give the context, show the format and check the result. Start with a simple template, add examples for repeated tasks and iterate rather than expecting perfection first time. Keep sensitive data out of prompts and stay alert to prompt injection in tools that read outside content. For more, browse our AI tools explainers.
For answers grounded in your own documents, see our explainer on retrieval-augmented generation.
Frequently Asked Questions
It is the skill of writing instructions that get better results from AI tools. Good prompts are clear, specific and give the model the context it needs.
A good prompt states the task, gives context, names the audience and says what format the answer should take. Examples and clear limits make it even better.
It means including a few examples of the output you want in your prompt. The model uses them as a pattern to follow.
They can reduce them but not remove them. Giving trusted reference material and allowing the model to say it is unsure both help, but you should still check important facts.
It is an attack where hidden instructions are placed in content an AI reads, such as a web page or email. The goal is to make the AI ignore its user and follow the attacker instead.
No. Most prompting is written in plain language. Coding helps if you build AI into apps or automate prompts at scale.
Sources
- 1OpenAI: Prompt Engineering Guide
- 2Anthropic: Prompt Engineering Overview
- 3Google AI for Developers: Prompt Design Strategies
- 4National Institute of Standards and Technology: Generative AI Profile (NIST AI 600-1)
Every figure in this article is checked against the sources above. How we research and fact-check →
Get One Clear Tech Explainer a Week
AI, tech and the tools you use every day in plain English: one explainer every Thursday.
100% free · No sign-up



