Skip to main content
Hamza Khan

Services / Legal AI Engineering

Legal AI engineering, from first workflow to daily use

I build AI workflows for law firms and legal teams inside the tools they already use, from contract review in Word to intake and firm knowledge, with human review, checks you can verify, and any AI model you choose.

No legal advice. A person approves every consequential step.

contract-review · firm playbook

Select a clause to review it

DEMO-1042 · Services agreement. 7. Limitation of liability: Supplier's total liability shall not exceed the fees paid in the prior three months.

  • get_playbook(limitation_of_liability): position found, 210ms
  • retrieve_precedents(DEMO-1042): 3 sources, 640ms
  • check_permissions(user): allowed, 90ms
  • write_audit(decision): saved, 120ms

Cap below firm position. Suggested redline: twelve months' fees, per the firm playbook. Sources (3).

Accepted. Lawyer accepted the redline. Model: any.

Illustrated view
  • 3+ years building legal technology
  • Contract review inside Word, with any model
  • Microsoft 365 and SharePoint integrations
  • Security-tested before launch

01 / Who this is for

For the people who own legal work, not just the AI budget

Law-firm innovation, KM and operations leaders

You know which tasks AI should help with, but you don't have the engineering capacity to connect firm sources, add review steps and keep workflows working as models change.

Legal AI advisers and consultancies

You set the strategy. You need an engineer who can build the workflow, integrations and checks behind your recommendation.

In-house legal and legal ops teams

You need repeatable workflows for contracts, requests and summaries that respect permissions and keep a person accountable.

Building a legal-tech product? See product and systems engineering

02 / Works around your tools

Works around the tools you already have

Many firms already use Microsoft Copilot or a legal AI platform. The gap is usually the work around the tool: the right sources, permissions, review steps, checks, and keeping it working.

Configure, extend or build
  1. 01 · Configure

    When it fits

    Your approved tool can already do the job.

    What I do

    Structure prompts, templates and sources; define review steps; document how attorneys use it.

  2. 02 · Extend

    When it fits

    The tool needs your firm's data or systems.

    What I do

    Connect Microsoft 365, SharePoint, document stores, case data and research sources such as LexisNexis; add checks before output reaches attorneys.

  3. 03 · Build

    When it fits

    No tool fits the workflow or your control requirements.

    What I do

    Custom workflow software or Word add-ins with retrieval, approvals, audit trail and a model-agnostic harness.

Where lawyers work · Legal platforms, models and data

Where lawyers work

  • WordAdd-ins and redlines
  • OutlookEmail intake and drafts
  • TeamsApprovals and alerts
  • SharePointFirm knowledge
  • OneDriveMatter files
  • ExcelTrackers and schedules
  • Microsoft GraphMicrosoft 365 data
  • Entra IDSign-in and permissions
  • Microsoft CopilotConfigure and extend
  • Microsoft AzurePrivate hosting
  • E-signatureSigning steps

Legal platforms, models and data

  • LexisNexisResearch sources
  • HarveyLegal AI platform
  • Case managementMatter data by API
  • Court noticesCM/ECF and e-filing
  • OpenAIGPT models
  • AnthropicClaude models
  • GeminiGoogle models
  • LlamaPrivately hosted models
  • Mistral AIOpen-weight models
  • LangChainAgent workflows
  • PostgreSQLAudit and matter data
  • RedisQueues and caching

If your current tool's builder is enough, I'll tell you. Not every task needs custom engineering, and some don't need AI.

Product names and logos are trademarks of their owners. Shown to identify integrations; no endorsement implied.

03 / Contract review in Word

Contract review where lawyers already work

A Word add-in that brings your firm's knowledge into the document: playbooks, preferred positions and clause libraries. It reviews a contract against them, and the lawyer accepts, edits or rejects each suggestion. A harness layer sits between Word and the model, so the firm can use OpenAI, Anthropic, Google or a privately hosted model and change models without rebuilding the workflow.

  • Firm knowledge in the side panel, not a separate app
  • Any model through one harness: permissions, sources and checks stay the same when the model changes
  • Every suggestion is the lawyer's call, and decisions are recorded

Delivered for law firms · under NDA · walkthrough available on a call

How firm knowledge is organised
Model-agnostic harness

Word add-in

7. Limitation of liability

Liability is capped at the fees paid in the prior three months.

Review against playbook

Harness

Same controls for every model

  • Firm knowledge

    Playbooks, clause library

  • Permissions

    Matter access only

  • Checks

    Agreed test set

  • Audit

    Every decision logged

Checks run on the answer

Model

OpenAI

Answered

Pick a model

Changes each run

Word: lawyer decides

Suggested redline · Sources (3)

Capped at three months' twelve months' fees.

  • Accept
  • Edit
  • Reject
Change the model, keep the controls.Illustrated view

04 / Workflows to start with

Six legal workflows to start with

Each one keeps a person at the checkpoint before anything leaves the firm.

  • Delivered · NDA

    Contract first-pass review in Word

    Lawyers spend first-pass time checking clauses against positions the firm already agreed.

    1. Contract
    2. Review against firm playbook
    3. Lawyer accepts or editsPerson
    4. Recorded
  • Delivered · case study

    Client intake to attorney review

    Calls and emails arrive unstructured, and staff re-key the same details.

    1. Call or email
    2. Structured matter data
    3. Staff reviewPerson
    4. Attorney queue
  • Delivered · NDA

    Answers from firm knowledge

    The answer exists somewhere in the firm, but finding it takes longer than redoing it.

    1. Question
    2. Permission-aware retrieval
    3. Reviewer checks sourcesPerson
    4. Answer with sources
  • Delivered · NDA

    Matter follow-ups and summaries

    Case activity piles up faster than anyone can summarise it or follow up.

    1. Case activity
    2. Summary or follow-up draft
    3. ApprovalPerson
    4. Sent and logged
  • Example scope

    Drafting from firm templates

    First drafts start from the right template but miss facts nobody noticed were absent.

    1. Matter facts
    2. Template draft
    3. Attorney editsPerson
    4. Missing-info flags resolved
  • Built to your process

    Custom workflows around how your firm runs

    Your process doesn't match a product's template. The AI layer should fit the way your firm already works, not the other way round.

    1. Your trigger: matter, email or document
    2. Firm rules, sources and AI steps
    3. Named reviewer approvesPerson
    4. Into your systems, logged
See all legal workflows

05 / How an engagement runs

How an engagement runs

  1. 01

    Understand

    Sit with the people who do the task; map sources, owners and risks.

    → Workflow map

  2. 02

    Scope

    Agree deliverables, access, review points and the checks that define good output.

    → Acceptance criteria and test set

  3. 03

    Build

    Prompts, retrieval, templates, integrations and review steps.

    → Working workflow in a test environment

  4. 04

    Verify and hand over

    Run the checks, fix what fails, document limits and walk the team through it.

    → Check results, documentation, walkthrough

  5. 05

    Maintain

    Re-run checks when models, sources or practice needs change.

    → Change log and updated prompts and sources

06 / Quality you can check

Checks agreed before the build, run again on every change

Illustrative checks for a contract-review workflow. Each one is agreed with your team before building and re-run whenever something changes.

Source support
Each point traces to a firm source or retrieved passage.
Playbook position
Suggestions match the firm's agreed position for that clause type.
Missing information
Gaps are flagged, not filled in.
Defined terms
Redlines keep the contract's defined terms and cross-references intact.
Permission boundary
Users only see sources they're allowed to see.
Confidential data
Client details stay out of logs and prompts that leave the firm's boundary.
Escalation
Defined cases route to a person.
Planted instruction
A hidden instruction inside a contract is ignored.
Repeatability
The same contract gives the same review on every run.

When the model or platform changes, the checks run again before attorneys see the change.

How I test AI before launch
contract-review · v1.3 → model change
  1. Source support

    24/24 points cited

    Passed
  2. Playbook position

    11/11 clauses matched

    Passed
  3. Missing info

    3 gaps flagged

    Passed
  4. Defined terms

    0 broken references

    Passed
  5. Permission boundary

    2 restricted sources hidden

    Passed
  6. Confidential data

    0 client details in logs

    Passed
  7. Escalation

    Indemnity routed to partner

    Passed
  8. Planted instruction

    Hidden text ignored

    Blocked
  9. Repeatability

    5 runs, same review

    Passed
Ready for attorneys
Illustrated view

Control

  • What the AI may do, and where a named person approves
  • Which sources it uses and who can access them
  • Every action and approval recorded
How governance and data control are handled

07 / Evidence

Public proof, and the rest on a call

Case study

From first contact to attorney review

An implemented intake system for a US personal-injury firm. AI prepares the next step; an attorney approves it before anything runs.

  • 3 channels

    Voice, email and documents

  • Every action

    Approved before it runs

  • Full trail

    Action-level audit log

Read the case study

Most delivered legal work is under NDA, so firm names aren't shown. I can walk through architecture, prototypes and decisions on a call.

Questions

We already use Copilot or Harvey. Why would we need an engineer?

To connect them to your sources and systems, add review and checks, and keep them working. If the tool's own builder is enough, I'll tell you.

Can we use our own AI model?

Yes. The harness layer works with OpenAI, Anthropic, Google or a privately hosted model, and the permissions, sources and checks stay the same when you switch.

Does the Word add-in send our documents to an AI provider?

That depends on the model and hosting you choose, and it's agreed before build. A privately hosted model keeps processing in your environment. See AI and data governance.

How do you decide whether a task should use AI at all?

I look at volume, whether reliable sources exist, how the output will be checked, and the cost of an error. Some tasks are better served by rules or templates.

How do we know it works?

The checks are agreed before building and run before handover, then again whenever the model or sources change.

Do you give legal advice?

No. Your attorneys make every legal decision. I build and test the system that supports them.

Can we see past work?

Most is under NDA. The intake case study is public, and the rest can be walked through on a call.

Next step

Tell me the task, who does it today and what a good result looks like. I'll tell you whether it fits and how I'd approach it.

Book a call(opens in new tab)

30-minute intro call · or email hkhantanoli@gmail.com(opens in new tab)

No legal advice. A person approves every consequential step.

Last reviewed