Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
on Gemini 1.5 Pro

Stop guessing. See how professional prompt engineering transforms Gemini 1.5 Pro's output for specific technical tasks.

The "Vibe" Prompt

"Analyze this legal contract and tell me everything important about it. What are the key clauses? Any risks? What should I be aware of?"
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly experienced and meticulous legal contract analyst specializing in [CONTRACT_TYPE, e.g., commercial lease agreements, software licensing, employment contracts]. Your task is to perform a comprehensive legal analysis of the provided contract. Follow these steps meticulously: 1. **Identify Contract Parties and Effective Date:** Clearly state who the parties are and the contract's effective date. 2. **Summarize Purpose and Scope:** In one paragraph, explain the contract's primary objective and the scope of its coverage. 3. **Extract Key Obligations (Party A):** List all significant obligations of Party A, citing the relevant clause numbers or sections. Do not interpret, just extract. 4. **Extract Key Obligations (Party B):** List all significant obligations of Party B, citing the relevant clause numbers or sections. Do not interpret, just extract. 5. **Identify and Summarize Critical Clauses:** Focus on clauses impacting liability, termination, indemnification, warranties, dispute resolution, governing law, and intellectual property. For each, provide a concise summary (1-2 sentences) and its clause number. * **Liability Limitations/Exclusions:** * **Termination Rights and Conditions:** * **Indemnification Provisions:** * **Warranties and Disclaimers:** * **Dispute Resolution Mechanisms:** * **Governing Law and Jurisdiction:** * **Intellectual Property Rights:** 6. **Assess Key Risks and Potential Issues:** Based on your analysis, identify at least three significant legal or commercial risks for [TARGET_PARTY, e.g., 'the Client' if the prompt implies one side, or 'both parties' if neutral]. For each risk, explain why it's a risk and suggest a potential mitigation strategy or area for further negotiation. 7. **Identify Missing or Ambiguous Provisions:** Point out any clauses that are notably absent or are ambiguously worded, which could lead to future disputes. 8. **Provide High-Level Recommendations:** Offer 2-3 actionable recommendations for someone reviewing or negotiating this contract. These should be concise and strategic. 9. **Key Terms/Definitions:** List any defined terms that are crucial for understanding the document, along with their definitions as stated in the contract. **Contract Text:** ``` [PASTE_CONTRACT_TEXT_HERE] ``` **Output Format:** Provide your analysis in a clear, structured markdown format using headings for each step, and bullet points for lists where appropriate.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages several techniques to enhance performance. It defines a persona ('highly experienced and meticulous legal contract analyst') to set the right tone and expertise. It uses chain-of-thought by breaking down the complex task into sequential, numbered steps, guiding the model through a logical process. Crucially, it provides specific instructions for each step (e.g., 'Do not interpret, just extract' for obligations, '1-2 sentences' for critical clauses summary), reducing ambiguity and ensuring relevant information is extracted. The prompt also specifies the desired output format (structured markdown), which improves readability and consistency. By explicitly asking for risks, mitigations, missing provisions, and recommendations, it pushes the model beyond mere summarization to critical analysis. The placeholder `[CONTRACT_TYPE]` and `[TARGET_PARTY]` allows for dynamic tailoring, making the prompt more versatile. This structure minimizes the model's need to 'guess' what is important or how to present findings, leading to more accurate, comprehensive, and consistent results.

%
Token Efficiency Gain
Optimized prompt will produce a more structured output than the naive prompt.
Optimized prompt will more reliably identify specific legal risks and suggest mitigations than the naive prompt.
Optimized prompt will be less prone to hallucination regarding clause interpretation due to explicit 'do not interpret, just extract' instructions in early steps.

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts