Inspiration

Loan documents are complex and high-stakes. Small deviations from LMA (Loan Market Association) standards ripple into negotiation delays, litigation risk, and audit burdens. As a solo builder, I wanted a tool that bank lawyers can trust on an institutional trading floor—something that standardizes clauses fast, flags risks, and leaves a clear audit trail.

What it does

Clause Guardian instantly evaluates a pasted loan clause against LMA practices.

  • Computes a compliance risk score (0–100) with clear labels.
  • Lists Detected Risks (ambiguities, missing cure periods, deviations).
  • Shows the closest LMA-standard wording for the clause type.
  • Generates a Suggested Redline ready to paste back into your document.
  • Produces a downloadable PDF audit report containing an integrity hash and QR code.
  • Tracks operational metrics: documents scanned today and estimated risk averted.
  • Maintains recent audits for quick re-open and re-download.

How we built it

  • Frontend: React + Vite, modern UI with Sidebar metrics, Risk Gauge, and structured analysis sections.
  • Backend: Node/Express server that securely holds the Gemini API key and proxies analysis requests.
  • AI: Gemini models called server-side with a strict JSON schema for reliable, structured outputs.
  • Audit Trail: PDFKit + QRCode to generate reports with an integrity SHA-256 hash and QR link to the stored audit JSON.
  • Developer Experience: One-command dev runner, cross-platform demo scripts (macOS/Linux + Windows), and clear README.

Challenges we ran into

  • Reliable structure: Getting consistent JSON responses from the LLM required schema-enforced generation and robust parsing.
  • Security: Avoiding client-side secrets meant building a proxy and tightening the Vite setup to prevent accidental exposure.
  • UX trade-offs: Balancing a lawyer-friendly UI with technical depth (e.g., copy actions, clause type selection, and audit IDs) without clutter.
  • Time: As a solo participant, prioritizing features that directly support commercial viability and demo clarity.

Accomplishments that we're proud of

  • End-to-end flow: Paste → Analyze → Copy standard/redline → Download audit PDF with integrity and QR.
  • Commercial readiness: Server-side key security, metrics, audit history, and a demo-friendly architecture.
  • Clause type tailoring: Prompts that adapt to the selected clause category for more relevant guidance.
  • Submission assets: A concise deck outline and demo scripts that make it easy to evaluate.

What we learned

  • Structured generation (response schemas) dramatically improves LLM reliability in legal workflows.
  • Legal UX benefits from small touches: copy buttons, clear IDs, and trustworthy visual cues.
  • Auditability matters: Integrating hashes, QR codes, and stored JSON builds confidence for institutional teams.
  • Developer ergonomics (one-command run, scripts, docs) are critical for smooth reviews and adoption.

What's next for Clause Guardian

  • Clause packs: Expand beyond Change of Control to Events of Default, Covenants, Mandatory Prepayment, and Negative Pledge with deeper templates.
  • Integrations: DMS/CLM systems, SSO, export to Word redlines, and agency workflows.
  • Review & governance: Role-based approvals, change logs, and configurable risk policies.
  • Model evaluation: Benchmarks against curated LMA datasets for precision and recall.
  • Scale & resilience: Rate limiting, caching, and observability for production environments.
  • Analytics: Portfolio-level insights across documents, teams, and time.

Built With

Share this project:

Updates