Prompt Engineering for Lawyers: A Beginner's Glossary
Twenty terms every lawyer needs to know before using AI tools in legal work — in plain English, with a legal example for each.
Prompt engineering, for a lawyer, is the practice of instructing an AI tool precisely enough (role, task, sources, format, and constraints) that its output is useful on the first or second try instead of vague, generic, or wrong. You don’t need to understand machine learning to do this well. You need to understand roughly twenty terms, most of which map onto habits you already have from drafting a good instruction letter to a junior. This glossary covers them, in plain English, with a legal example for each.
Core AI Concepts
Large language model (LLM) The underlying AI system (ChatGPT, Claude, Gemini, or a legal-specific tool built on top of one of these) that generates text in response to your prompt. It predicts plausible next words based on patterns in its training data, which is precisely why it can produce confident, fluent text that is also factually wrong.
Prompt The instruction you give the AI. Everything from “summarise this contract” to a five-paragraph brief with attached documents, a defined role, and formatting rules is a prompt. Quality of output tracks quality of prompt more closely than most lawyers expect.
Prompt engineering The skill of structuring a prompt to reliably get accurate, appropriately scoped output. In legal use, this usually means specifying jurisdiction, role, source material, and output format explicitly rather than assuming the AI will infer them.
System prompt An instruction set applied before your own prompt, usually by the tool provider or your firm, that shapes how the AI behaves throughout a session: for example, “always cite sources” or “flag any answer you’re not confident about.” Some legal AI platforms let firms customise this to enforce verification habits by default.
Context window The amount of text (your prompt, any attached documents, and the AI’s own responses) the model can “see” at once. Once a conversation or document exceeds the context window, earlier material effectively falls out of view, which is why long negotiations or lengthy contracts sometimes cause an AI tool to contradict something it said or read three exchanges earlier.
Token The unit AI models process text in, roughly three-quarters of a word in English. Token limits are what create context window limits, and they’re why very long documents sometimes need to be summarised or split before an AI tool can work with them reliably.
Temperature A setting controlling how deterministic or creative a model’s output is. Lower temperature produces more consistent, conservative output; higher temperature produces more varied phrasing. Most legal research and drafting tasks call for the lower end; you want the same accurate answer twice, not creative variation.
Prompting Techniques
Zero-shot prompting Asking the AI to complete a task with no examples provided: “draft a without-prejudice letter on these facts.” Fine for simple, well-defined tasks; unreliable for anything where format or tone matters.
Few-shot prompting Giving the AI one or more examples of the output you want before asking for the real thing: pasting a precedent letter, then asking it to draft a new one in the same style. This is one of the single most effective techniques for legal drafting, because it anchors tone and structure to something concrete rather than the model’s generic defaults.
Chain-of-thought prompting Asking the AI to reason through a problem step by step before giving a final answer, rather than jumping straight to a conclusion. For example: “first identify each element of the cause of action, then assess whether the facts satisfy each one, then state your conclusion.” This tends to catch errors that a direct “just tell me the answer” prompt would miss.
Role prompting Telling the AI who to act as (“you are a senior commercial litigator reviewing this pleading for weaknesses”), which shapes the depth, register, and focus of its response. A role prompt won’t make the AI actually competent, but it will make its output closer in style and priorities to what a lawyer in that role would produce.
Prompt chaining Breaking a complex task into a sequence of smaller prompts, where each step’s output feeds the next (extract the key clauses, then compare them against a checklist, then draft an issues list) rather than asking for everything in one instruction. This generally produces more reliable results than one large, vague prompt.
Iterative prompting Refining a prompt across multiple rounds based on what the AI got wrong (“that’s too informal, redraft in a more formal register”) instead of expecting the first attempt to be final. Treat the first output as a draft to interrogate, not a finished answer.
Legal-Specific Terms
Hallucination When an AI tool produces plausible-sounding but false information, most dangerously citations to cases, statutes, or quotations that don’t exist. This is the single most important term in this glossary. UK, Indian, and US courts have all sanctioned lawyers for filing documents containing hallucinated citations that were never checked.
Grounding Connecting an AI tool’s output to a verified, retrievable source (a specific case report, a section of a statute, a paragraph of a contract) rather than letting it generate text purely from patterns in its training data. Grounded answers can be checked; ungrounded ones can only be trusted or not.
Retrieval-augmented generation (RAG) The technical approach many legal AI tools use to reduce hallucination: instead of generating an answer purely from memory, the system first retrieves relevant material from a live, verified database (case law, legislation, your own document set) and then generates an answer based on what it retrieved. It’s why some legal AI products can cite a specific paragraph of a specific judgment and others can’t.
Context (in a legal prompt) The facts, jurisdiction, procedural posture, and relevant documents you give the AI before asking your question. Vague context produces vague or wrong answers; a prompt that says “assess this clause under English contract law, in the context of a share purchase agreement, where the buyer has already completed” will outperform “is this clause enforceable?” every time.
Output format specification Telling the AI exactly what shape you want the answer in (a table, a numbered issues list, a memo with headings, a redline with tracked changes) rather than leaving it to guess. This is one of the fastest ways to cut down on unusable first drafts.
Guardrails Rules built into a tool or a firm’s AI policy that constrain what the AI can do or say: refusing certain categories of request, forcing a disclaimer, or requiring a citation for every factual claim. Guardrails can sit inside the tool itself or be enforced by firm policy around how the tool is used.
Human-in-the-loop A workflow design where a qualified person reviews and approves AI output before it’s relied on or sent, rather than the AI’s output being used automatically. Every credible legal AI governance policy makes this mandatory for anything client-facing.
Risk and Safety Terms
Prompt injection An attack or accident where text within a document you’ve asked the AI to process (a hidden instruction buried in a PDF, for instance) overrides or manipulates the AI’s intended behaviour. A growing concern as more firms feed AI tools external documents like discovery material or opposing counsel’s filings.
Data leakage The risk that information entered into an AI tool is retained, logged, or used to train the underlying model, potentially exposing client-confidential material beyond the firm. This is why firm AI policies typically distinguish between tools with a data processing agreement and general-purpose consumer tools that offer no such guarantee.
Bias Systematic skew in AI output that reflects patterns — including unfair ones — present in the model’s training data. Relevant to legal AI in contexts like predictive tools, sentencing-adjacent analysis, or any use case where the AI is asked to generalise from historical data that may itself encode discrimination.
A Five-Part Formula for a Good Legal Prompt
Most well-engineered legal prompts contain the same five elements, in roughly this order:
- Role: who the AI should act as (“you are reviewing this as opposing counsel would”).
- Task: a precise verb and object (“identify every clause that shifts liability onto the buyer”).
- Sources: the specific document, statute, or case law the AI should rely on, attached or named.
- Format: the shape of the output you want back.
- Constraints: jurisdiction, tone, length, and anything explicitly out of scope.
A prompt missing two or more of these is the most common reason AI output disappoints a lawyer on the first try.
Frequently Asked Questions
Do lawyers need to learn to code to do prompt engineering? No. Prompt engineering for legal work is a writing and instruction-giving skill, closer to briefing a junior colleague clearly than to programming.
What’s the difference between prompt engineering and just using AI? Anyone can type a question into an AI tool. Prompt engineering is doing it deliberately — specifying role, context, sources, and format — so the output is reliable enough to build on rather than something you have to heavily rework or verify from scratch.
Why do lawyers need to know what “hallucination” means? Because it’s the risk behind most reported cases of lawyers being sanctioned for AI use. Understanding what causes hallucination, and that grounded, retrieval-based tools reduce but don’t eliminate it, is the foundation of using AI safely in legal work.
What is the single most useful prompting technique for lawyers? Few-shot prompting: giving the AI an example of the output you want, such as a precedent document, before asking it to produce something new. It consistently outperforms describing the desired format in the abstract.
Is prompt engineering going to become obsolete as AI tools improve? The specific tricks will keep changing, but the underlying skill — giving clear instructions with the right context, sources, and constraints — is closer to good legal drafting practice than to a technical fad, and is likely to remain useful even as tools get better at inferring intent.
The AI Bar’s AI Foundations for Lawyers module covers these techniques hands-on, with legal workflows and prompts you can reuse. For the verification habits that pair with good prompting, see Legal Research with AI.