Inspiration

Two years ago, I signed a freelance contract, got paid $5,000, and thought everything was great. Six months later, I launched a side project I'd built on weekends. Then came the legal letter: "That app belongs to us. Check Section 3, paragraph 12."

Hidden in legal jargon was a clause: "All intellectual property created during the contract term belongs to Client." My side project—built with my own tools, on my own time—legally belonged to them. I couldn't afford a $500/hour lawyer to fight it. I had to shut down months of work.

This happens to freelancers every single day.

75% of freelancers sign contracts without understanding the terms. There are 60 million freelancers in a $1.3 trillion economy with zero protection. ContractGuard AI was born from my frustration and determination to protect others from the same trap.

What it does

ContractGuard AI analyzes freelance contracts in under 30 seconds and provides:

  • 🚨 Red Flag Detection: Identifies unlimited liability, unfair IP rights, one-sided termination clauses
  • ⚠️ Contract Warnings: Spots long payment terms (Net-90), missing protections, scope creep risks
  • 📊 Fairness Score: 0-100 rating comparing contracts against industry standards
  • 🔄 Fair Alternatives: Provides balanced clause replacements for every red flag
  • 📧 Negotiation Email Generator: Creates professional emails to renegotiate unfair terms
  • ✅ Plain English Explanations: No legal jargon—clear explanations anyone can understand

How we built it

Frontend: Built with Next.js 16 (App Router) and TypeScript for type-safe, production-grade code. Used Tailwind CSS v4 for mobile-first responsive design, because most freelancers read contracts on their phones.

AI Engine: Integrated Google Gemini 3.0 Flash Preview via the Generative AI SDK. Engineered prompts to make the AI understand contract law, freelancer rights, and industry standards. The AI analyzes liability exposure, IP ownership fairness, payment protection, termination balance, and non-compete reasonableness.

Architecture: Next.js API Routes handle backend processing. Contracts are analyzed in real-time via API calls—never stored on servers (privacy-first). Results are passed through sessionStorage for instant display without database overhead.

Development: Used Turbopack for faster builds during development. Deployed on Vercel for instant global CDN distribution.

Challenges we ran into

1. Getting Gemini to understand legal nuance: Generic AI prompts returned surface-level analysis. I had to engineer detailed prompts with contract law examples, severity ratings (1-10), and structured JSON output to get actionable results.

2. Structuring the fairness score algorithm: Calculating a 0-100 score required weighing different clause types. Payment terms, liability exposure, and IP rights had to be balanced correctly to produce meaningful scores.

3. Making legal language accessible: Translating complex contract clauses into plain English without losing accuracy was challenging. I tested with non-technical friends to ensure explanations were truly understandable.

4. Mobile responsiveness with complex data: Displaying detailed red flags, warnings, and alternatives on small screens required careful UI design. Used collapsible sections and clear visual hierarchy.

Accomplishments that we're proud of

  • Real-world problem solving: This isn't a theoretical project—it solves a problem I personally experienced
  • Production-ready code: Type-safe TypeScript, clean architecture, error handling, privacy-first design
  • Instant analysis: Under 30 seconds from upload to actionable results
  • Actionable output: Not just "this is bad"—we provide exact alternatives and negotiation emails
  • 60M potential users: Every freelancer globally can benefit from this

What we learned

  • Prompt engineering is an art: Getting AI to produce structured, legally sound analysis required dozens of iterations
  • UX matters for serious tools: Even legal tech needs to feel approachable and human
  • Privacy builds trust: Never storing contracts makes freelancers comfortable uploading sensitive documents
  • Next.js 16 + Turbopack is incredibly fast: Development experience was smooth with instant hot reloading

What's next for ContractGuard AI

Phase 1 (Next 3 months):

  • Multi-language support (French, Spanish, Portuguese) for global freelancers
  • Contract comparison mode (compare two versions side-by-side)
  • Email tracking for negotiation follow-ups

Phase 2 (6 months):

  • Lawyer marketplace connecting freelancers with affordable legal help when negotiation fails
  • Company compliance mode (B2B SaaS for agencies to audit their own contracts)
  • Browser extension for instant analysis while browsing Upwork, Fiverr, Freelancer.com

Phase 3 (1 year):

  • Contract generation tool (create fair contracts from scratch)
  • Industry-specific templates (tech, design, writing, etc.)
  • Mobile app for on-the-go contract review

This is just the beginning. No freelancer should lose their work to hidden contract traps.

Built With

Share this project:

Updates