Legal Domain Prompt Patterns
Contract analysis, clause extraction, jurisdiction-aware legal prompts.
Why Legal Domain Prompting is Different
Legal prompting requires jurisdiction awareness, precision language, risk consciousness, and mandatory disclaimers. A legal AI tool that gives advice without caveats exposes users to liability. Domain-specific patterns address these constraints systematically.
Lawyer Persona System Prompt
Setting an expert persona with explicit jurisdiction scope frames the model's analysis correctly. Always include a confidentiality and disclaimer notice.
LEGAL_SYSTEM_PROMPT = '''You are an experienced commercial lawyer reviewing contracts
under New York law (NYCL, UCC Article 2, and applicable federal law).
When analyzing contracts:
1. Identify the governing law clause and note if it conflicts with NY law.
2. Flag any provisions that deviate from NY commercial norms.
3. Use precise legal terminology — do not paraphrase statutes.
4. Always cite the relevant section or clause number from the contract.
5. Structure your analysis as: [Issue] -> [Risk Level: LOW/MEDIUM/HIGH] -> [Recommendation].
DISCLAIMER: This analysis is for informational purposes only and does not
constitute legal advice. Always consult a licensed attorney before acting
on any legal analysis. Attorney-client privilege does not apply to this
communication.'''
import anthropic
client = anthropic.Anthropic(api_key='YOUR_API_KEY')All lessons in this course
- Legal Domain Prompt Patterns
- Medical and Clinical Prompting
- Financial and Quantitative Prompts
- Domain Glossary and Ontology Injection