Prompt engineering definition
Prompt engineering is the practice of designing, structuring, and refining the natural language input given to a generative AI model so that it produces a specific, reliable output. The input itself is the prompt, text that describes and prescribes the task the model should perform.
Prompt engineering is how you get a generative AI model to do a specific job reliably, by writing and rewriting the instruction it reads until the output is the one you wanted. In Sanity, that instruction is a first-class thing you author rather than a string buried in code: AI Assist calls a prompt an instruction, gives it a name, and lets you attach an AI Context document holding brand and style rules, so the person who owns the voice can edit it in the Studio.

What is a prompt, and how is it different from prompt engineering?
A prompt is the natural language text you give a generative AI model that describes and prescribes the task it should perform. Prompt engineering is the practice of writing, testing, and refining that text. The prompt is the artifact, and prompt engineering is the work of getting the artifact right.
A prompt can be a question, a command, or a longer statement that carries several things at once: instructions for the task, background context, worked examples, a required output format, and a role for the model to adopt. Wikipedia defines prompt engineering as "the process of structuring natural language inputs (known as prompts) to produce specified outputs from a generative AI model." The Oxford English Dictionary, quoted in the same article, calls it "the action or process of formulating and refining prompts for an artificial intelligence program, algorithm, etc., in order to optimize its output."
One thing a prompt does not do is change the model. Whatever the model appears to learn from the examples in a prompt, a behavior called in-context learning, lasts only for that request. Fine-tuning changes a model's weights and persists, and prompting does not.
Why does prompt engineering work at all?
Prompt engineering works because generative AI models are measurably sensitive to how an instruction is worded and arranged, not just to what it asks for. Two prompts that mean the same thing to a human reader can produce very different accuracy from the same model.
The clearest published measurement of this is Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design (Sclar, Choi, Tsvetkov, and Suhr, ICLR 2024), which found a spread of up to 76 accuracy points across semantically equivalent prompt formats, with a median spread of 7.5 points across model and task pairs. The headline figure comes from open-weight models in few-shot settings rather than every model on every task, but the direction holds: formatting choices that look cosmetic are not. The Prompt Report (arXiv:2406.06608, June 2024) reports a related result, that simply reordering the examples inside a prompt has produced accuracy shifts of more than 40 percentage points.
That sensitivity is the reason prompt engineering exists as a practice. If wording did not matter, writing the instruction once would be enough.
What are the main prompt engineering techniques?
The named prompt engineering techniques worth knowing are zero-shot, few-shot, chain-of-thought, tree-of-thought, role assignment, self-consistency, and retrieval-augmented generation.
Zero-shot prompting asks for the task with no examples. Few-shot (or multi-shot) prompting includes a handful of worked examples in the prompt so the model can infer the pattern. Chain-of-thought prompting asks the model to work through intermediate steps before answering, which tends to help on reasoning tasks. Tree-of-thought extends that to several branching lines of reasoning. Role assignment tells the model who to be ("you are a technical editor reviewing release notes"). Self-consistency samples several answers and takes the most common one. Retrieval-augmented generation pulls relevant documents into the prompt at request time so the model answers from real source material rather than memory.
There is no settled vocabulary for any of this yet. The Prompt Report, a systematic survey published in June 2024, catalogued 58 text-only prompting techniques, 40 more for other modalities, and 33 competing terms for describing them. Expect the same technique to appear under different names in different vendor documentation.
How is prompt engineering different from context engineering?
Prompt engineering covers the wording and structure of the instruction. Context engineering covers everything else that lands in the model's
Prompt engineering is a subset of context engineering, and it is the part a non-programmer can own. Anthropic's engineering post Effective context engineering for AI agents, published September 29, 2025, frames context engineering as the evolution of prompt engineering as systems move from single prompts to agents. Gartner is tracking the same shift. Context engineering practices include token budgeting, provenance tags, versioning of context artifacts,
In a production system, the instruction the model reads is rarely one authored string. It is assembled at runtime from layers owned by different parties, including the model provider's own
Is prompt engineering still a job?
Prompt engineering remains a normal part of building with AI, but the standalone job title has become less common. Wikipedia's account is that employees carrying the title prompt engineer were hired during the 2020s AI boom, "although the individual title has since become less common amid AI models that produce better prompts than humans and corporate training in prompting for general employees."
The pattern we see is that the skill has spread sideways instead of disappearing. Editors, marketers, support leads, and analysts write instructions for AI tools as part of their normal work, and the interesting question has shifted from who writes the prompt to where the prompt lives and who is allowed to change it. A prompt that encodes brand voice, legal constraints, or tone rules is a piece of organizational policy, and keeping it in application code means the people who own that policy cannot change it.
As a footnote on how fast the vocabulary moved: "prompt" was runner-up for Oxford's word of the year in 2023, defined as "an instruction given to an artificial intelligence program, algorithm, etc., which determines or influences the content it generates."
How do you apply prompt engineering inside a content system?
In a content system, prompt engineering means writing the instruction where the content and the people who own it already are, not in application code. Sanity is the Content Operating System for the AI era, the intelligent backend for companies building AI content operations at scale, and it treats the prompt as something you author and name rather than something you deploy.
In AI Assist, a plugin for Sanity Studio, a prompt is called an instruction. The documentation says so directly: "You might be familiar with the term prompt; it's called instruction for AI Assist... you can bring techniques and methodologies from prompt engineering here, too." Editors write instructions in plain language at document level or field level, give each one a name and an icon, and keep it private or flip a switch to make it visible to all Studio members. An instruction can pull in a named document field, a user input box filled in at run time, or an AI Context document, a reusable context document managed in the Studio that typically holds brand and style guides. An "Allowed fields" control limits which fields the instruction may write to, and every instruction runs with the permissions of the person who ran it.
For programmatic work, Agent Actions (marked experimental in the docs) uses the same vocabulary. Generate, Transform, and Prompt each take an `instruction` string, Translate takes a `styleGuide` instead, and data is passed in through `instructionParams` referenced with a `$` prefix. As the docs put it: "If you've used other AI tools, instructions are like prompts."
Explore Sanity Today
Understanding prompt engineering is just the beginning. Take the next step and discover how Sanity can enhance your content management and delivery.
Last updated: