---
title: 'Prompt engineering'
description: 'Designing and testing model inputs to elicit useful behavior from a particular model and task.'
canonical_url: 'https://darkfactory.dev/glossary/prompt-engineering'
markdown_url: 'https://darkfactory.dev/glossary/prompt-engineering.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Prompt engineering


## Definition

Prompt engineering is the iterative design, testing, and maintenance of model inputs for a defined task. It covers instructions, examples, delimiters, output requirements, role or message placement, and the wording used to separate trusted directions from untrusted data.

The engineering part is empirical. A prompt is a versioned component tested against representative cases, failure cases, and the exact model configuration that will run it. A clever instruction that worked once in a chat is a prompt experiment, not evidence of a reliable design.

## Origin and usage

The available primary record does not establish one inventor of the phrase. OpenAI's CLIP paper, submitted in 2021, contains a section titled "Prompt Engineering and Ensembling," showing that the term was already in technical use by then. Work around GPT-3 and related models helped popularize prompting as a practical discipline, but the historical record does not justify crediting a single person with coining it.

## Operational significance

Prompts are model-dependent software assets. A model upgrade, a new tool schema, a longer conversation, or a change in retrieved data can alter behavior without changing the prompt text. Keep evals beside important prompts, record the model and decoding settings, and remove instructions that no longer earn their token and attention cost.

Prompt changes also cannot enforce permissions or prove correctness. Authorization, schema validation, evidence checks, and side-effect controls belong in the surrounding system.

## Distinguish it from nearby terms

- Prompt engineering designs the instructions and demonstrations sent to a model.
- Context engineering owns the larger process that selects, structures, updates, and removes information across calls.
- Fine-tuning changes model parameters. Prompt engineering changes inference-time input.
- A specification states what a system must do. A prompt can communicate part of that intent, but it is not an enforceable contract by itself.

## Check your understanding

A prompt passes ten handpicked examples and fails after a model upgrade. Explain what was missing from the engineering process and which configuration should have been versioned with the prompt.

## Related terms

- [Prompt](https://darkfactory.dev/glossary/prompt)
- [Context engineering](https://darkfactory.dev/glossary/context-engineering)
- [One-shot prompting](https://darkfactory.dev/glossary/one-shot-prompting)
- [Few-shot prompting](https://darkfactory.dev/glossary/few-shot-prompting)

## Related factory areas

- [Intent capture & requirements](https://darkfactory.dev/factory/intent-requirements)

## Evidence and further reading

- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
- [OpenAI API: Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering)
- [Learning Transferable Visual Models From Natural Language Supervision](https://cdn.openai.com/papers/Learning_Transferable_Visual_Models_From_Natural_Language_Supervision.pdf)
- [You Cannot Whisper at an AI Agent](https://stripe.dev/blog/ai-steering-experiments)
- [We Cut 80% of Claude Code's Prompt](https://www.youtube.com/watch?v=qyPCVqFUyDo)
