⚠️ Evaluation release — a reference implementation, not production software. Not for live client matters. Seedocs/LIMITATIONS.mdfor what is and isn't ready.
An open-source workspace for AI-assisted legal work in England and Wales. It records sources, model calls, review, edits, and human sign-off against each matter.
Open source, runs locally, bring your own model key.
The loop is draft, cite, sign-off, audit. AI prepares an output inside a matter and cites the documents used. A named person reviews it and records a decision. The decision pins the reviewed output by hash.
flowchart LR
A[Documents<br/>in the matter] --> B[AI drafts<br/>+ cites sources]
B --> C[Named person<br/>reviews]
C --> D[Sign-off<br/>pins output by hash]
A -.-> R[(Append-only<br/>hash-chained record)]
B -.-> R
C -.-> R
D -.-> R
Matter actions handled by Legalise write to an append-only, hash-chained audit
log. The log is tamper-evident, not tamper-proof. See
docs/TRUST.md for the claim boundary and open gaps.
A worked evaluation workspace around the Khan v Acme sample matter:
- Documents: upload, extraction, version history, disclosure flags, and owner-scoped original-file access.
- Chat and skills: work against selected matter documents through a shared model gateway.
- Review and sign-off: record
signed,signed_with_observations, orrejected; pin the reviewed output by hash. - Activity and export: inspect the matter record and export its documents, outputs, sign-offs, source anchors, and audit data.
The runtime includes capability checks, matter privilege settings, an advice-boundary gate, and one model gateway for Anthropic, OpenAI, OpenRouter, and Ollama. Users bring their own model keys. Legalise does not provide model access.
Skills arrive by import. The
awesome-legal-skills
(Lawve) catalogue is browsable in-app, and any public GitHub repo with a
SKILL.md can be dropped in by URL (e.g.
pre-motion). Each import becomes a
draft pinned to a commit SHA. It must pass the admission flow and receive
matter-level permissions before it can run.
- Documents and source anchors used by a Legalise workflow.
- Model, token, latency, posture, and prompt/response hashes for gateway calls.
- Review decisions, tracked edits, sign-offs, and refusals.
- An append-only audit row and hash-chain entry for recorded matter actions.
Each entry folds the previous entry's hash into its own, so changing one entry breaks the chain from that point on. That is what "tamper-evident" means here: not that the record can't be altered, but that alteration shows.
flowchart LR
E1["Entry 1<br/>source.attached<br/>hash: a3f2…9c"] --> E2["Entry 2<br/>model.call<br/>hash: d81e…44"]
E2 --> E3["Entry 3<br/>document.edited<br/>hash: 6b0a…e1"]
E3 --> E4["Entry 4<br/>matter.signoff<br/>hash: f97c…08"]
E1 -.->|prev hash| E2
E2 -.->|prev hash| E3
E3 -.->|prev hash| E4
A database superuser can rewrite unanchored history by disabling the controls.
External anchoring is not built. See
docs/TRUST.md.
legalise.dev hosts a guided demo of the Khan v Acme workspace and the architecture write-up. The hosted backend is currently turned off: there are no hosted accounts, model calls, or matter storage. Run the complete workspace locally or on your own infrastructure with your own model keys.
Email andrew@legalise.dev with questions.
Stack: Postgres, MinIO, Redis, Gotenberg, FastAPI, React.
-
Clone.
git clone https://github.com/b1rdmania/legalise cd legalise -
Run quickstart. It copies
.envif needed and starts the compose stack../scripts/quickstart.sh
To skip local image builds when published images are available:
LEGALISE_USE_PREBUILT_IMAGES=true ./scripts/quickstart.sh
-
Create the first account. Open http://localhost:3000 and sign up. In local dev the first user is verified, seeded with Khan v Acme, and promoted to workspace admin automatically. No bootstrap CLI step is needed.
-
Run the loop. The five steps the workspace exists for, in order:
- Create a matter — or open the seeded Khan v Acme.
- Add documents — drag/drop into the matter; bodies are extracted.
- Ask the assistant — Chat over the documents you select.
- Run a skill — Skills → Add skill to inspect a Lawve skill, convert it to a governed draft, run the trust ceremony, enable it on the matter, then run it from chat.
- Sign the output, then export the working pack — review the output and record a sign-off, then export the matter ZIP (documents, audit trail, outputs, sign-off records, source anchors, integrity flag).
-
Check the stack with
legalise doctor. Inspection only; verifies the database is reachable, migrations are current, MinIO is responding, plugins are mounted, and the v2 manifests validate.docker compose -f infra/docker-compose.yml exec backend python -m app.tools.doctor
To check the fork end-to-end without driving the UI by hand, run
./scripts/smoke.sh. It runs the same Playwright first-run spec as CI
(truncates the local database; see the script's prompt).
If you don't want quickstart to clone the skills catalogue or start compose:
-
Copy env.
cp .env.example .env
-
Bring the stack up.
docker compose -f infra/docker-compose.yml up -d
-
Register the first user at http://localhost:3000. With
LEGALISE_DEV_AUTO_ADMIN_FIRST_USER=true(the local default), that user becomes workspace admin. With the flag off, run the bootstrap CLI after signup:docker compose -f infra/docker-compose.yml exec backend \ python -m app.tools.bootstrap_admin --email you@example.com
- Deploying your fork to Fly: change
app = "legalise-backend"inbackend/fly.tomlbeforefly deploy. - GHCR images are published by
.github/workflows/container-images.ymlas multi-arch (linux/amd64+linux/arm64, incl. Apple Silicon). Local quickstart builds from source by default; setLEGALISE_USE_PREBUILT_IMAGES=trueto pull the published images instead. - For setup problems, run
legalise doctorand open an issue if a fresh fork won't come up. - Backup, restore, and operations runbooks are maintained outside this public repo. Open an issue if you're self-hosting and need them.
Evaluation release. Not for live client matters.
NB — the honest state of it. The audit engine is complete and strong. The document editor, the LLM layer, and matter organisation are about 80% there. Chasing a perfect open-source legal workspace was draining time in a lane that's already crowded, so treat this as an open experiment: come in as a contributor and close the gap, or take the audit engine and plug it into the workspace you already have. Throw the repo at your LLM and see what it thinks.
The hosted backend is built and functional, but switched off — self-hosting is the supported path. If you'd run the hosted version as a pilot, email andrew@legalise.dev.
- What works is in the CHANGELOG, and you can run all of it: the full matter loop, audited retrieval, sign-off, export, and a deterministic eval harness (agent-kit) that gates grounding, refusal, and audit-chain integrity in CI.
- What's deliberately out of scope, or not production-grade, is in
docs/LIMITATIONS.md— gaps first. - What's planned is in
docs/ROADMAP.md.
Start with docs/:
docs/TRUST.md: privilege architecture, sub-processors, open gaps (read first)docs/ARCHITECTURE.md: how it works today, cited to codedocs/EVALUATING.md: the walkthrough and the evaluation gatedocs/THREAT_MODEL.md: adversary model and what we don't defenddocs/LIMITATIONS.md: what is not production-grade and what a fork must build (read before building on top)docs/adr/: architecture decision records — why the system is shaped this way and what not to refactordocs/ROADMAP.md: shipped, deferred, parkeddocs/ATTRIBUTIONS.md: credits and licence notes
Operator material is maintained outside this public repo. Open an issue if you're self-hosting and need something that isn't here.
You don't need to touch the core. The easiest ways in: practitioner feedback
(no code, corrections with authority attached), a one-row eval case, or a
governed legal skill built in your own repo and listed in the
community catalogue with a one-row PR. The ladder, the
ground rules, and the dev setup are in CONTRIBUTING.md;
skill authoring is in docs/BUILDING_SKILLS.md.
Not legal advice, not a law firm, not for live client matters. Real regulated use needs the firm's own supervision, policies, model-key posture, and professional controls.
Apache 2.0. See LICENSE.
@b1rdmania. Open an issue, or get in touch if you're a UK solicitor wondering what your AI did with the client documents.
Forks are independent deployments, not operated, reviewed, or endorsed by the maintainer unless stated.
The loop end to end: open source, the workspace, skills installing with explicit grants, the record building step by step, and the tamper-evident chain.
https://github.com/b1rdmania/legalise/raw/master/docs/media/legalise-demo.mp4
Or watch it with sound on legalise.dev.


