CreatechzAI Tools
Home › Prompting and AI workflows › Prompt engineering guide

Prompt engineering guide: techniques that work, with the evidence

Prompt engineering is the craft of telling a model what you want in a form it can act on. This guide is the map: each technique, what vendors and researchers say about it, what it costs in tokens, and where to read more. Count your prompts in the token counter; the hub is prompting and AI workflows.

Quick answerGood prompts state the role, the task and the output format; separate instructions, examples and context; put stable content first so it can be cached; add 3 to 5 examples only if they help; and are tested on real inputs. No prompt is a security boundary.

By the Chelure Enterprises Editorial Team. Last reviewed . How we check our sources.

The techniques at a glance

TechniqueWhat it doesWhat the sources sayRead more
Clear role and instructionsSets scope, tone and rulesAnthropic: a single sentence of role in the system prompt focuses behaviour; OpenAI: developer messages are prioritized ahead of user messagesSystem prompts
Examples (few-shot)Shows the format and judgement you wantBrown et al. (2020): task and demonstrations specified through text alone; Anthropic: 3 to 5 examplesFew-shot prompting
Step-by-step reasoningGets intermediate steps before the answerWei et al. (2022) and Kojima et al. (2022) for earlier models; reasoning models think internallyChain-of-thought
Structure and delimitersSeparates instructions, context and inputAnthropic: tags reduce misinterpretation; OpenAI: Markdown headers and XML tagsSystem prompts
Stable content firstEnables prompt cachingOpenAI and Anthropic cache by prefix; cached reads cost a fraction of inputPrompt caching
Guarding untrusted inputLimits injected instructionsOWASP: no fool-proof prevention is known; limit privileges and validate outputPrompt injection

A practical workflow

  1. Define success. Write 10 to 20 real inputs and what a good output looks like.
  2. Write the simplest prompt. A clear instruction, the input, and the format you want.
  3. Add structure. Separate role, instructions, examples and context, in that order, with the variable input last.
  4. Add examples only if needed. Start with three; test five.
  5. Measure. Compare accuracy and cost across prompt versions and across models; the prompt cost calculator prices each variant.
  6. Harden. Validate outputs, limit what the model can do, and test with hostile input.

Where each vendor puts the emphasis

Frequently asked questions

What is prompt engineering?

Prompt engineering is writing and structuring the instructions, examples and context you give a model so it produces the output you want reliably, and measuring whether it does.

What is the single most useful tip?

Be specific about the task, the audience and the output format, and test your prompt on real inputs. Vendors agree on structure: OpenAI suggests sections for identity, instructions, examples and context, and Anthropic recommends wrapping different kinds of content in their own tags.

Do I still need chain-of-thought prompts?

For non-reasoning models on multi-step problems, yes it can help; for reasoning models, OpenAI says they do better with high-level goals and Anthropic advises general instructions such as thinking thoroughly. See the chain-of-thought page.

How many examples should I include?

Anthropic recommends 3 to 5 well-crafted examples; OpenAI says to show a diverse range of inputs. Each example costs tokens on every request, so measure the gain.

Does prompt wording affect cost?

Yes. Prompt length is input tokens, reply length is output tokens, and repeated prefixes can be cached at a discount. Put stable content first.

Can a good prompt make a model safe against attacks?

No. OWASP says no fool-proof prevention of prompt injection is known; treat the prompt as guidance, not a security boundary.

Sources

Primary sources opened on November 13, 2026. Prices come from our verified price table (see the methodology).