How to build a legal summary generator in Microsoft Copilot
This tutorial shows how to build a legal summary generator in Microsoft Copilot to extract and summarize key contract clauses. Such an assistant saves time on document review and highlights important risks and obligations.
Prerequisites
- Account with access to Microsoft Copilot (profile with permissions to create prompts/assistants).
- Contract files in OneDrive or SharePoint accessible to Copilot (PDF or Word).
- Basic knowledge of legal terminology and the fields you want to extract (term, indemnity, confidentiality, etc.).
- Text editor to create prompts and, optionally, Power Automate to integrate the workflow.
Step 1: Define the fields you want to extract
Before creating the assistant, list the clauses and metadata that are essential. Example: "Parties", "Effective Date", "Term", "Confidentiality", "Indemnity", "Termination Clauses" and "Risks/notes". This definition guides the prompt and the output structure.
Step 2: Create a clear extraction prompt
Write a prompt that tells Copilot exactly what to look for and the output format (JSON or list). Be explicit about the behavior when a clause does not exist. Example of a minimal functional prompt:
Extract the following fields from the contract document: Parties, EffectiveDate, Term, Confidentiality, Indemnity, Termination, Notes.
Return a JSON object with these keys. If a field is not present, return an empty string. Keep Notes concise (1-2 sentences) and flag any clauses that impose unusually high risk.
Document:
{contract_text_or_url}
Step 3: Test the prompt in Microsoft Copilot
Paste the prompt into Copilot and replace {contract_text_or_url} with the contract text or the file link in OneDrive/SharePoint. Review the output and adjust the prompt to better capture language variants (synonyms like "agreement" vs "contract"). Examples of adjustments: request supporting sentences to justify each extracted field.
Step 4: Structure the output as a readable summary
To create a useful final summary, ask Copilot to produce two sections: a JSON block for automatic ingestion and a natural language summary for quick reading. Example prompt for the combined output:
First, output a JSON with keys: Parties, EffectiveDate, Term, Confidentiality, Indemnity, Termination, Notes.
Then, provide a short human-readable summary (max 6 bullets) highlighting key obligations and any high-risk clauses.
Document:
{contract_text_or_url}
Step 5: Automate with Power Automate (optional)
If you want to process multiple contracts, create a simple flow in Power Automate that triggers when a file is placed in a SharePoint folder and sends the content to Microsoft Copilot (or use an API call if available). The flow can store the resulting JSON in a SharePoint list or in a CSV file.
// Conceptual example (pseudo-steps for Power Automate)
1. Trigger: When a file is created in folder (SharePoint)
2. Action: Get file content
3. Action: Send content to Copilot prompt (usar conector/serviço ou chamar API externa)
4. Action: Parse JSON response
5. Action: Create item in SharePoint list with parsed fields
Step 6: Handle common errors
Typical errors include: Copilot not finding clauses due to highly variable language, scanned texts with poor OCR, or insufficient file permissions. To mitigate: provide example phrases in the prompt, use high-quality OCR before sending, and verify OneDrive/SharePoint permissions.
Verify the result
Open the generated JSON and confirm each field contains coherent information. Compare the human summary with the original text: the main parts (dates, term, confidentiality, indemnity) should be correctly identified. Test with multiple contracts (short, long, with diverse language) to validate robustness.
Conclusion
With this legal summary generator in Microsoft Copilot you reduce triage time and gain a quick view of contractual risks. Next steps: refine prompts for specific contexts (physical vs. SaaS), add risk classification templates and integrate notifications in Teams. Try it out: which clause is usually hardest to extract in your contracts?