Eli Bakal

Privy

An AI legal prep workspace where clients chat with an assistant that cites attorney-shared documents while every turn lands in an audit trail.

Design engineer · April 2026 · In progress

Next.js · TypeScript · Tailwind CSS · Claude Sonnet 4.6 · Anthropic SDK · Vercel Blob · Supabase · Vercel

I built Privy, an AI legal preparation workspace where a client chats with an assistant that cites their attorney's documents by filename and page, and every exchange lands in an attorney-facing audit trail.

Context

Privy starts from the argument on its own landing page: clients are already using AI to prepare for legal matters, and anything they tell a general-purpose chatbot sits outside attorney-client privilege. The product is my answer to that: a workspace the attorney controls, where the client prepares for meetings with an AI assistant inside the privilege boundary instead of outside it. It is a solo product exploration, designed and built by me in April 2026, spanning a marketing site, an attorney dashboard with cases and matters, a client workspace with AI chat, and the API layer underneath, 69 commits over a two-day sprint.

Problem

The product's entire argument is trust, and trust does not survive a slide deck. A reviewer had to sit on both sides of the same case: share a document as attorney Dana Miller, watch it appear for client James Harrington, ask the assistant about it, and see the answer point back at the exact file. The first build ran on Supabase with Postgres, auth, and row-level security, the right spine for production and the wrong one for a pitch, because nobody creates an account to evaluate an idea. 1Decision 01A product about privilege cannot be judged from screenshots, but nobody signs up to evaluate a pitch. Chose: I cut the deployed surface down to a marketing page plus a no-login demo where one seeded SEC enforcement case is shared by both identities, switchable from any page. Traded: The demo path bypasses the auth and row-level security the product markets, so the trust layer is asserted in the demo rather than exercised. 2Decision 02The demo chat originally read its matter and documents from Supabase, so any environment without database access threw a 500 that read as a broken AI key. Chose: I replaced Supabase in the demo path with in-memory stores seeded on boot, with Vercel Blob holding the file bytes, and pinned the stores to globalThis so dev reloads would not wipe them. Traded: Demo state resets on every redeploy and cold start, fine for a pitch and useless for a real customer.

The chat itself carries the trust story. Claiming the AI read the documents is unverifiable, so the answer had to prove it. 3Decision 03A client cannot verify a claim that the assistant read their documents; answers had to point back at sources. Constraint: Anthropic caps cache-tagged content blocks at four per request, so only the first four documents get prompt caching. Chose: I passed each shared file to Claude Sonnet 4.6 as a document block with citations enabled, then streamed the answer as plain text followed by a JSON block of citations that the UI renders as source chips under the message. Traded: The stream format is a byte-exact contract with the client parser, and a change on either side silently breaks citations. 4Decision 04A legal assistant that answers legal questions is practicing law without a license. Chose: I scoped the system prompt to preparation only: organize facts, build timelines, draft questions for the attorney, and redirect any legal question to the attorney by name. Traded: The assistant declines the most impressive-sounding queries on purpose, which makes the demo calmer but keeps the privilege story defensible.

Result

The demo is deployed to Vercel and runs end to end with no login. In my own walkthrough, the assistant answered an interview-prep question by assembling a dated timeline from the five seeded documents and cited each source by filename, and the audit trail recorded both chat turns with token counts and cited documents seconds later. The attorney side reviews client uploads, shares documents to the workspace, and exports the audit log as CSV or JSON.

It is still a working prototype, not an audited product: the demo intentionally skips the auth and RLS layers a real deployment would stand on, and the beads issue tracker holds the follow-up work, including migrating the chat route to the Vercel AI SDK. What the build confirmed is the same lesson as my search prototype: when the story you are selling is trust, the fastest way to make it credible is to let a skeptic act it out.

Gallery

Attorney audit trail logging live chat turns with token counts and the documents each answer cited
Attorney audit trail logging live chat turns with token counts and the documents each answer cited
Attorney dashboard listing the seeded case, In re Harrington, SEC Enforcement Inquiry
Attorney dashboard listing the seeded case, In re Harrington, SEC Enforcement Inquiry
Attorney matter view with a client upload pending review and five documents shared to the client workspace
Attorney matter view with a client upload pending review and five documents shared to the client workspace
Client chat answer assembling an SEC interview timeline from shared documents, with citation chips naming each source file
Client chat answer assembling an SEC interview timeline from shared documents, with citation chips naming each source file
Client workspace opening message beside the documents panel, everything marked privilege protected
Client workspace opening message beside the documents panel, everything marked privilege protected
Demo identity picker offering the lawyer view as Dana Miller or the client view as James Harrington on the same case
Demo identity picker offering the lawyer view as Dana Miller or the client view as James Harrington on the same case
Marketing landing pitching AI-assisted legal prep with privilege preserved
Marketing landing pitching AI-assisted legal prep with privilege preserved