인셔셔RSS 관심 있는 블로그, 뉴스, 기술 정보를 효율적으로 추적하고 읽으세요
원문 읽기 InertiaRSS에서 열기

추천 피드

aimingoo的专栏
aimingoo的专栏
I
InfoQ
B
Blog RSS Feed
D
Docker
GbyAI
GbyAI
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
F
Fortinet All Blogs
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
C
Check Point Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
博客园 - Franky
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
Last Week in AI
Last Week in AI
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
FinePrint — An AI Pocket Lawyer That Decodes Predatory Co...
Dhruv Jani · 2026-05-25 · via DEV Community

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

## What We Built

Last placement season, a friend came to me with a job offer letter. He was excited — first real offer. I read clause 3. It said if he quit before 3 years, he owed the company ₹2,00,000. He had no idea it was there. He nearly signed it. He would have been locked in for 3 years with no way out. He's a developer. That's his entire early career.

He's not alone. Every year, thousands of students sign employment bonds, internship agreements, and rental leases without understanding what they're agreeing to. The language is deliberately dense. The penalties are buried in clause 4, clause 7, clause 11. And most people — especially fresh graduates — don't have a lawyer to call.

That's why we built FinePrint.

FinePrint is an open-source AI contract protection tool powered by Gemma 4. Upload a photo, PDF, or paste any contract text. FinePrint reads it, finds every trap, and tells you exactly what's dangerous, what to negotiate, and what to never sign.

What you get:

  • 🔴 Risk Score (0–100) — objective danger level of the contract
  • 🟡 Compatibility Score — how well the contract matches your personal goals
  • ⚖️ Final Verdict — ACCEPT / NEGOTIATE / REJECT with direct reasoning
  • Plain English explanation of every red flag
  • A safer suggested rewrite for every dangerous clause
  • Actionable negotiation tips per clause
  • A ready-to-send personalized negotiation email
  • Shareable report link + downloadable PDF
  • Contract comparison — upload v1 and v2, see what changed

This isn't a document reader. It's a contract protection engine. Reading a document tells you what it says. FinePrint tells you what it means for your specific situation, what the company is trying to take from you, and exactly what to say back.

The FinePrint homepage — upload a contract or try a built-in example

## Demo

🔗 Live: https://tarkashlabs-fineprint.vercel.app

Want to try it yourself? Go to the live app and click "Campus Bond" under Try an example. Fill in your requirements and hit Analyze.

Here's what FinePrint returned on a real predatory internship contract:
🔴 Risk Score: 98 / 100 — Dangerous
🔴 Compatibility: 20 / 100 — Low Match

❌ Verdict: REJECT

"The contract violates every user requirement — unpaid position,
IP ownership of personal projects, ₹1,00,00,000 bond penalty,
mandatory overtime, and an 18-month non-compete."

The FinePrint homepage — upload a contract or try a built-in example

Every red flag comes with a plain English explanation, negotiation tip, and a safer clause rewrite with space for asking a follow-up question

Gemma 4 Dense 31B drafts a personalized negotiation email — ready to send to HR

FinePrint also has a Compare Mode — upload the original and revised contract, and Gemma 4 tells you exactly what improved, what's still dangerous, and what's new.

FinePrint Compare Mode — upload two versions of a contract and see exactly what changed, what was resolved, and what red flags remain

FinePrint Compare Mode — Expanded clause comparison analysis

## Code

🐙 GitHub: https://github.com/Tarkash-Labs/FinePrint

Frontend:  React + Vite + Tailwind CSS
Backend:   Python + FastAPI + async SSE streaming  
AI:        Gemma 4 via Google AI Studio
Deploy:    Vercel + Render

The backend is ~650 lines of async Python. Results stream clause by clause as Gemma 4 processes them — red flags appear in real time, not after a long wait. All report state is preserved in a stateless shareable URL using gzip compression — no database, no server-side storage.
Here's the core of what makes FinePrint work — the prompt that sends both the contract AND the user's personal goals to Gemma 4 simultaneously:

def _build_analysis_prompt(contract_label: str, focus_areas: str, requirements: str) -> str:
  requirements_text = requirements.strip() or "None provided."
  return f"""
You are a ruthless, detail-oriented legal expert specializing in {contract_label} contracts. Your job is to protect the user.
Analyze this contract and return a JSON with exactly these fields:
{{
  "risk_score": <integer 0-100>,
  "compatibility_score": <integer 0-100>,
  "verdict": "ACCEPT" | "NEGOTIATE" | "REJECT",
  "verdict_reason": "<1-2 sentence explanation referencing requirements and clauses>",
  "requirement_breakdown": [
    {{"requirement": "<specific user requirement>", "met": true/false, "explanation": "<why it was or wasn't met>"}}
  ],
  "red_flags": [
    {{
      "clause_title": "...", 
      "clause_text": "<EXACT text from the contract>", 
      "plain_english_explanation": "<Briefly state the risk>", 
      "negotiation_tip": "<Actionable advice on what the user should ask to change>",
      "suggested_rewrite": "<Provide a safer, alternative 1-2 sentence rewrite for this clause that the user can propose>",
      "severity": "high|medium|low"
    }}
  ],
  "safe_clauses": [{{"clause_title": "...", "plain_english_explanation": "..."}}]
}}

CRITICAL RULES:
1. Return ONLY valid JSON. No preamble. No markdown blocks.
2. DETECT ALL RED FLAGS. Do not summarize them into one. If there are 5 bad clauses, list 5 red flags.
3. You MUST extract the exact original text for "clause_text". 
4. The "risk_score" is objective based on standard legal risks. Focus heavily on: {focus_areas}.
5. The "compatibility_score" MUST directly reflect the User Requirements below. If a requirement is completely violated, score drops.

User Requirements to evaluate against:
{requirements_text}

Verdict guidance:
- ACCEPT when risk <= 30 and compatibility >= 70.
- REJECT when risk >= 61 or compatibility <= 30.
- Otherwise NEGOTIATE.
""".strip()

This single prompt is why FinePrint's output is personalized and not generic. Gemma 4 reads the contract and the user's life goals at the same time.

## How We Used Gemma 4

The model routing was a deliberate decision made after real testing — not a default choice.

The Architecture

Step 1 — Gemma 4 MoE → Multimodal OCR
When a user uploads a photo or PDF, the MoE model reads the document image directly and extracts the raw text. A user can photograph a physical contract — an actual printed piece of paper — with their phone and upload it. Gemma 4's native multimodal vision handles the rest. No manual copy-paste. No fragile third-party OCR library.

This step doesn't need legal reasoning. It needs fast, accurate image reading. The MoE architecture is the right fit.

Step 2 — Gemma 4 Dense 31B → Everything that requires thinking
All legal reasoning runs on the Dense 31B — clause classification, risk scoring, compatibility analysis, plain English explanations, suggested rewrites, negotiation tips, and the personalized negotiation email.

We explicitly tested the MoE for legal analysis. On a contract with 5 critical violations, it returned 1 generic red flag. The Dense 31B returned all 5 — with exact clause text, severity ratings, negotiation tips, and suggested rewrites.

Legal reasoning needs the most capable model. We use it where it matters.

The compatibility score — what makes FinePrint different from every other document AI

Before analyzing, FinePrint asks for the user's personal requirements — how long they plan to stay, whether they need side projects, minimum compensation, relocation preferences. This goes into the Dense 31B prompt alongside the contract text.

The model reads both simultaneously and judges alignment. The same IP assignment clause scores very differently for someone planning to leave in 6 months versus someone planning a 5-year career. A rule-based system can't do this. Gemma 4 can.

The output isn't "this clause is risky." It's "this clause is risky for you specifically."

The problem FinePrint is actually solving

The legal literacy gap is structural. People with money have lawyers. Everyone else signs whatever they're handed.

Harvey AI proved that LLMs can transform legal analysis — they're valued at $715M serving elite law firms. FinePrint takes that same capability and makes it free for the people those firms will never serve.

Campus placement bonds in India affect hundreds of thousands of students every year. Most of them have never read a legal document before. Many sign bonds they legally cannot afford to break — and only find out years later when they try to leave a job they hate.

FinePrint is the first line of defense for people who don't have a lawyer on speed dial. It doesn't replace legal advice — there's a disclaimer at the bottom of every analysis for that reason — but it gives people the awareness they need to ask the right questions before they sign anything.

What's Next
FinePrint today protects students and junior developers from predatory contracts. The same Gemma 4 architecture scales to rental leases, freelance NDAs, and VC term sheets — we already support all seven contract types. Long term: a browser extension that flags red flags on any document you open, and an API that other apps can integrate. The legal literacy gap is massive. We're just getting started.

Built by Tarkash Labs
@dj29 & @yug_vasava