<?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: GregoryT</title>
    <description>The latest articles on DEV Community by GregoryT (@devgreg).</description>
    <link>https://dev.to/devgreg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3974680%2F6bb453ad-3e9f-4e6e-878a-e0a1b89b84d4.png</url>
      <title>DEV Community: GregoryT</title>
      <link>https://dev.to/devgreg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devgreg"/>
    <language>en</language>
    <item>
      <title>NDAshield: How I Built a Privacy-First AI Legal Triage Tool on Cloudflare and Next.js</title>
      <dc:creator>GregoryT</dc:creator>
      <pubDate>Tue, 09 Jun 2026 07:30:00 +0000</pubDate>
      <link>https://dev.to/devgreg/ndashield-how-i-built-a-privacy-first-ai-legal-triage-tool-on-cloudflare-and-nextjs-4i2g</link>
      <guid>https://dev.to/devgreg/ndashield-how-i-built-a-privacy-first-ai-legal-triage-tool-on-cloudflare-and-nextjs-4i2g</guid>
      <description>&lt;p&gt;Building with AI is easy. Building with AI when handling highly confidential, legally binding legal documents is an absolute minefield.&lt;br&gt;
When I set out to build &lt;strong&gt;NDAshield&lt;/strong&gt; (an automated tool that scans NDAs, applies a 0-100 risk "Burn Score," and generates redlines), the biggest hurdle wasn't the AI wrapper—it was &lt;strong&gt;data privacy&lt;/strong&gt;.&lt;br&gt;
Here is a look under the hood at how I structured a solo-founder SaaS architecture to be fast, secure, and compliant with EU strict data privacy regulations.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. The Architectural Blueprint
&lt;/h2&gt;

&lt;p&gt;To minimize overhead and handle global traffic with zero cold starts, I bypassed traditional heavy server setups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Framework: Next.js&lt;/li&gt;
&lt;li&gt;Edge Infrastructure: Cloudflare&lt;/li&gt;
&lt;li&gt;Auth &amp;amp; DB: Clerk + Supabase&lt;/li&gt;
&lt;li&gt;AI Layer: Google Gemini (primary processing for massive context window and speed) with an automated fallback pipeline to OpenAI.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  2. Achieving Zero-Footprint Processing (In-Memory)
&lt;/h2&gt;

&lt;p&gt;To comply with GDPR and earn the user trust required for document analysis, I built a zero-storage pipeline.&lt;br&gt;
When a user uploads a PDF or DOCX, the document is streamed and kept entirely in temporary memory. The text is parsed, chunked, passed to the secure API endpoint of our LLM providers (with data-sharing/training toggles strictly turned off), and the structured JSON output is sent back to the client. Once the session terminates or 90-day system logs clear, the footprints vanish. No local database stores the raw text of the contract.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Prompt Engineering for Law vs. Reality
&lt;/h2&gt;

&lt;p&gt;Generic ChatGPT prompts give terrible contract summaries like: &lt;em&gt;"This is a standard NDA protecting both parties."&lt;/em&gt;&lt;br&gt;
That's dangerous. To make the output actionable, the backend enforces structural constraints:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quantification:&lt;/strong&gt; Every clause is mapped against an aggressive risk matrix to compute an aggregate 0-100 Burn Score.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification:&lt;/strong&gt; The model is strictly forbidden from summarizing a problem unless it can output an exact, verbatim quote from the uploaded text to prove it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actionability:&lt;/strong&gt; Instead of just pointing out a flaw, the system generates clean counter-proposals (redlines) and drafts a formal negotiation email.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Lessons Learned as a Solo Developer
&lt;/h2&gt;

&lt;p&gt;Launching a legaltech micro-SaaS teaches you that tech is only 30% of the battle; trust and positioning make up the other 70%. By ensuring the app is fully EU-hosted (Poland) and entirely transparent about what happens to data, user hesitation drops drastically.&lt;br&gt;
We just went live on Product Hunt today to gather initial usage feedback. If you're building in the AI or Edge space and want to chat about handling file processing at the edge or tuning structured JSON outputs, let's talk in the comments!&lt;br&gt;
Check out the live build here: &lt;a href="//nda-shield.com"&gt;nda-shield.com&lt;/a&gt;&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.producthunt.com/products/ndashield-ai-nda-risk-analysis-in-45s?launch=ndashield-ai-nda-risk-analysis-in-45s" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;producthunt.com&lt;/span&gt;
          

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


</description>
      <category>ai</category>
      <category>programming</category>
      <category>career</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
