<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harshit Raj</title>
    <description>The latest articles on DEV Community by Harshit Raj (@harshitraj1236).</description>
    <link>https://dev.to/harshitraj1236</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: Harshit Raj</title>
      <link>https://dev.to/harshitraj1236</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshitraj1236"/>
    <language>en</language>
    <item>
      <title>ClauseGuard AI: The Zero-Leak Contract Auditor Protecting Freelancers from Predatory Terms</title>
      <dc:creator>Harshit Raj</dc:creator>
      <pubDate>Sun, 18 Oct 2026 18:02:13 +0000</pubDate>
      <link>https://dev.to/harshitraj1236/clauseguard-ai-the-zero-leak-contract-auditor-protecting-freelancers-from-predatory-terms-hnc</link>
      <guid>https://dev.to/harshitraj1236/clauseguard-ai-the-zero-leak-contract-auditor-protecting-freelancers-from-predatory-terms-hnc</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Every year, &lt;strong&gt;1.5 billion freelancers and independent contractors&lt;/strong&gt; worldwide experience the exact same moment of dread: after weeks of pitching, negotiations, and technical interviews, a new client sends over a 20-page "standard" contract.&lt;/p&gt;

&lt;p&gt;Buried inside that dense wall of legalese are high-stakes legal traps that can quietly destroy a freelancer’s livelihood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Net-90 Trap:&lt;/strong&gt; Working for three full months before receiving a single dollar, effectively acting as an interest-free bank for an enterprise client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The IP Forfeiture Trap:&lt;/strong&gt; Overbroad intellectual property clauses that unintentionally assign the client full ownership over the freelancer’s personal starter templates, boilerplate code, tools, and libraries created years prior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Unlimited Indemnity Trap:&lt;/strong&gt; Clauses exposing an independent individual to uncapped financial liability if the client gets sued by a third party.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Freelancer Dilemma
&lt;/h3&gt;

&lt;p&gt;Contract attorneys bill &lt;strong&gt;$350 to $600 an hour&lt;/strong&gt;—financially out of reach for a $2,500 project. &lt;/p&gt;

&lt;p&gt;Meanwhile, pasting confidential client contracts into public cloud LLMs (OpenAI, Anthropic) &lt;strong&gt;directly violates the Non-Disclosure Agreements (NDAs)&lt;/strong&gt; freelancers sign before receiving the project specifications.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Solution: ClauseGuard AI
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ClauseGuard AI&lt;/strong&gt; is an open-source, airgapped contract threat auditor and negotiation co-pilot built exclusively for freelancers and solopreneurs.&lt;/p&gt;

&lt;p&gt;You paste any Statement of Work (SOW), Master Services Agreement (MSA), or NDA, and within seconds ClauseGuard:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Calculates a 0–100 Safety Score:&lt;/strong&gt; A circular gauge immediately communicating legal risk posture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolates Threat Vectors:&lt;/strong&gt; Classifies risks into Payment Terms, IP Assignment, Indemnification, Non-Competes, and Termination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translates Legalese into Plain English:&lt;/strong&gt; Explains in direct, jargon-free language why a specific clause hurts your cash flow or exposes you to legal liability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synthesizes Ready-to-Send Redlines:&lt;/strong&gt; Crafts fair, commercially balanced counter-clauses with a single-click &lt;strong&gt;"Copy Redline"&lt;/strong&gt; or &lt;strong&gt;"Copy All as Negotiation Email"&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generates a 45-Second Spoken Audio Briefing:&lt;/strong&gt; Produces an executive voice briefing via ElevenLabs so freelancers can listen to the critical risks in under a minute before hopping on a client negotiation call.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Who Would Pay For It?
&lt;/h3&gt;

&lt;p&gt;Freelancers, independent engineers, design studios, and agency founders will gladly pay &lt;strong&gt;$12/month (or $5 per ad-hoc audit)&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Avoiding a single 90-day payment delay or a contested IP ownership claim saves thousands of dollars and months of stress. For independent workers who manage their own sales and risk, ClauseGuard provides immediate, tangible ROI on day one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Port:&lt;/strong&gt; &lt;code&gt;https://clauseguard-ai-ws69.onrender.com/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Interface:&lt;/strong&gt; Cyber-tactical sci-fi HUD console inspired by mission-critical defense dashboards, engineered with full responsive support across &lt;strong&gt;mobile phones, tablets, and desktop workstations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Node Monitoring:&lt;/strong&gt; An active health indicator verifies that the local Ollama instance is reachable (&lt;code&gt;● NODE: gemma2:2b (Ollama Local)&lt;/code&gt;), proving zero cloud transmission.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step-by-Step Workflow:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load a Test Vector:&lt;/strong&gt; Click the pre-loaded &lt;em&gt;"Predatory Consulting SOW"&lt;/em&gt; chip (featuring Net-90 terms, total IP forfeiture, and uncapped liability).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observe Real-Time Pipeline:&lt;/strong&gt; Watch the 4-step pipeline track execution in real time:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Sector 01:&lt;/em&gt; Segmenting clauses &amp;amp; extracting operative language&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Sector 02:&lt;/em&gt; Cross-referencing safe baseline benchmarks (Net-30, capped liability, mutual IP)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Sector 03:&lt;/em&gt; Google Gemma 2 neural reasoning &amp;amp; risk evaluation&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Sector 04:&lt;/em&gt; Synthesizing redline counter-clauses &amp;amp; ElevenLabs audio briefing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review Threat Dossier:&lt;/strong&gt; Inspect the &lt;strong&gt;15/100 Critical Threat&lt;/strong&gt; rating, examine the color-coded severity cards, listen to the 45-second audio briefing, and click &lt;strong&gt;"Copy All Redlines as Email Draft"&lt;/strong&gt; to paste into your email client.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;ClauseGuard AI is 100% open-source under the permissive MIT License:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/harshitraj1236/clauseguard-ai" rel="noopener noreferrer"&gt;https://github.com/harshitraj1236/clauseguard-ai&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Stack:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Framework:&lt;/strong&gt; Next.js 14 (App Router), React 18, TypeScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Styling:&lt;/strong&gt; Tailwind CSS with custom cyber-tactical HUD theme &amp;amp; Lucide icons&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local AI Engine:&lt;/strong&gt; Google Gemma 2 (2B) executing locally over Ollama (&lt;code&gt;http://localhost:11434&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Workflow:&lt;/strong&gt; Mastra-inspired multi-sector pipeline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice Synthesis:&lt;/strong&gt; ElevenLabs TTS API with seamless browser Web Speech API fallback&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legal Benchmark Engine:&lt;/strong&gt; Fair-terms knowledge base covering commercial standards for independent contractors&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;ClauseGuard was architected as an airgapped, four-sector agentic pipeline designed to run on modest local hardware:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    User["Freelancer / Solopreneur"] --&amp;gt;|Pastes Contract / SOW| UI["Next.js Responsive HUD (Port 1093)"]
    UI --&amp;gt;|API Request| Workflow["Mastra Agent Workflow"]

    subgraph PrivacyBoundary["100% Zero-Leak Privacy Boundary (Local Machine)"]
        Workflow --&amp;gt;|1. Segment Clauses| Chunker["Clause Segmenter"]
        Workflow --&amp;gt;|2. Check Standards| Benchmarks["Safe Benchmark Store (Net-30, Mutual IP, Capped Liability)"]
        Workflow --&amp;gt;|3. Local Neural Inference| Gemma["Google Gemma 2 (2B via Ollama)"]
        Gemma --&amp;gt;|Risk Scores 1-10 + Plain-English Explanations| Workflow
    end

    Workflow --&amp;gt;|4. Synthesize Counter-Offers| Redlines["Redline Generator &amp;amp; Email Draft"]
    Workflow --&amp;gt;|5. Voice Briefing Script| ElevenLabs["ElevenLabs Voice Engine (Audio Player + Waveform)"]

    Workflow --&amp;gt; UI
    UI --&amp;gt;|Displays Gauge, Flagged Clauses, Audio Player &amp;amp; Redlines| User&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Google Gemma 2 (2B):&lt;/strong&gt; We selected Google's lightweight open-weight model &lt;code&gt;gemma2:2b&lt;/code&gt;. Despite its compact 1.6 GB footprint, Gemma 2 exhibits exceptional legal comprehension and structured reasoning. It reliably parses ambiguous legal phrasing, identifies non-reciprocal clauses, and articulates clear counter-proposals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mastra Agent Workflow:&lt;/strong&gt; Standardizes contract parsing into isolated units. Instead of dumping a massive contract into one unmanageable prompt, the workflow isolates individual clauses, evaluates them against our curated safe benchmark standards, and generates targeted redline adjustments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ElevenLabs Audio Briefing:&lt;/strong&gt; Freelancers are constantly multitasking. We integrated ElevenLabs to convert the top identified legal risks into a high-tempo 45-second audio brief, complete with play/pause controls, soundwave visualization, and an expandable text transcript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live System Health Check:&lt;/strong&gt; To give users complete confidence that their data never touches a public server, the frontend pings &lt;code&gt;/api/status&lt;/code&gt; to confirm local Ollama connectivity and displays an active green status pill directly on the console.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;For ClauseGuard AI, &lt;strong&gt;open innovation is not just an implementation detail—it is the core reason the product can legally and economically exist.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The NDA Paradox (The Zero-Leak Privacy Mandate)
&lt;/h3&gt;

&lt;p&gt;When a freelancer signs an enterprise client agreement, it invariably contains strict confidentiality provisions. &lt;strong&gt;Uploading that agreement to a commercial cloud AI (such as OpenAI or Anthropic) technically breaches the NDA&lt;/strong&gt;, exposing the freelancer to breach-of-contract claims before work has even begun.&lt;/p&gt;

&lt;p&gt;By utilizing Google's open-weight &lt;strong&gt;Gemma 2&lt;/strong&gt; running locally through &lt;strong&gt;Ollama&lt;/strong&gt;, ClauseGuard ensures that &lt;strong&gt;100% of the contract text remains on the user's laptop&lt;/strong&gt;. No telemetry, no cloud logging, no data persistence, and zero confidentiality violations.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Unit Economics of a Sustainable Micro-SaaS
&lt;/h3&gt;

&lt;p&gt;A typical independent contractor might review three to five 20-page contracts each month. Running multi-turn legal analysis on commercial cloud LLMs would cost \$1.50–\$3.00 per audit in input/output tokens. At a \$9/month subscription price, a few active clients would eliminate profit margins entirely.&lt;/p&gt;

&lt;p&gt;With open-weight models running on local hardware or low-cost private compute, &lt;strong&gt;the marginal cost per token is \$0.00&lt;/strong&gt;. This enables a micro-SaaS with &lt;strong&gt;95%+ gross margins&lt;/strong&gt;, making ClauseGuard commercially viable and sustainable as a bootstrapped side hustle.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Open Standards &amp;amp; Immunity from API Deprecation
&lt;/h3&gt;

&lt;p&gt;Proprietary cloud APIs regularly deprecate model checkpoints, change pricing tiers, and alter safety filters unpredictably. By anchoring ClauseGuard to open weights and open-source agent frameworks (Mastra, Ollama), our auditing pipeline remains deterministic, auditable, and resilient to vendor lock-in.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;This entire project was planned, coded, and iterated through an agentic pair-programming session using &lt;strong&gt;DevRelay&lt;/strong&gt; and the Antigravity agentic coding environment:&lt;/p&gt;


&lt;div class="ltag-agent-session"&gt;
  &lt;div class="agent-session-header"&gt;
    
    &lt;span class="agent-session-tool-icon-badge" title="Gemini CLI"&gt;
&lt;/span&gt;
    &lt;span class="agent-session-title"&gt;Building ClauseGuard AI: Privacy-First Contract Auditor with Local Gemma 2&lt;/span&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-scroll"&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;I want to build an open-source AI project for the Hacktoberfest 2026 Week 2 "Side Hustle" challenge. It needs to be something freelancers would actually pay for, running locally with zero data leakage.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Let's build ClauseGuard AI — a privacy-first contract threat auditor for freelancers. When freelancers receive client contracts under NDA, uploading them to cloud LLMs violates confidentiality. By running Google Gemma 2 locally via Ollama and orchestrating with Mastra, ClauseGuard scans predatory terms (Net-90, unlimited liability, IP forfeiture) with zero data leakage.&lt;/p&gt;

                &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-buildproject"&gt;build_project&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;npm run build&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;Compiled successfully in 1.4s (0 errors)&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Make the dashboard feel like a cyber-tactical HUD console, responsive across laptop, tablet, and mobile, with an electric blue theme and live Ollama status.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Implemented the cyber-tactical HUD interface with real-time Ollama health checks, circular safety score gauge, multi-stage pipeline tracker, redline counter-offers, and ElevenLabs 45s audio briefing.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-footer"&gt;
    &lt;span class="agent-session-meta"&gt;
        4 of 4 messages
    &lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;(Agent Session #1018: Building ClauseGuard AI: Privacy-First Contract Auditor with Local Gemma 2)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From scaffolding the Next.js 14 application to configuring the Ollama Gemma 2 pipeline, tuning the cyber-tactical HUD theme, and building the fallback speech systems, the entire development trail is documented in the interactive session above.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🏆 &lt;strong&gt;Best Use of Gemma ($200):&lt;/strong&gt; Uses Google's &lt;strong&gt;Gemma 2 (2B)&lt;/strong&gt; open-weight model running locally via Ollama to perform deep legal clause evaluation, threat scoring, and plain-English counter-proposal synthesis.&lt;/li&gt;
&lt;li&gt;🏆 &lt;strong&gt;Best Use of Mastra ($100):&lt;/strong&gt; Implements a multi-stage agentic workflow that segments legal text, validates clauses against a safe benchmark knowledge base, and orchestrates neural risk scoring.&lt;/li&gt;
&lt;li&gt;🏆 &lt;strong&gt;Best Use of ElevenLabs ($100):&lt;/strong&gt; Synthesizes a high-fidelity 45-second executive voice briefing with an interactive audio player, animated waveform, and collapsible transcript drawer.&lt;/li&gt;
&lt;li&gt;🏆 &lt;strong&gt;Best Use of Render ($200):&lt;/strong&gt; Production-ready Next.js web application configured for deployment on Render.&lt;/li&gt;
&lt;li&gt;🏆 &lt;strong&gt;Overall Winner ($250):&lt;/strong&gt; An original, production-ready, privacy-first side hustle that solves a genuine multi-billion dollar problem for independent workers using open-source AI.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Disclaimer: ClauseGuard AI provides automated legal heuristics and risk scoring for educational and negotiation assistance. It is not formal legal counsel.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
