Automate NDA Review with AI: Flag Risk Clauses Before You Sign
Build an NDA review automation system using LegalGuard AI API. Extract key terms, score risk clauses, and generate plain-English summaries in seconds.

Non-disclosure agreements are the most signed contracts in business — and the most under-reviewed. Most employees sign NDAs without reading them. Legal teams at growing companies review hundreds per year, burning hours on boilerplate that still contains buried risk clauses: overly broad scope definitions, perpetual confidentiality terms, unreasonable carve-outs, or one-sided remedy provisions.
AI-powered NDA review changes this calculus. This guide shows how to build a complete NDA analysis system using LegalGuard AI API — one that extracts key terms, scores clause risk, and generates a plain-English summary that non-lawyers can actually use.
The NDA Review Problem
A standard NDA contains 15–25 individual clauses. For a series-stage startup processing vendor NDAs, customer confidentiality agreements, and employment NDAs, that's easily 300 clauses per month requiring review.
Key risks that get missed in manual review:
- Overbroad definitions of "Confidential Information" that could be interpreted to cover publicly available information
- Perpetual confidentiality obligations with no sunset date (standard is 2–3 years)
- Unlimited remedies clauses that waive damage caps
- Assignment provisions allowing the counterparty to transfer your confidentiality obligations to acquirers
- Jurisdiction and governing law clauses creating adverse litigation positions
Building an automated system that catches these issues pre-signature is worth significant legal spend savings.
Architecture
NDA Document (PDF/DOCX/Text)
│
▼
LegalGuard AI API
├── /extract — Pull key clauses by type
├── /analyze — Score each clause for risk
└── /summarize — Generate plain-English summary
│
▼
Risk Report (JSON + HTML)
│
┌────┴────┐
│ │
LOW RISK HIGH RISK
│ │
Auto- Legal
Approve Review
Setup
pip install requests python-dotenv PyMuPDF# .env
APIVULT_API_KEY=YOUR_API_KEYStep 1: Extract Clauses from an NDA
import os
import fitz # PyMuPDF
import requests
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv("APIVULT_API_KEY")
BASE_URL = "https://apivult.com/api/legalguard"
def extract_text_from_pdf(pdf_path: str) -> str:
"""Extract raw text from a PDF NDA."""
doc = fitz.open(pdf_path)
text = ""
for page in doc:
text += page.get_text()
return text
def extract_nda_clauses(document_text: str) -> dict:
"""
Extract key NDA clauses by category.
Returns structured clause data with positions and text.
"""
headers = {
"X-RapidAPI-Key": API_KEY,
"Content-Type": "application/json"
}
payload = {
"document": document_text,
"document_type": "nda",
"extract_clauses": [
"confidentiality_definition",
"term_and_duration",
"permitted_disclosures",
"obligations_of_receiving_party",
"exclusions",
"return_of_information",
"remedies",
"governing_law",
"assignment",
"entire_agreement"
]
}
response = requests.post(
f"{BASE_URL}/extract",
json=payload,
headers=headers,
timeout=30
)
response.raise_for_status()
return response.json()
# Load and extract from an NDA
nda_text = extract_text_from_pdf("vendor_nda.pdf")
clauses = extract_nda_clauses(nda_text)
for clause in clauses["extracted_clauses"]:
print(f"\n[{clause['clause_type'].upper()}]")
print(f" Text: {clause['text'][:200]}...")
print(f" Confidence: {clause['confidence']:.0%}")Example output:
[TERM_AND_DURATION]
Text: The obligations set forth in this Agreement shall survive indefinitely
and shall not terminate upon expiration of this Agreement...
Confidence: 97%
[REMEDIES]
Text: The parties acknowledge that any breach of this Agreement would cause
irreparable harm and agree that injunctive relief shall be available
without the requirement to post bond or demonstrate actual damages...
Confidence: 94%
Step 2: Risk Score Each Clause
Once clauses are extracted, run risk analysis on each:
def analyze_clause_risk(clauses: dict) -> dict:
"""
Score each extracted clause for risk level.
Returns CRITICAL, HIGH, MEDIUM, or LOW for each clause.
"""
headers = {
"X-RapidAPI-Key": API_KEY,
"Content-Type": "application/json"
}
payload = {
"document_type": "nda",
"clauses": clauses["extracted_clauses"],
"analysis_perspective": "receiving_party", # or "disclosing_party"
"risk_factors": [
"overbroad_scope",
"perpetual_obligations",
"unlimited_remedies",
"unfavorable_assignment",
"one_sided_obligations",
"jurisdiction_risk"
]
}
response = requests.post(
f"{BASE_URL}/analyze",
json=payload,
headers=headers,
timeout=30
)
response.raise_for_status()
return response.json()
risk_analysis = analyze_clause_risk(clauses)
# Display flagged clauses
for clause in risk_analysis["analyzed_clauses"]:
if clause["risk_level"] in ["CRITICAL", "HIGH"]:
print(f"\n🚨 {clause['risk_level']}: {clause['clause_type']}")
print(f" Issue: {clause['risk_description']}")
print(f" Recommendation: {clause['recommendation']}")This produces actionable output:
🚨 CRITICAL: term_and_duration
Issue: Perpetual confidentiality obligation with no sunset date.
Standard market practice is 2-5 years post-agreement termination.
Recommendation: Request amendment to "3 years following termination" or
"until information becomes publicly available, whichever
occurs first."
🚨 HIGH: remedies
Issue: Waives counterparty's right to demand actual damages proof.
Combined with broad confidentiality definition, creates significant
litigation exposure for minor technical breaches.
Recommendation: Request modification to limit injunctive relief to
material breaches involving intentional disclosure.
Step 3: Generate a Plain-English Summary
Generate a non-lawyer-friendly summary for business stakeholders:
def generate_nda_summary(
document_text: str,
risk_analysis: dict,
parties: dict
) -> dict:
"""
Generate a plain-English NDA summary with key points and risk flags.
"""
headers = {
"X-RapidAPI-Key": API_KEY,
"Content-Type": "application/json"
}
payload = {
"document": document_text,
"document_type": "nda",
"risk_analysis": risk_analysis,
"metadata": {
"disclosing_party": parties.get("disclosing"),
"receiving_party": parties.get("receiving")
},
"summary_format": "business_brief", # or "legal_memo"
"include_sections": [
"what_this_covers",
"how_long_it_lasts",
"what_you_can_share",
"key_obligations",
"top_risks",
"recommended_changes"
]
}
response = requests.post(
f"{BASE_URL}/summarize",
json=payload,
headers=headers,
timeout=30
)
response.raise_for_status()
return response.json()
summary = generate_nda_summary(
nda_text,
risk_analysis,
parties={"disclosing": "Acme Corp", "receiving": "Your Company"}
)
print(summary["plain_english_summary"])Sample summary output:
NDA SUMMARY — Acme Corp / Your Company
═══════════════════════════════════════
WHAT THIS COVERS
This NDA covers ALL confidential information shared between the parties,
including business plans, technical specs, customer data, and financial
information. The definition is broad — essentially everything you share
in business discussions.
HOW LONG IT LASTS
⚠️ ISSUE: This NDA never expires. Your confidentiality obligations
continue indefinitely, even after you stop working with Acme Corp.
This is non-standard. Market norm is 2-3 years.
KEY OBLIGATIONS
You must: Keep all shared information confidential, use it only for
evaluating the business relationship, and return or destroy it if
requested.
TOP RISKS (2 issues require attention)
1. CRITICAL — Perpetual obligations: No expiration date on confidentiality
2. HIGH — Broad remedies: Counterparty can seek injunction without
proving actual harm
RECOMMENDED CHANGES
The legal team should request revisions to Sections 4 and 9 before signing.
Step 4: Full Automation Pipeline
Combine everything into an end-to-end NDA review workflow:
import json
from pathlib import Path
from datetime import datetime
class NDAReviewPipeline:
def __init__(self, api_key: str):
self.api_key = api_key
def review(
self,
pdf_path: str,
parties: dict,
auto_approve_threshold: str = "LOW"
) -> dict:
"""
Run full NDA review pipeline.
Returns review result with risk level and recommended action.
"""
# 1. Extract text
nda_text = extract_text_from_pdf(pdf_path)
# 2. Extract clauses
clauses = extract_nda_clauses(nda_text)
# 3. Analyze risk
risk_analysis = analyze_clause_risk(clauses)
# 4. Generate summary
summary = generate_nda_summary(nda_text, risk_analysis, parties)
# 5. Determine routing decision
max_risk = risk_analysis.get("overall_risk_level", "LOW")
critical_issues = [
c for c in risk_analysis["analyzed_clauses"]
if c["risk_level"] == "CRITICAL"
]
if max_risk == "LOW" or (max_risk == "MEDIUM" and not critical_issues):
action = "auto_approve"
else:
action = "legal_review_required"
result = {
"reviewed_at": datetime.utcnow().isoformat(),
"file": Path(pdf_path).name,
"parties": parties,
"overall_risk": max_risk,
"critical_issues": len(critical_issues),
"action": action,
"summary": summary["plain_english_summary"],
"full_analysis": risk_analysis
}
# Save review report
output_path = f"nda_review_{Path(pdf_path).stem}_{datetime.utcnow().strftime('%Y%m%d')}.json"
with open(output_path, "w") as f:
json.dump(result, f, indent=2)
return result
# Run a review
pipeline = NDAReviewPipeline(API_KEY)
result = pipeline.review(
"vendor_nda.pdf",
parties={"disclosing": "Vendor Corp", "receiving": "My Company"}
)
print(f"Risk Level: {result['overall_risk']}")
print(f"Action Required: {result['action']}")
print(f"Critical Issues: {result['critical_issues']}")ROI Calculation
For a company signing 50 NDAs per month:
| Activity | Manual | Automated |
|---|---|---|
| Time per NDA | 45 min | 90 sec |
| Monthly legal hours | 37.5 hrs | 1.25 hrs |
| Monthly legal cost (@ $300/hr) | $11,250 | $375 |
| Annual savings | — | $130,500 |
Beyond cost savings, automated review catches clauses that tired lawyers miss on the 15th NDA of the day.
Next Steps
This pipeline handles standard mutual NDAs. LegalGuard AI also supports one-way NDAs, employment NDAs, and more complex vendor agreements. Extend the extract_clauses list with additional clause types for each document category.
See the LegalGuard AI API documentation for the full list of supported clause types and document formats (PDF, DOCX, plain text).
More Articles
Automate Contract Review with AI: A Developer's Integration Guide
Learn how to integrate LegalGuard AI to automatically extract key clauses, flag risky terms, and generate plain-English contract summaries using the REST API.
March 30, 2026
How to Build a Contract Clause Extractor API in Python
Extract contract clauses, obligations, and risk terms in seconds with LegalGuard AI. Production-ready clause extraction API.
April 1, 2026