Two people ask the same AI tool for help with the same report. One gets a vague, generic summary. The other gets a tight, well-organized draft that needs only light edits. Usually the difference isn’t the tool. It’s what each person typed. That gap is what prompt engineering is about, and you don’t need to be a programmer to get good at it.
Prompt engineering is the practice of writing and refining the instructions you give an AI model so it produces the output you need. It covers what you ask, the context and examples you include, how you structure the request and how you test and improve it. It applies to a quick chat message and to prompts built into business software.
In one sentence: Prompt engineering is briefing an AI the way you’d brief a capable new colleague: say exactly what you want, give the background they lack, show an example and check the result.
Key takeaways
- Being clear and specific is the first and most important technique.
- Context, examples and a defined output format make results far more consistent.
- Asking a model to reason step by step (chain of thought) can help with multi-step problems.
- Good prompting needs success criteria and testing, not one lucky attempt.
- Prompts in business systems need security thinking too, because of prompt injection.
Why does prompt engineering matter?
A language model predicts a good continuation of whatever you give it. It can’t read your mind, see your files or know your company’s style unless you tell it. When a prompt is vague, the model fills the gaps with the most generic answer that fits. When a prompt is specific, the model has much less guessing to do.
Anthropic’s prompting guidance offers a simple test: show your prompt to a colleague who knows little about the task and ask whether they could follow it. If a smart person would be confused, the model probably will be too. Anthropic also describes the model as a brilliant but new employee who lacks context, which is a helpful way to think about it.
The payoff is practical. Better prompts mean fewer rewrites, more consistent results across a team and AI features that hold up when real users start relying on them.
What are the core prompt engineering techniques?
The official guides from the major AI companies (Anthropic, OpenAI and Google) overlap a lot. The core ideas:
| Technique | What it means | Quick example |
|---|---|---|
| Be clear and specific | State the task, audience, length and goal | “Write a 150-word summary for a CFO, focused on cost risks” |
| Give context | Explain why the task matters and what the output is for | “This goes into a board pack, so avoid jargon” |
| Show examples | Include one or more samples of good output (few-shot prompting) | Paste two past summaries you liked |
| Structure the prompt | Separate instructions, background and input with headings or tags | <instructions>…</instructions> <report>…</report> |
| Define the format | Say exactly how the answer should look | “Return a table with columns Risk, Impact, Owner” |
| Let it think | Ask for step-by-step reasoning on complex problems | “Work through the numbers before giving your answer” |
| Break up big tasks | Split complex work into smaller prompts | First extract facts, then draft, then review |
Many guides also mention giving the model a role, such as “You are an experienced auditor reviewing access controls.” A role can shift tone and focus, but it works best alongside the other techniques. Telling a model it’s an expert doesn’t give it facts it lacks, so a role plus clear context beats a role on its own.
Anthropic’s guide lists “be clear and direct” first among its general principles, ahead of context, examples, structure and roles. That order reflects real experience: most bad results come from unclear requests, not from missing tricks.
What does a good prompt look like?
Here’s a weak prompt and a stronger version of the same request.
Weak: “Summarize this incident report.”
Stronger:
“You’re helping an IT security manager brief non-technical executives. Summarize the incident report below in under 200 words. Cover what happened, what systems and data were affected, whether customers are impacted and what happens next. Use plain language and no acronyms without explanation. End with a short list of decisions the executives need to make. If the report doesn’t say something, write ‘not stated’ instead of guessing.
<report> [paste report] </report>”
The stronger version names the audience, length, required content, tone and format. It also tells the model what to do when information is missing, which cuts down on confident guesses. Nothing in it is clever. It’s simply complete.
What are zero-shot, few-shot and chain-of-thought prompting?
These terms come from AI research and show up in many courses.
- Zero-shot prompting means asking the model to do a task with no examples, relying on instructions alone.
- Few-shot prompting means including a few examples of inputs and desired outputs in the prompt, so the model copies the pattern. It works without retraining the model.
- Chain-of-thought prompting means getting the model to write out intermediate reasoning steps before the final answer. It was introduced by Jason Wei and colleagues at Google in a 2022 paper presented at NeurIPS. A companion paper by Kojima and colleagues showed that simply asking the model to think step by step, with no examples, can also help.
Newer models often reason well without being told to, and some have built-in “thinking” modes. Chain of thought still helps for maths, logic and multi-step decisions, and it makes the model’s reasoning easier to check. For simple tasks, it mostly adds length.
How do you get structured output?
If the output feeds into another system, a spreadsheet or a report template, format matters as much as content. Practical tips:
- Describe the exact format. Name the columns, fields or headings you want.
- Show a sample. One short example of the format is often clearer than a paragraph of description.
- Use delimiters. Wrapping content in tags or clear headings helps the model tell instructions from data. Anthropic’s documentation notes that XML-style tags help the model read complex prompts that mix instructions, context, examples and inputs.
- Say what to do with gaps. “Leave the field empty” or “write unknown” is better than letting the model invent a value.
Many AI platforms also offer a structured output or JSON mode for developers, which forces responses to match a defined schema. When that’s available, use it alongside a clear prompt.
How do you reduce wrong or made-up answers?
Language models sometimes produce statements that sound right but aren’t, often called hallucinations. Prompting can’t remove this risk, but it can reduce it:
- Give the source material. Ask the model to answer from a document you provide, not from memory.
- Allow “I don’t know.” Explicitly tell the model it’s fine to say information isn’t available.
- Ask for quotes or references. Request the specific passage that supports each claim, so you can check it.
- Check important facts. Treat AI output as a draft. Verify numbers, names, dates and legal or medical claims before using them.
Grounding the model in your own documents is the idea behind retrieval-augmented generation (RAG), where a system looks up relevant content and adds it to the prompt automatically.
Is prompt engineering becoming context engineering?
As AI moved from single chats to agents that run many steps and use tools, some practitioners started using the term “context engineering.” The idea is that the prompt you type is only part of what the model sees. The rest includes system instructions, retrieved documents, conversation history, tool descriptions and results from earlier steps.
In that world, a big part of the job is deciding what information the model should have at each step, and leaving out what it shouldn’t. Protocols such as MCP standardize how tools and data reach the model, which makes this context easier to manage. The basics of clear instructions, good examples and testing still apply. They just cover more than one message.
What are the security risks of prompts?
When prompts are built into business software, security matters. The main risk is prompt injection: someone hides instructions in content the model reads, such as an email, a web page or an uploaded file, hoping the model will follow them. For example, a document might contain hidden text telling an AI assistant to ignore its instructions and reveal confidential data.
Prompt design helps a little. Separating instructions from untrusted content with clear delimiters and telling the model to treat that content as data both make injection harder. But no prompt fully stops it, because models can’t perfectly separate data from instructions. Real protection comes from the system around the model: limiting what the AI can access, requiring human approval for risky actions and logging what it does.
A related point for anyone using public AI tools at work: don’t paste confidential data into tools your company hasn’t approved. Your prompt is data too, and it goes wherever the tool sends it.
How do you test and improve prompts?
Treat prompts like any other piece of work that needs to be reliable. Anthropic’s guide assumes you start with clear success criteria and a way to test against them, then improve the prompt step by step. A simple process:
- Define success. What makes an output good? Accuracy, tone, length, format?
- Collect test cases. Gather a handful of real inputs, including awkward ones.
- Run and review. Try the prompt on every case and note where it falls short.
- Change one thing at a time. Adjust the instruction, example or format, then re-run the same tests.
- Keep versions. Save prompts that work, with notes on why, so your team can reuse them.
A shared library of tested prompts for common tasks (meeting summaries, policy drafts, code reviews) often brings more value to a team than any single clever technique.
A worked example: the policy summary that got better
Suppose a compliance analyst needs to turn a 30-page access control policy into a one-page guide for new employees.
First attempt: “Make this policy shorter.” The result is a condensed version of the whole document, still full of legal wording, at about four pages.
Second attempt: she adds the audience (new employees, not IT staff), the length (one page), the purpose (what they personally must do) and a format (short headings with bullet points). The result is close, but it includes rules that only apply to administrators.
Third attempt: she adds “Only include rules that apply to every employee. Leave out sections for administrators and IT.” She also pastes a short example of a one-page guide her team liked. Now the output is nearly ready. She checks every rule against the original policy, fixes one password detail the model softened and publishes it.
Each change was small and obvious in hindsight. That’s typical. Good prompting is mostly noticing what the model didn’t know and telling it.
Frequently asked questions
Do I need to code to do prompt engineering?
No. Most prompt engineering is clear writing. Coding helps when you build prompts into applications, test them at scale or use features like structured output.
What is the most important prompt engineering tip?
Be clear and specific about the task, audience, format and goal. Most poor results come from vague requests rather than missing advanced techniques.
What is few-shot prompting?
Few-shot prompting means including a few examples of the input and the output you want, so the model follows the same pattern for your real request.
Can prompt engineering stop AI from making mistakes?
It can reduce mistakes, for example by giving source material and allowing “I don’t know,” but it can’t remove them. Always check important facts.
The bottom line
Prompt engineering is the skill of telling an AI model exactly what you need: the task, the context, an example, the format and what to do when it isn’t sure. Start with clarity, add structure and examples as tasks get harder, and test prompts against real cases before relying on them. When prompts power business systems, pair good prompting with security controls, because instructions alone can’t stop prompt injection.
Sources: Anthropic: prompting best practices; Wei et al., Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (2022).


