All posts
July 30, 2026·4 min read

AI for Lawyers With No Data Leak — Locally

How a lawyer can analyze contracts and case materials with a local AI, without uploading documents to an external chat, while keeping full control over the files.

AI is genuinely good at taking the mechanical part off legal work: finding discrepancies, building a timeline, comparing drafts. But a contract or case file can't just get carried thoughtlessly into the nearest chat. These documents often contain personal data, commercial terms, and correspondence a client shared for a specific purpose.

A local model solves exactly the problem of sending text to an external AI provider: the file gets processed on your computer or inside your firm's own perimeter.

What tasks you can hand to a local model

  • Compare two drafts of a contract and list the substantive changes.
  • Pull dates, amounts, parties, and obligations into a table.
  • Find contradictions between an appendix and the main text.
  • Prepare a list of clarifying questions for the client about missing documents.
  • Build a timeline from case materials with links back to the source files.

The best results come from tasks where the answer can be checked against the document. "Assess all the legal risks" is too vague; "find the clauses about unilateral price changes and cite the section numbers" is an actual working request.

What a private setup is made of

A label saying "local AI" alone isn't enough. The model actually has to run on your own computer, the files need to sit in a controlled folder, and the agent shouldn't be quietly using a cloud API in the background.

In Doka, you can pick a local model and give it access to a working folder with PDFs, DOCX files, and spreadsheets. Once the model is downloaded, no internet is needed for generation. If documents live in an internal system, access to it can be set up through MCP, with a dedicated account and minimal permissions.

Local processing doesn't make a computer secure on its own. Check disk encryption, backups, the app's logs, and other users' permissions on the device.

A safe workflow

Create a dedicated case folder and put only the necessary document copies in it. In the task itself, forbid changing the originals, and ask for the result to be saved as a separate file. For a first pass, a phrasing like this helps:

Extract the dates and parties' obligations from the documents. For every conclusion, cite the source file and section. If something isn't there, write "not found" — don't fill in a guess.

Then the lawyer checks the citations against the originals. Only after that is it worth asking for a draft position, letter, or a statement of disputed points. Separating fact extraction from conclusions makes checking a lot easier.

Where AI can't be trusted

A model can invent a contract clause, misread a scan, or cite a nonexistent regulation. It doesn't know all the facts of a case and bears no responsibility for the advice. So the final legal assessment, checking the current state of the law, and any document going to a client or a court stay the specialist's job.

Working with poor scans needs particular care. Check OCR quality on a few pages first: a mixed-up digit in a date or amount changes the meaning far more than an awkward phrasing in an answer would.

How to pick a model

For pulling out terms and comparing texts, a compact model that fits in 16 GB of RAM is often enough. For long sets of documents, context and source search matter more — that's where local RAG helps, not just a bigger model.

You can start with one anonymized contract, measure the time and number of corrections, and only then move the process onto real material. The general risks of uploading files are covered in the article on whether you can upload documents to AI. The same document-comparison mechanics work for checking a bid submission for contradictions before filing.

Why a cloud option is off the table here, fundamentally

A lawyer's constraint is stricter than in most professions, and it's not about convenience.

Case materials, clients' personal data, attorney-client privilege — this is material you can't upload to an outside service, even one that promises not to store your requests. You can't verify a provider's promise, and the responsibility for a disclosure stays with you. A public chatbot isn't "less convenient" for this kind of work — it's simply not usable.

A local model settles the question technically, not just legally: a request never leaves the computer, because there's nowhere for it to go. It's the only setup where the question "where did the contract text end up" has a verifiable answer.

Doka works exactly this way: the model downloads into the app and computes on your machine, documents open where they live, with no upload to the cloud. Download it for free and test it on one anonymized contract — an honest way to evaluate the benefit before trusting the tool with real material.

And what doesn't change under any configuration: the model makes mistakes and doesn't replace a lawyer. It cuts down the time spent on review and search, but the conclusions and the responsibility stay yours, and disputed wording gets checked by a person.