Speak to our team+44 20 3769 7682+1 325 244 5212
WORK · LEGAL REASONER · MULTI-TENANT

One model, forty firms, zero leaks.

Legal AI at 40 firms means 40 different style guides, 40 different archives, and 40 regulators who'd lose their minds over any data crossing. We built a multi-tenant legal reasoner where isolation is cryptographic, style is per-firm, and the same underlying model serves all tenants — cheaply.

Client
European legal software vendor · NDA
Industry
Legal Tech · Multi-Tenant SaaS
Year
2025
Type
AI Platform · Infra
Tenants live
40
Cross-tenant leaks
0
Shared model infra
1
Per-firm style fidelity
94%
Cost per query
−73%
001 · The situation

Multi-tenant legal AI is a landmine field.

Every firm demanded “our AI knows our style” and “our data never touches anyone else's.” Most vendors solved this by running a dedicated model per firm — expensive and slow to update. We solved it with a shared model plus per-tenant LoRA adapters, envelope-encrypted indexes, and a retrieval layer that enforces isolation at the query planner.

01

Per-firm style without per-firm models.

Firms needed their tone — without us managing 40 fine-tunes and 40 eval harnesses. Infra costs on a dedicated model per firm were a non-starter.

02

Hard isolation.

Retrieval had to be tenant-locked by construction. A bug in a join couldn't cross data. Operational isolation wasn't enough — architecture had to enforce it.

03

Per-firm regulators, per-firm rules.

UK, EU, US firms all had different regs. The platform had to let each tenant configure its own guardrails on top of the shared base — without reflavoring the model.

002 · The shift

Shared core. Separate state. By architecture.

The industry kept solving multi-tenant AI with brute force: make another model. We built a substrate where the model is shared and the data isn't — enforced cryptographically at the retrieval boundary, not in a runbook.

How multi-tenant legal AI was done
01
40 dedicated models
One fine-tune per firm
02
40 deploy pipelines
One per model
03
40 eval harnesses
Drift discovered per-firm
04
New firm = 6–8 weeks
Train, ship, eval
05
Ops team groans
Infra cost 40× baseline
Result: 40× infra cost, 6–8 week firm onboarding, 40 drift patterns discovered separately, and isolation that lived in ops tickets instead of code.
How we built it
01
Shared base model
One deploy for all
02
Per-firm LoRA adapter
Small · hot-swappable
03
Envelope-encrypted index
Per-tenant KEK
04
Isolation planner
Scoping by construction
05
New firm = 6 hours
Key · ingest · LoRA · live
Result: 1× infra cost, 6-hour onboarding, one eval harness with per-tenant tags, and cross-tenant data crossings that are literally unconstructible in the query plan.
003 · System architecture

Shared reasoning core. Per-tenant everything else.

The Tenant Isolation Layer is the entire product. Every request passes through it, every retrieval is scoped by it, every response is voiced by the tenant's LoRA. The shared core is pleasantly ignorant of which firm it's serving.

01

Per-Firm Apps

Every firm gets the same surface, branded and styled as theirs. The login is per-firm; the session token is short-lived and scopes every downstream operation to that tenant.

Firm A App
UK · Commercial
Firm B App
EU · M&A
Firm C App
US · Employment
Firm N …
+37 firms
02

Tenant Isolation Layer

The tenant JWT triggers everything. LoRA adapter loads with the firm's style. Tenant guardrails apply jurisdiction-specific rules. The isolation planner rewrites every query to be tenant-locked before retrieval runs.

Tenant JWT
Short-lived
Per-Firm LoRA
Style adapter
Tenant Guardrails
Jurisdiction-aware
Isolation Planner
Query rewriter
03

Shared Reasoning Core

One planner, one reasoner, one verifier, one citation checker — shared across all 40 firms. They never know which tenant they're answering for; the LoRA adapter handles the voice, the isolation planner handles the scope.

Planner
Shared
Reasoner
GPT-4o + LoRA
Verifier
Shared
Citation Checker
Shared
04

Per-Tenant Retrieval & Storage

Each firm's index is envelope-encrypted with a tenant-specific key in KMS. Our platform can't decrypt a firm's data without their live JWT. S3 prefixes and row-level security add belt-and-braces.

Firm A Index
KEK-A
Firm B Index
KEK-B
AWS KMS
Per-tenant keys
Per-Tenant Audit
Isolated lake
004 · Anatomy of isolation

Two firms, one model, zero crossing.

Two concurrent queries hit the same reasoner at the same millisecond. Same model weights. Different LoRA adapters. Different indexes. Different ledgers. The platform — our platform — cannot decrypt either firm's data without their live JWT.

01
TWO FIRMS · 11:42:00.417
Concurrent inbound · same millisecond

Firm A (UK · commercial) asks about a termination clause in their matter M-4421. Firm B (EU · M&A) asks about change-of-control language in their matter M-A09. Two JWTs arrive in the same millisecond.

Same cluster. Same base model. Different tenants. The isolation machinery kicks in before either hits the reasoner.
02
ISOLATION · TS
// Request A (Firm A)           Request B (Firm B)
swap(lora, firmA);             swap(lora, firmB);
plan  = planner(A.query);      plan  = planner(B.query);
scope = planner.scope(A.jwt);  scope = planner.scope(B.jwt);
// scope.tenant_id = "A"       // scope.tenant_id = "B"
idx   = decrypt(kms, A.kek);   idx   = decrypt(kms, B.kek);
// ↑ impossible without A.jwt  // ↑ impossible without B.jwt

answer = reason(plan, idx, scope);
ledger[A.tenant].append(...)   ledger[B.tenant].append(...)
Same code. Two execution lanes. A bug in the planner can't cross scopes — the scope object is part of the retrieval signature.
03
RESULT · PER-FIRM
Firm A voiceUK commercial
Firm B voiceEU M&A
Firm A citesFrom KEK-A only
Cross-tenantNot possible
Ledger Alg_A_4f21
Ledger Blg_B_8c03
Neither firm knows the other exists on the platform. Both get dedicated-model fidelity, both pay shared-model prices.
005 · End-to-end flow

Every request carries its tenant context.

Six steps. Every one scoped by the tenant JWT. A missing scope throws; an expired scope refuses. The default posture is refuse — which is the right default for a multi-tenant legal system.

  1. 01

    Tenant JWT

    <5MIN

    Short-lived, per-firm-scoped token. Carries firm ID, jurisdiction, user, and role — expires in five minutes.

  2. 02

    LoRA Swap

    HOT SWAP

    Model loads the firm's style adapter. Per-firm voice, same base weights. Swap takes milliseconds.

  3. 03

    Isolation Plan

    BY CONSTRUCTION

    Query planner rewrites retrievals to be tenant-locked. Cross-tenant paths are rejected at the planner, not at the DB.

  4. 04

    Per-Firm Retrieval

    KMS-SCOPED

    Index is envelope-decrypted with the firm's key only. Data never leaves the tenant boundary.

  5. 05

    Grounded Reasoning

    GROUNDED

    Shared reasoner composes the answer — style from the LoRA, substance from firm-only sources.

  6. 06

    Audited Response

    PER-TENANT

    Response logged to the tenant's audit lake with full reasoning trace. No cross-tenant visibility, ever.

006 · Capabilities

Six capabilities. All multi-tenant-safe.

What shared-core multi-tenancy actually costs and earns: voice without a fine-tune, isolation by construction, per-firm guardrails, and same-day onboarding for the 41st firm.

01

Per-Firm LoRA Style

Voice without a fine-tune.

Each firm&apos;s voice is a small adapter, not a fine-tuned base model. Hot-swapped per request. Update once, applies to every request from that firm instantly.

LoRA adaptersHot swapPer-firm training
02

Envelope-Encrypted Indexes

We can't read your data.

Each firm&apos;s index is encrypted with a tenant-specific KEK in AWS KMS. Our platform can&apos;t decrypt firm data without the tenant&apos;s live JWT. Marketing-safe claim.

AWS KMSPer-tenant KEKEnvelope encryption
03

Isolation Planner

Cross-tenant queries don't compile.

Query rewriter enforces tenant scoping before any retrieval runs. Cross-tenant joins are literally unconstructible in the query plan — not just forbidden, but impossible.

Scoped plansPer-query proofReject-by-default
04

Jurisdiction-Aware Guards

Per-firm regulators, per-firm rules.

Each firm configures its own guardrails — PII, privilege, regulatory, retention — layered on top of the shared base. Changes ship as firm-scoped config, not platform code.

Config-as-codePer-firm overrideAudit-logged
05

Tenant-Tagged Audit

Per-firm history, nowhere else.

Every reasoning trace is written to the tenant&apos;s own audit lake, queryable only by that firm. Our operators can&apos;t browse it; regulators can request it scoped to one tenant.

Per-tenant lakeSigned traceRegulator-ready
06

6-Hour Firm Onboarding

From handshake to live, same day.

New firm? Provision KEK, ingest archive, train LoRA on their past work. Live the same day. The onboarding runbook fits on one screen.

Provision scriptLoRA pipelineSmoke eval
007 · Outcomes

18 months in production. 40 tenants. 0 crossings.

Numbers below are measured across 18 months with 40 tenants live. The cross-tenant incident count is the metric the vendor's buyers screen on — and it's the number that unlocks enterprise procurement cycles.

Infra cost per firm
−96%
vs dedicated model
Onboarding time
−98%
weeks → hours
Cross-tenant incidents
0
zero by architecture
Style fidelity · blind test
94%
indistinguishable
Firms live
40
18 more onboarding
008 · The stack

What we built it with.

KMS owns every key. JWT owns every request scope. LoRA adapters own every firm's voice. LangGraph owns the reasoning trajectory. Langfuse lets operators watch any tenant's flow without decrypting their data.

01

Models

  • GPT-4o
  • LoRA adapters
  • Claude 3.5 verifier
02

Isolation

  • AWS KMS
  • Envelope encryption
  • JWT short-lived
  • Row-level security
03

Backend

  • Python 3.12
  • LangGraph
  • FastAPI
  • Temporal
04

Data

  • Postgres
  • pgvector
  • S3 per-tenant prefix
05

Infra & Obs

  • AWS
  • EKS
  • Langfuse
  • OpenTelemetry
009 · OUTCOME
Our firms asked how we gave them dedicated AI for the price of shared AI. We told them we designed it that way. Cryptographic isolation isn't marketing — it's our architecture.
— Head of Product, European legal software vendor (NDA)

Multi-tenant legal AI that was supposed to be impossible — it wasn't. Shared economics, per-firm style, cryptographic isolation. The model serves 40 firms and will serve 400, without 40× the infra or a second eval team.

Build with us

Want a case study with your name on it?
Let's start the conversation.

Tell us what you're trying to build. We'll be honest about what's hard, what's worth it, and whether we're the right partner for the job.

30-minute call·Written audit within 5 days·No slide deck