We will be undergoing planned maintenance on Oct 7th 6:00AM UTC / Oct 7th 2:00AM ET

Inspiration

Contracts hide critical deadlines and one-sided clauses in dense legal language. Missing a termination notice or an unfavorable liability clause can cost real money — but most people and small businesses can't afford a lawyer to review every agreement. We wanted an AI tool that flags risky clauses with evidence, not just a vague "this looks risky."

What it does

LexGuard lets you upload a contract (paste text, PDF, or a photo via OCR) and automatically:

  • Detects and scores risks (e.g. asymmetric liability caps, one-sided termination notice, unilateral amendment rights)
  • Extracts obligations with responsible party and due dates
  • Backs every finding with an exact quote from the contract as evidence
  • Schedules automated reminders (7/3/1/0 days before deadlines) delivered via Discord/webhooks

How we built it

  • Backend: Rust + Axum, PostgreSQL with SQLx migrations
  • Frontend: Leptos compiled to WebAssembly
  • AI: OpenAI-compatible chat completion (served via Groq) for contract analysis
  • Security: Argon2id password hashing, opaque session tokens, ChaCha20-Poly1305 encrypted webhook credentials, SSRF protection on outbound webhooks
  • A background worker handles reminder delivery with retries and crash recovery
  • Fully containerized with Docker, 333+ automated tests

AI disclosure

Two separate uses of AI here: the app itself uses AI at runtime (an OpenAI-compatible provider — Groq/OpenAI/Gemini — for contract risk analysis and image OCR, described above). Separately, as the developer, I used Gemini and DeepSeek for coding assistance and Claude for code review, security hardening, and architectural feedback while building this solo in 8 days. All architecture, integration, testing, and final review were mine. Full day-by-day disclosure: DEVELOPMENT_PROCESS.md.

Challenges we ran into

LLM outputs are non-deterministic — the same contract could get slightly different risk scores across runs. We built a fuzzy evidence-verification system that checks AI-cited evidence against the original contract text (exact match or 70% token overlap) to catch hallucinated citations before showing them to the user.

What we learned

Building trust into AI outputs matters more than raw accuracy — surfacing verifiable evidence for every claim, and being transparent about known limitations, is what makes an AI legal tool usable.

What's next

Jurisdiction-aware analysis, contract-type-specific risk models, and support for more AI providers.

Built With

Share this project:

Updates

posted an update —

Just submitted LexGuard for LexHack 2026!

An AI contract analyzer built with Rust + Leptos. It identifies risks with exact evidence quotes, extracts obligations, and schedules reminders via Discord/Telegram/webhooks.

Key win: fuzzy evidence verification (70% token matching) rejects AI hallucinations before they reach the database.

333 backend tests + 12 WASM tests passing. CI green. Docker verified.

Feedback welcome!

Log in or sign up for Devpost to join the conversation.

Submission history