The Ultimate Guide to Legal Prompt Engineering
Effective legal prompt engineering is key for legal professionals who want to maximize the impact of their generative artificial intelligence (genAI) tools. And with the recent explosion of genAI usage within corporate legal departments, there is perhaps no better skill for in-house legal professionals to learn than legal prompt engineering.
In this guide, we’ll provide an overview of what legal prompt engineering is, showcase examples of how prompt engineering can be used with genAI tools to streamline your legal department’s workflows, and highlight some ‘do’s and don’ts’ for putting together prompts for your legal tech solution.
What is Legal Prompt Engineering?
Legal prompt engineering is the process of creating natural language instructions (or ‘prompts’) for legal generative AI tools to execute. These prompts are what legal AI tools use to generate an output (e.g. an answer to a question, a new piece of content, an action performed on the user’s behalf, etc.).
Say, for example, you wanted to know how many matters your legal department worked on last year that required over $100,000 in outside counsel spend. To find the answer, you could create a prompt using legal prompt engineering and enter it into a genAI tool like Ask Brightflag.
In this case, the prompt would likely be something along the lines of “How many matters did we work on last year with over $100,000 in outside counsel spend?” The legal AI tool would then interpret your prompt, retrieve the information you requested, and provide you with an answer.
Because legal AI tools rely on the information provided by prompts to create and refine their outputs, effective prompt engineering is vital for maximizing a legal AI tool’s capabilities.

The 4 Keys to Effective Legal Prompt Engineering
Legal prompt engineering might seem fairly straightforward. And the process can be as simple as typing a question or request that a generative AI tool’s large language model (LLM) can easily interpret and act upon.
However, engineering prompts for more complex use cases can require a bit of trial and error to get right. Think of the process as delegating a task to a new and relatively inexperienced colleague; they’ll rely heavily on the relevant context you provide to give you the best result. Similarly, generative AI tools rely on the information within your prompt to return a satisfactory response.
Here are four key factors to keep top-of-mind when engineering prompts for your legal AI tool:
Clarity
While you don’t have to be perfect when crafting your initial prompt, the more clear you are in your request, the easier it will be for your legal AI tool to produce a desired output that meets your expectations.
Let’s say, for example, you wanted to use Ask Brightflag to find out the outside counsel law firms you’ve spent the most with over the last year. You could create the following prompt:
“Show me a breakdown of our outside counsel spend from the past year.”
Ask Brightflag’s AI would give you the full spend breakdown based on that prompt, but you’d still have to sort through that data manually to find the top firms.
To take that additional step off your plate and get the exact results you wanted, you could instead create a prompt that read:
“Show me a list of the three outside counsel firms we spent the most with last year, along with the amount that we spent with each firm.”
In this instance, a small tweak to the phrasing helps produce the exact result you’re looking for from your legal AI tool, and cuts down on the time you might spend parsing through the data yourself.
Iteration
One aspect of generative AI tools that sets them apart from search engines like Google or Bing is that they allow prompts to be iterated upon. That means you can continue to tweak generative AI outputs through a process called “prompt chaining” until the results meet your expectations.
Let’s say, for example, you’d like to prompt a legal AI tool to summarize all invoices that are pending approval. Your prompt might read something like:
“Show me a list of pending invoices.”
However, the list of invoices provided by the legal AI tool may be longer than you expected, and therefore difficult to parse. In this case, you could create a follow-up prompt like:
“Group the invoices by internal matter lead.”
Or
“Which invoices have been pending for over 5 days?”
By chaining AI prompts like these together to refine your results, you end up with an output that’s formatted exactly the way you want.
Context
Your legal AI tool likely has access to a huge breadth of knowledge and resources, which it uses to generate responses to your prompts. However, it sometimes lacks the specialized, deep understanding of certain topics that your in-house team possesses regarding the work being done. That’s why it’s important to provide as much context as possible when conducting legal prompt engineering.
You can do this through a process called “priming,” which involves outlining all the pertinent details of your request for the genAI tool in your prompts. This might include relevant case details, jurisdictional information, etc.
By providing your AI tool with all the context it needs to fully understand your request, you can ensure you get the most accurate, helpful response possible.
Formatting and Objectives
Are you looking to condense a report on legal spend into a concise overview email you can share with your General Counsel? Or do you want to summarize the key takeaways of that same report into a presentation you’ll be delivering to your organization’s Finance team?
What you plan to do with the data you get from your legal AI tool will determine the ideal format of its outputs, so it’s always best to specify your goals—and how you want your datasets to look—when conducting legal prompt engineering.
Legal Prompt Engineering Do’s and Don’ts
Do: Experiment with Your Prompts
Finding the right phrasing for your prompts—or learning to refine a AI responses through prompt chaining—takes time and experimentation. Don’t hesitate to try a few different methods to see what delivers the best results when legal prompt engineering.
Even experimenting with prompting for tasks outside of work using generative AI tools like ChatGPT can be helpful. Something as simple as generating a prompt to find a dinner recipe that you’ll enjoy or summarizing a complex news article can help with gaining a deeper understanding of the fundamentals of prompt engineering.
Don’t: Hesitate to Give a Generative AI Tool a Spin
It takes time to get comfortable using any new piece of technology. If you’re not yet in the habit of using generative AI tools to assist you with your workflows, try to remember to give them a try the next time you hit a roadblock or need an extra hand with certain legal tasks. The sooner it becomes second nature to lean on an AI system when you’re in a pinch, the quicker you’ll begin seeing its benefits.
Here at Brightflag, we even offer personalized tours of our cutting-edge genAI tool, Ask Brightflag. If you’re interested to see it in action, be sure to book a demo.
Do: Double-check Responses for Accuracy
Generative AI is an incredible tool when it comes to increasing efficiency for in-house legal professionals. But it, too, can make mistakes.
It’s always a good idea to look over the responses you receive from your legal AI tool with a discerning eye to ensure it has produced the high-quality results you were looking for. Some legal AI tools, like Ask Brightflag, will provide an overview of how the AI model interpreted your query and made decisions, to make it easy to follow and validate its logic.
Getting Started with Legal Prompt Engineering and Legal AI Tools
Learning the ins and outs of legal prompt engineering takes time. But with a clear idea of the output you’re aiming for in mind—and a little trial and error—you can begin generating prompts for your legal AI tool(s) that will meaningfully impact your legal department’s workflows.
And if you’re just getting started on your AI journey within the legal field, come see how Brightflag’s intuitive, AI-powered e-billing and matter management platform can help. Book a demo with us today, and learn how features like Ask Brightflag—the first genAI assistant for legal spend and matters—can transform your in-house team’s ability to understand and improve their legal service delivery.