AI Glossary / Prompting and human-AI interaction / Beginner

Prompt engineering

Definition

Prompt engineering is the deliberate design and testing of instructions given to an AI model. It involves explaining the task, supplying relevant context, specifying the desired output and checking whether the results meet the need. A good prompt improves guidance; it does not guarantee truth, judgment or safe behavior.

What it means

A prompt is more than a clever question. It may include a task description, background material, examples, constraints and a requested format. These help distinguish your intended answer from other plausible responses.

Suppose you ask for a useful customer reply. Useful could mean short, sympathetic, legally cautious or focused on arranging a replacement. Without a clear purpose and relevant facts, the model may make incorrect guesses.

The engineering part is the repeatable process: define success, try a version, inspect failures and improve it. A prompt that works once on an easy example may fail on a missing detail, an unusual request or a conflicting document.

How it works

Start with the outcome. State what the model should produce, who will use it and which facts it may rely on. Clearly identify the source material separately from the instructions.

Specify a usable format. For example, ask for three fields: customer issue, evidence from the supplied message, and suggested next step. Examples should reflect the task, including missing information.

Test the prompt on cases with known expectations. Check factual support, completeness and format separately. Change one important feature at a time and record each tested version.

A prompt is not a security boundary. A document can contain malicious instructions, and the model may follow them despite your wording. Software permissions, input handling, output checks and approval rules must control consequential actions outside the prompt itself.

Three practical examples

Small business: a bakery asks for a draft response using only the order facts provided, with unavailable collection times marked for staff confirmation.

Home: a parent asks for a weekly meal outline based on named ingredients and time limits, then checks suitability and missing shopping items personally.

Workplace learning: a manager asks for a plain-English explanation of a procedure, followed by two practice questions and answers based on the supplied procedure rather than invented company rules.

Think of it this way

Think of writing a brief for a colleague joining a task halfway through. Explain the goal, provide the necessary material and show what a useful deliverable looks like.

The analogy has limits. A colleague may question a contradictory brief. An AI model may instead produce a polished answer that hides the contradiction. Clear briefing therefore goes together with checking the result.

Worked example

Testing a support-response prompt

Imagine twenty invented support messages with staff-prepared expected outcomes. A response passes only if it identifies the issue correctly, invents no order facts and includes a next step supported by the supplied policy. These are stipulated teaching results, not an experiment performed here.

Version A passes twelve messages. Its pass rate is 12 ÷ 20 × 100 = 60%. Version B adds a clear source section and a missing-information rule. It passes sixteen, giving 16 ÷ 20 × 100 = 80%.

The increase is four passing cases, or twenty percentage points. It is not a twenty-percent relative increase: four divided by twelve is about 33.3%.

This small example does not prove that Version B will perform better on every future request. Reusing the same cases while editing can encourage overfitting to them. Check a separate set of unseen messages, inspect serious failures individually and repeat tests when variability matters.

Illustrative case study

Fictional case: Willow Repairs wants help drafting appointment replies. Its first prompt says, “Be helpful and resolve the customer's problem.” Drafts occasionally promise slots that the supplied schedule does not contain.

The revised brief requires the requested service, listed available slots, and clarification of missing addresses or preferred days. It includes one example where no suitable slot exists.

Staff still approve replies. The booking system checks availability independently before recording an appointment, so a generated sentence cannot create a reservation by itself. The case illustrates clearer instructions and enforceable workflow controls without claiming a measured productivity gain.

Common misconceptions and mistakes

There is one perfect prompt. Effective wording depends on the task, the model and the material provided.

A confident role instruction creates expertise. Calling the model an expert does not validate its answer or supply missing evidence.

A longer prompt is always stronger. Repetition, contradictions and irrelevant background can make requirements harder to follow.

“Never reveal secrets” is sufficient protection. Sensitive access must be limited by the application; a sentence cannot replace authorization controls.

Business use

Prompt engineering is useful for recurring drafting, extraction, explanation and classification tasks. Begin with a narrow workflow where people can describe acceptable outputs and recognize errors.

Keep a small evaluation collection containing ordinary cases, missing information and plausible exceptions. Record the prompt version, model configuration and review criteria so colleagues can compare results meaningfully.

Measure the whole workflow. A fast draft may require extensive checking. Track the kinds of corrections people make, especially invented facts and missed exceptions, before deciding that a prompt saves time. Treat important actions as separate operations with their own permissions and approvals.

People also ask

Is prompt engineering programming?

It can support software development; ordinary users also structure and test requests. Natural-language instructions are not deterministic program rules.

Does it train the model?

Changing the prompt normally changes the information used for that request, not the model's learned parameters. Training is a separate process.

Can I reuse a prompt?

Yes, as a starting point. Retest it when the task, source material or model changes.

Check your understanding

A prompt tells an assistant never to refund more than a set amount. Is that sentence enough to enforce the refund limit?

Answer: No. The payment or refund system must enforce authorization and limits independently. Prompt wording can guide a proposed action, but cannot be the sole control.

Related terms

  • Prompt
  • Few-shot prompting
  • Evaluation
  • Prompt injection
  • Grounding
  • context
  • structured output
  • human review

Learn next

Choose one recurring task and write its success criteria before rewriting the prompt. Compare two versions on the same cases, then check the better version on fresh examples. Read prompt injection to understand why instructions and permissions serve different purposes.

  • Prompt injection
  • Prompt

More in Prompting and human-AI interaction

  • Least-to-most prompting - Least-to-most prompting is a language-model prompting strategy that first decomposes a problem into simpler subproblems and then solves them in sequence...
  • Multimodal Prompt-based Language Model - A multimodal prompt-based language model generates language in response to prompts containing more than one kind of information, such as text combined with...
  • One-shot prompting - One-shot prompting gives a language model one demonstration of the desired task before asking it to handle a new input.
  • Prompt-based learning - Prompt-based learning uses prompts to guide a pretrained model toward a task or desired behavior.
  • Prompt chaining - Prompt chaining connects multiple model calls so that an earlier call's output becomes part of a later call's input.
  • Prompt set - A prompt set is a collection of prompts used to evaluate a language model or an AI application.

Sources

OpenAI, Prompt engineering: https://developers.openai.com/api/docs/guides/prompt-engineering . Primary guidance on instructions, examples, model variation and evaluation.

OWASP, LLM Prompt Injection Prevention Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html . Primary security guidance on untrusted content, least privilege and external controls. Figures and the fictional case are original illustrations.

Previous: Prompt chaining Next: Prompt injection

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer