Prompt engineering is the practice of designing and refining the instructions (prompts) given to a generative AI model to get accurate, relevant and useful outputs. Because large language models respond to natural-language input, the way a request is phrased – its wording, structure, context and examples – can dramatically change the quality of the result.
A well-engineered prompt typically specifies some combination of role, task, context, format and constraints. For example, instead of “write about email marketing,” a stronger prompt would be: “You are an ecommerce marketing consultant. Write a 500-word beginner’s guide to abandoned-cart emails for a small Shopify store, in a friendly tone, with three subject-line examples.”
Common prompt engineering techniques include:
- Zero-shot prompting – Asking the model to perform a task with instructions only and no examples.
- Few-shot prompting – Including a handful of worked examples in the prompt so the model can infer the expected pattern and format.
- Chain-of-thought prompting – Asking the model to reason step by step before giving its final answer, which improves performance on math and logic problems.
- Role prompting – Assigning the model a persona (“act as a senior contract lawyer”) to shape its expertise, vocabulary and tone.
- Structured output prompting – Requesting a specific format such as a table, JSON or a numbered list so the output can be used directly in another system.
Prompt engineering matters because it is the cheapest and fastest way to improve AI output – no retraining or fine-tuning required. It briefly became a standalone job title, and while dedicated “prompt engineer” roles are now rarer as models get better at interpreting plain requests, prompting remains a core workplace skill, and the same principles underpin how developers write system prompts and instructions for AI agents and applications.