Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for LexGuard – AI Contract Risk Analyzer
Here's every section ready to copy-paste one by one:
Inspiration Every company signs dozens of contracts every month — vendor agreements, NDAs, SaaS subscriptions, employment contracts. Hidden inside these documents are clauses that can expose organizations to unlimited financial liability, lock them into auto-renewing commitments, or silently strip them of their intellectual property.
Traditional legal review takes days and costs hundreds of dollars per hour. Most contracts get signed without proper scrutiny — not because people don't care, but because there's no fast, accessible way to catch the risks.
We kept asking: what if AI could review a contract in 30 seconds, right inside the tools people already use? That question became LexGuard.
What It Does LexGuard is an AI contract review agent that lives inside Chrome, Outlook, and Slack. It instantly analyzes any contract and flags risky clauses — before anyone signs.
- 🌐 Chrome Extension — One-click review of any contract webpage or uploaded PDF/DOCX. A sidebar highlights risky sections directly on the page.
- 📧 Outlook Integration — Automatically detects contract language in incoming emails and sends risk alerts before you even open the attachment.
- 💬 Slack Bot — Type
/lexguardfollowed by any contract text and get a full risk report posted to your channel instantly. - 📊 Web Dashboard — Full analytics across all three integrations, review history, and risk trends over time.
For every flagged clause, LexGuard explains the risk in plain English and suggests a specific redline — no legal jargon, no attorney required.
How We Built It LexGuard is built in three layers that work together seamlessly:
1. Airia AI Agent The core intelligence is an Airia-powered agent configured with a specialized legal analysis prompt. It scans contracts across 9 risk categories — liability, IP assignment, termination, non-compete, amendments, payment terms, data privacy, dispute resolution, and confidentiality — and returns structured JSON with risk levels, plain-English explanations, and redline suggestions.
2. Node.js Backend API
An Express.js server acts as the central hub. It receives contract text from all three integrations, routes it to the Airia agent, parses PDF and DOCX files, handles Slack slash commands, and manages Outlook email scanning. A single /api/analyze endpoint serves all surfaces.
3. Frontend Integrations
- A Chrome Manifest V3 extension with a polished 3-tab popup UI, a content script that highlights risky clauses directly on the page, and a background service worker that auto-scans Outlook Web App emails
- A Slack slash command handler with rich Block Kit formatting for in-channel risk reports
- A full web analytics dashboard for history and risk trend tracking
Challenges We Ran Into Consistent structured output from the AI Getting the Airia agent to return clean, parseable JSON across wildly different contract formats — from formal MSAs to informal freelance agreements — required significant prompt engineering iteration. We added a robust fallback parser and demo mode so the app works end-to-end even when the AI returns unexpected formatting.
Serving three surfaces from one backend A browser extension, an email client, and a Slack bot all have very different request patterns, authentication models, and response format requirements. Designing a clean API that served all three without becoming a mess took careful planning.
Chrome Manifest V3 limitations MV3 service workers are stateless and have strict lifecycle constraints compared to MV2 background pages. Managing storage, context menus, and the Outlook auto-scanner within these constraints required a complete rethink of how the extension's background logic works.
Making it work without API keys For hackathon judging, the project needed to be fully demonstrable without live Airia credentials. Building a realistic demo mode with heuristic contract detection that mirrors real AI output was harder than expected but essential.
Accomplishments That We're Proud Of
- ⚡ 30-second contract review — from paste to full risk report, entirely in the tools people already use
- 🔌 Three live integrations — Chrome, Outlook, and Slack all working from a single backend API
- 🎯 9 risk categories — comprehensive clause detection covering all major contract risk areas
- ✏️ Redline suggestions — not just flagging problems, but providing specific fix language for each issue
- 🌐 Zero friction UX — no new app to learn, no portal to log into; LexGuard lives where contracts already are
- 💡 Demo mode — fully functional without any API keys, making it instantly usable by anyone
What We Learned
- Prompt engineering for structured outputs is a craft. Getting an LLM to return consistent, parseable JSON with meaningful legal content across diverse contract types requires far more iteration than expected.
- "Meet users where they are" is more powerful than building new surfaces. Embedding AI into Chrome, email, and Slack removes the single biggest barrier to adoption — behavior change.
- Airia dramatically simplifies multi-surface agent deployment. Without Airia, managing prompt versioning, model selection, and response formatting across three integrations would have been a separate project in itself.
- Demo mode is a feature, not a workaround. Building a realistic offline mode forced us to deeply understand what "good output" looks like, which improved the real AI prompts too.
What's Next for LexGuard – AI Contract Risk Analyzer
- 📎 Microsoft Word Add-in — Review and redline contracts directly inside Word without leaving the document
- 🔄 Auto-redline generation — Automatically produce a tracked-changes document with all suggested edits applied
- 👥 Team collaboration — Shared review queues, comment threads, and approval workflows for legal teams
- 📬 Gmail support — Extend email scanning to Google Workspace users
- 🏢 Clause library — Organization-specific approved/rejected clause templates so LexGuard learns your company's standards
- 📱 Mobile app — Review contracts on the go with the same AI-powered analysis
- 🔗 DocuSign & Adobe Sign integration — Block high-risk contracts from being sent for signature until reviewed
Built With
- airia
- api
- chrome
- express.js
- extension
- html/css
- javascript
- mammoth.js
- node.js
- pdf-parse
- rest
- slack
Log in or sign up for Devpost to join the conversation.