5.1 Prompt Engineering Fundamentals
Prompt engineering is the discipline of designing inputs that elicit desired outputs from AI systems. For legal drafting, effective prompts must convey context, constraints, format requirements, and quality standards to produce usable drafts.
The CRAFT Framework for Legal Prompts
- Context: Provide background - jurisdiction, parties, purpose, legal framework
- Role: Define the AI's role - "Act as an experienced Indian litigation lawyer"
- Action: Specify the task - "Draft a plaint for recovery of money"
- Format: Describe output format - structure, length, style, numbering
- Tone: Set the appropriate tone - formal court language, client-friendly, etc.
Prompt Components Deep Dive
| Component | Purpose | Legal Drafting Example |
|---|---|---|
| System Context | Set overall behavior | "You are a legal drafting assistant trained on Indian law" |
| Task Definition | Specify what to do | "Draft a demand notice under Section 138 NI Act" |
| Constraints | Set boundaries | "Do not exceed 2 pages; use only established legal principles" |
| Examples | Show desired output | "Structure similar to the attached template" |
| Output Format | Define structure | "Use hierarchical numbering 1.1, 1.1.1" |
5.2 Prompt Patterns for Legal Documents
Different document types require different prompt patterns. Understanding these patterns helps you craft prompts that consistently produce high-quality drafts.
Pattern 1: Template Completion
Best for: Standard documents with established formats (contracts, notices, applications)
Pattern 2: Issue-Analysis-Document
Best for: Complex matters requiring analysis before drafting (petitions, written statements)
Pattern 3: Adversarial Review
Best for: Quality improvement and identifying weaknesses
For complex legal analysis, use chain-of-thought prompting: "Think through this step by step. First, identify the applicable law. Then, analyze how the facts match each element. Finally, draft the relevant provision." This produces more reasoned and accurate outputs.
5.3 Document-Specific Prompt Strategies
Each type of legal document has unique requirements. Tailoring your prompts to document type dramatically improves output quality.
Contracts and Agreements
Pleadings
Legal Notices
5.4 Iterative Refinement Techniques
Rarely does a single prompt produce a perfect document. Iterative refinement - progressively improving outputs through targeted follow-up prompts - is essential for high-quality results.
Refinement Workflow
- Initial Draft: Generate first version with comprehensive prompt
- Structural Review: "Review the structure. Is anything missing per CPC requirements?"
- Legal Accuracy: "Verify all legal citations and principles are current and correct"
- Language Polish: "Improve clarity and precision. Replace vague terms with specifics"
- Adversarial Review: "Identify weaknesses from opposing counsel's perspective"
- Final Revision: "Incorporate all feedback into a final polished version"
Common Refinement Prompts
- "Make it more specific": "Replace all instances of 'reasonable time' with exact days/dates"
- "Add authority": "Add relevant case citations supporting each legal argument"
- "Improve structure": "Reorganize for better logical flow from issue to conclusion"
- "Simplify": "Rewrite complex sentences for clarity without losing legal precision"
- "Expand": "Elaborate on the cause of action with more specific facts"
- "Condense": "Reduce to essential points without losing material facts"
In long iterative sessions, AI may "forget" earlier instructions. Periodically remind it of core requirements: "Remember: this is for Indian courts, use formal language, follow CPC structure."
5.5 Building Your Prompt Library
Effective legal AI users build and maintain a library of proven prompts. This saves time and ensures consistency across similar matters.
Organizing Your Prompt Library
| Category | Document Types | Key Variations |
|---|---|---|
| Contracts | NDA, Service Agreement, Employment, Sale | By industry, complexity, jurisdiction |
| Pleadings | Plaint, WS, Counter Claim, Rejoinder | By cause of action, court level |
| Petitions | Writ, Bail, Quashing, Revision | By writ type, offence category |
| Applications | Interim, Stay, Discovery, Execution | By relief sought, stage of proceedings |
| Notices | Demand, Section 138, Section 80, C&D | By statutory requirement, purpose |
| Client Comms | Engagement, Opinion, Status, Advisory | By complexity, client type |
Prompt Template Best Practices
- Use Placeholders: Mark variable inputs clearly: [CLIENT NAME], [AMOUNT], [DATE]
- Version Control: Date your prompts and track what works
- Document Results: Note which prompts produce best outputs
- Share Knowledge: Create team-wide prompt libraries for consistency
- Regular Updates: Update prompts when law changes or better techniques emerge
Key Takeaways
- CRAFT Framework: Context, Role, Action, Format, Tone for comprehensive prompts
- Prompt Patterns: Template completion, issue-analysis-document, adversarial review
- Document-Specific: Tailor prompts to document type requirements
- Iterative Refinement: Use targeted follow-ups to improve outputs
- Prompt Library: Build and maintain organized collection of proven prompts
