What is prompt engineering?
Prompt engineering is the practice of writing and testing the instructions, context and examples given to an AI model so that it produces accurate, useful and consistent output.
Also called: prompt design, prompting
How it works
A prompt can include a role, a task description, rules, relevant data, examples and an output format. Prompt engineering is the work of choosing and arranging these parts, then measuring the results and adjusting. Techniques include few-shot prompting, step-by-step reasoning and asking for structured output.
As models improve, clear plain instructions matter more than tricks. The most useful habit is to treat prompts as code: version them, test them on fixed examples and track how changes affect accuracy.
Why it matters for fraud and risk
In risk work, small prompt changes can shift how many cases a model flags. A vague instruction like "flag anything suspicious" can flood a review queue with false positives. Clear definitions, examples of legitimate cases and a fixed set of labels give more stable results.
Prompt engineering has an offensive side too. Attackers write prompts to bypass safety rules or to hijack AI agents through prompt injection. Defenders need to test their own prompts against these tactics.
Practical tips
- State the task, the allowed answers and what to do when unsure.
- Give the model the data it needs instead of expecting it to know.
- Ask for a structured format that code can check.
- Keep a test set of real cases and rerun it after every change.
- Set a low temperature for decisions that must be repeatable.
Related terms
- Few-shot promptingFew-shot prompting is a way of guiding a language model by including a small number of worked examples of the task in the prompt, before the new input it should handle.
- System promptA system prompt is a set of instructions given to a language model by the app developer, separate from user messages, that defines the model's role, rules, tone and limits.
- Chain-of-thought promptingChain-of-thought prompting asks a language model to work through a problem in intermediate steps before giving its final answer, which often improves results on multi-step tasks.
- Prompt injectionPrompt injection is an attack in which text given to an AI model contains instructions that override what its developer or user intended, so the model leaks data or takes unwanted actions.
- AI evaluation (evals)AI evaluation, often called evals, is the practice of testing an AI model or system on defined tasks and metrics to measure quality, safety and fitness for use.