---
title: "Private Legal AI — Whitepaper"
description: "Why privilege makes cloud AI hard for law firms, and how an on-device agent does contract review, case-law research and drafting without sending data."
url: "https://royalsoftworks.com/resources/legal-ai-on-device/"
source: "https://royalsoftworks.com"
format: "markdown"
note: "Markdown rendering of the HTML page at `url`. Same content, same canonical URL."
---

[All resources](https://royalsoftworks.com/resources/)

# Private Legal AI

## An On-Device Agent for Contract Review, Case-Law Research, and Drafting

**A Royal SoftWorks whitepaper · AssistantGeneral**

---

## Abstract

Legal work is the textbook case for AI that cannot use the cloud. Attorney-client privilege and confidentiality obligations make transmitting matter documents to a third-party AI vendor a professional-responsibility problem — which is why so many firms have banned cloud AI outright. Yet legal work is also document-dense, repetitive at the margins, and exactly the kind of task a capable agent accelerates. AssistantGeneral resolves the tension by running contract analysis, case-law research, and drafting on the lawyer's own machine, with answers tied to source text and a built-in professional disclaimer.

---

## 1\. The problem with cloud legal AI

A cloud legal assistant must receive the documents to help with them. For privileged and confidential material, that transmission is itself the risk — regardless of the vendor's no-training promises or regional hosting. Firms are left choosing between a capability they can't ethically use and going without. Meanwhile, generic chat tools that _can_ be used informally produce ungrounded summaries and, notoriously, fabricated citations — which in legal practice is not an inconvenience but a sanctionable event.

## 2\. The AssistantGeneral approach

AssistantGeneral runs the legal stack locally:

- The **model**, the **document index**, the **embeddings**, and the **generated drafts** all stay on the machine. A cloud model is attached only if the firm explicitly permits it through policy.
- A dedicated **Lawyer agent** carries a non-negotiable disclaimer ("general information, not legal advice — consult a licensed attorney") and a tool set scoped to legal work.
- The **groundedness gate** checks the draft's claims against retrieved evidence and re-grounds unsupported ones before the answer is shown.
- An optional **citation check** goes one step further. Groundedness can only prove a claim matches retrieved text — and a fabricated case quoted from a fabricated passage is perfectly "grounded". The citation check looks each cited case up in a public case-law database and sends the draft back if a source affirmatively reports it does not exist. A source that is offline or has no coverage never condemns a citation. It covers US case law today and proves _existence_, not good-law status; that still needs a citator.

## 3\. Capabilities, mapped to real work

AssistantGeneral ships a library of legal workflows that run against the firm's own embedded documents:

**Contract analysis**

- **Clause extraction** — dates, obligations, termination rights, liability caps, and payment terms pulled into a structured table.
- **Red-flag review** — one-sided, unusual, or missing clauses surfaced with plain-English explanations.
- **NDA comparison** — two confidentiality agreements diffed on scope, term, obligations, and remedies.
- **Contract expiry tracking** — a timeline of renewal windows and key dates across the contract set.

**Research**

- **Case-law search** — find on-point opinions, cited by case name and citation, with a preference for controlling jurisdiction and recent decisions.
- **Statutory interpretation** — relevant provisions retrieved from the firm's statute library and explained in plain English with practical guidance.
- **Jurisdiction comparison** — how a topic or obligation is treated across jurisdictions.

**Drafting**

- **Contract template population** — employment agreements, SLAs, NDAs, consultancy and licensing agreements drafted from a plain-English deal description.
- **Letter before action** — formal LBAs for debt recovery, breach, and property disputes.
- **Clause library lookup** — retrieve the firm's pre-approved standard clauses.

**Compliance**

- **Privacy policy auditor** — GDPR/CCPA gap analysis with remediation steps.
- **Data Processing Agreement checker** — verification against GDPR Article 28.

**Operations**

- **Matter intake** and a **legal FAQ bot** over firm materials.

**Jurisdiction: practice packs**

A contract, a deadline and a citation all depend on _where_ the work is done. A **practice pack** carries that as reference data — the authorities normally cited and how they are written, the usual procedures as stages with their deadlines, the documents normally filed with the sections a valid one must contain, and the checklists a careful practitioner works through. Packs ship for an international baseline (no national law named), Serbia, Germany and the United States (federal law only — it will not guess a state). Each drives six tools: side-by-side **comparison**, structured **extraction** with the source passage for every field, **cited answers** tying each proposition to authority, article and facts, a **procedure timeline**, a **drafting desk**, and a **checklist runner**. A firm can copy any pack and edit it into its own.

The procedure timeline's **deadline calculator never asks the model**. Dates are computed by local arithmetic, each stage counted from the event that actually starts its clock. Weekends are skipped; public holidays are not known, and the tool says so every time.

## 4\. How it stays grounded

Every analysis runs over the firm's **own materials**, ingested into a private knowledge base. The hybrid retriever (vector + keyword search, fused and reranked) returns the exact passages the answer relies on, with citation highlight spans — so a clause finding points to the clause. The groundedness gate then verifies the draft against that evidence and re-retrieves for any claim that isn't supported. The Lawyer agent is instructed to quote the source text it relies on and never to assert a definitive legal conclusion.

## 5\. The interface matches the work

Two workspaces, because advocacy and adjudication are opposite duties over the same documents. The **Law office** workspace is organised around a _matter_: its chats are limited to that matter's document collections (enforced in retrieval, not merely hidden), the everyday actions — intake, clause extraction, red-flag review, letter before action — are one click away, the evidence behind each answer is shown alongside it, and it produces a case summary. The **Judiciary** workspace is organised around a _case_ and uses a judge's persona rather than a client-side lawyer's: case-file summary, disputed-issues list and statutory interpretation, under a notice that cannot be dismissed — the judge decides, and nothing produced is a finding. Several workspaces can be open at once as tabs.

## 6\. For the firm: governance

When a firm standardizes on AssistantGeneral, the enterprise governance plane (running on one of the firm's _own_ machines) provides a shared, access-controlled clause and precedent knowledge base, an audit trail, a policy that can pin every seat to the on-device model and decide which workspaces and practice packs each group receives, and — enabled during a pilot — single sign-on. Anything an administrator does on a lawyer's computer is shown to that lawyer. No client material ever crosses a vendor boundary.

## 7\. Scope and responsibility

AssistantGeneral is a drafting and analysis aid for legal professionals, not a substitute for legal judgment. Its output is general information requiring attorney review; the product states this in every relevant interaction. The value is leverage on the mechanical 80% — extraction, comparison, first drafts, research starting points — under the lawyer's supervision, on data that never leaves the firm.

---

_Evaluate it offline, on a real (redacted) matter, on your own laptop. Contact Royal Softworks._

## Evaluate AssistantGeneral

See the product this paper describes — a private, local-first AI agent with an enterprise control plane that runs on your own infrastructure.

[Explore AssistantGeneral](https://royalsoftworks.com/products/assistant-general/) [Talk to us](https://royalsoftworks.com/contact/)

<!-- verse:royalsoftworks
     Psalmi 63:1
     Bože! Ti si Bog moj, k Tebi ranim, žedna je Tebe duša moja, za Tobom čezne telo moje u zemlji suvoj, žednoj i bezvodnoj.
     https://www.wordproject.org/bibles/verses/serbian/02_prayer.htm
-->
