Hidden Clauses

Inspiration

Legal documents are everywhere, yet most people sign them without fully understanding what they contain. Long pages, complex legal language, and subtle clauses often hide risks that can seriously affect users later on.

Hidden Clauses was inspired by a simple but powerful question: What if AI could read contracts for us and warn us before we sign?

Our goal was to use artificial intelligence not as a technical showcase, but as a practical tool to improve everyday legal awareness and protect users from unfair or confusing contract terms.


What it does

Hidden Clauses is an AI-powered web application that analyzes PDF contracts to identify, highlight, and explain potentially abusive, risky, or confusing clauses — the "fine print" that often goes unnoticed.

Key features

  • Smart Contract Analysis: Upload a PDF and let the AI scan each paragraph for unfavorable or unclear terms.
  • Document Comparison: Compare two versions of a contract to detect subtle but critical changes.
  • Chat with Your Contract: Ask questions directly about the document and receive context-aware legal explanations.
  • Sensitive Data Detection: Automatically identifies personal data (PII) before analysis to enhance privacy.
  • Modern UI: A clean, fast, and intuitive interface designed for non-legal users.

How we built it

Hidden Clauses was built using a modern and scalable web stack:

  • Frontend & Framework: Next.js 16 with React 19
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • AI Engine: Google Gemini API (gemini-3)
  • PDF Handling: react-pdf for document visualization and pdf-parse for text extraction
  • Deployment: Vercel for CI/CD and global delivery

The system extracts text from uploaded PDFs, preprocesses it, and sends structured prompts to Gemini, which returns clause analysis, explanations, and risk indicators rendered in real time in the UI.


Challenges we ran into

  • Parsing complex PDFs: Legal documents often have inconsistent formatting, making text extraction non-trivial.
  • Prompt engineering: Achieving accurate, concise, and legally relevant responses required multiple iterations.
  • Performance constraints: Balancing fast responses with detailed analysis during a hackathon timeframe.
  • Privacy concerns: Ensuring sensitive user data is detected and handled responsibly before AI processing.

Accomplishments that we're proud of

-Delivered a fully functional AI-powered legal analysis tool within a limited hackathon timeframe.

-Successfully integrated Google Gemini for real-world legal language understanding.

-Built a user-friendly interface that makes complex legal insights accessible to non-experts.

-Created a project with clear social impact, not just technical complexity.


What we learned

  • AI is most powerful when paired with a clear, human-centered problem.
  • Legal language requires careful prompt design and context handling.
  • Modern frameworks like Next.js and Tailwind significantly speed up iteration.
  • Privacy considerations must be integrated from the start, not as an afterthought.

Technical Insight

We discovered that structuring prompts with explicit role definitions and output formats dramatically improved response quality:

Role: You are a legal expert analyzing contract clauses.
Task: Identify risky clauses and explain them in simple terms.
Format: Return JSON with {clause, risk_level, explanation}

What's next for Hidden Clauses

Roadmap

  1. Multilingual Support: Extend analysis to multiple languages and regional legal frameworks
  2. Risk Scoring System: Implement clause risk scoring with severity levels (Low, Medium, High, Critical)
  3. Exportable Reports: Generate PDF reports for legal review or personal records
  4. User Authentication: Secure document history and personalized analysis
  5. Fine-tuned Models: Train specialized legal language models for higher accuracy

Future Vision

We envision Hidden Clauses as a legal literacy platform where users can not only analyze contracts but also learn about their rights, compare industry standards, and access educational resources about common legal pitfalls.

Try it out

🔗 Live Demo | GitHub Repository


Empowering users to understand what they sign, one clause at a time.

Built With

Share this project:

Updates