Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Legal contract analysis
on Claude 3.5 Sonnet

Stop guessing. See how professional prompt engineering transforms Claude 3.5 Sonnet's output for specific technical tasks.

The "Vibe" Prompt

"Analyze this legal contract and tell me the most important parts. What are the risks and benefits for my company? Summarize it for a business executive. Focus on the money and deadlines."
Low specificity, inconsistent output

Optimized Version

STABLE
You are an expert legal analyst specializing in contract review for corporate clients. Your task is to perform a comprehensive analysis of the following legal contract. Prioritize clarity, accuracy, and actionable insights. Follow a Chain-of-Thought process. CONTRACT TEXT: {contract_text} **CHAIN OF THOUGHT:** 1. **Identify Contract Type & Parties:** Determine the nature of the agreement (e.g., MSA, SOW, Lease,NDA) and clearly identify all parties involved, including their roles. 2. **Key Objective & Consideration:** Ascertain the primary purpose of the contract and the main consideration exchanged by each party. 3. **Core Obligations & Deliverables:** Detail the specific duties, responsibilities, and deliverables for each party. Note any dependencies or conditions precedent. 4. **Financial Terms Analysis:** a. **Payments:** Identify all payment amounts, schedules, currencies, and methods. Note any late payment penalties or discounts. b. **Expenses:** Detail who is responsible for which expenses and any caps or reimbursement processes. c. **Termination Costs:** Identify any costs associated with early termination. 5. **Term & Termination Clauses:** a. **Duration:** State the initial term, renewal provisions, and conditions for automatic renewal or non-renewal. b. **Termination Rights:** List all conditions under which either party can terminate the contract (e.g., breach, insolvency, convenience) and required notice periods. c. **Post-Termination Obligations:** Detail any obligations that survive termination (e.g., confidentiality, return of property). 6. **Representations & Warranties:** Summarize the key assurances and guarantees made by each party. 7. **Indemnification & Liability:** a. **Indemnification:** Detail who indemnifies whom and under what circumstances. b. **Limitation of Liability:** Identify any caps, exclusions, or types of damages excluded (e.g., indirect, consequential). 8. **Dispute Resolution:** Outline the prescribed methods for resolving disputes (e.g., negotiation, mediation, arbitration, litigation, governing law, jurisdiction). 9. **Intellectual Property (if applicable):** Summarize ownership, licensing, and usage rights for any IP involved. 10. **Confidentiality:** Detail the scope, duration, and exceptions of confidentiality obligations. 11. **Risk Assessment:** a. **Identify Key Risks for [Your Company Name/Client]:** Based on the above analysis, pinpoint a minimum of 3-5 high-priority risks (e.g., financial exposure, compliance issues, operational burdens, unfavorable termination clauses, broad indemnities, inadequate IP protection). b. **Mitigation Suggestions:** For each identified risk, propose practical strategies to mitigate or address them. 12. **Key Benefits for [Your Company Name/Client]:** Outline the primary advantages and gains this contract offers. 13. **Executive Summary:** Synthesize the most critical information into a concise, high-level summary (max 200 words) suitable for a business executive, focusing on strategic implications, key financial commitments, deadlines, and principal risks/benefits. 14. **Actionable Recommendations:** Provide specific, concise recommendations for proceeding (e.g., 'approve as is,' 'consult legal on X,' 'negotiate Y and Z,' 'reject if A is not resolved'). **OUTPUT FORMAT:** Provide the analysis in a structured markdown format with clear headings for each section of the Chain of Thought. Ensure the Executive Summary and Actionable Recommendations are prominently displayed at the end.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages several techniques to enhance Claude 3.5 Sonnet's performance for legal contract analysis. Firstly, it establishes a clear persona ('expert legal analyst'), setting expectations for the depth and quality of the analysis. Secondly, it explicitly outlines a detailed Chain-of-Thought process, breaking down the complex task into manageable, sequential steps. This forces the model to systematically process information, reducing the likelihood of omissions and improving logical coherence. Each step targets a specific aspect of contract law, ensuring comprehensive coverage (e.g., financial terms, indemnification, IP). Thirdly, it clearly defines the desired output format, making the results consistent and easy to consume. By asking for specific 'Key Risks' and 'Key Benefits' for 'Your Company Name/Client' (with placeholders), it ensures the analysis is tailored and actionable. The final Executive Summary and Actionable Recommendations sections address the executive's need for high-level insight and clear next steps, directly addressing limitations of the naive prompt. This structure guides the model to produce a more thorough, accurate, and useful analysis, minimizing hallucinations and ensuring all critical aspects are covered.

%
Token Efficiency Gain
The optimized prompt explicitly asks for a 'Chain of Thought' process, guiding structured reasoning.
The optimized prompt specifies an 'Executive Summary' focusing on 'strategic implications, key financial commitments, deadlines, and principal risks/benefits', addressing the naive prompt's core request more effectively.
The optimized prompt details specific sections for 'Financial Terms Analysis' (payments, expenses, termination costs) and 'Term & Termination Clauses' (duration, termination rights, post-termination obligations), ensuring critical details are covered.

Ready to stop burning tokens?

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

Optimize My Prompts