Skip to content
  • AI
  • OpenAI
  • Product design

An AI chatbot for a law firm that never gives personal legal advice

For Stonebridge Legal, I built a chatbot that explains UK immigration in general terms and hands anything personal to a booked consultation. The hardest design decision was what it must never do.

Toukir Ahmed Rony · · 4 min read

Diagram: a chat question splits into two paths, an answer with general information on visa routes, documents and firm fees, or a handover to book a consultation.

Stonebridge Legal Solutions is a UK law firm whose website and booking system I built: first independently in Laravel, then as a TypeScript rebuild through SETS Tech, which I still maintain. Before that, the firm had a WordPress site, clients had to phone to book, and enquiries were missed. Now clients read the firm's services and fixed fees, and book a consultation online at any time. The firm gets 30+ online bookings a month, plus 50+ enquiries a month through WhatsApp.

The firm also wanted a chatbot. Clients ask the same questions again and again: which visa route fits me, what documents do I need, how much does a consultation cost, how do I book? A chatbot could answer those at 2am, when nobody is in the office.

The hard part wasn't making the chatbot talk. It was deciding what it must never say.

The line it must not cross

A general AI assistant will try to answer anything. Ask it about your immigration case, and it will give you a confident answer. For a law firm, that is dangerous. Advice on someone's own case has to come from the firm's advisers, who know the client's full situation and are responsible for what they say.

So the main rule for the Stonebridge chatbot was written before anything else: it never gives personal legal advice.

Helpful first, personal never

That rule could easily turn into a bot that refuses everything, which would help nobody. So the line sits between information and advice.

The chatbot runs on a large language model. The firm can switch between OpenAI and Gemini from its admin panel, without a redeploy. It is told to actually help first: explain the visa routes, the main requirements, the documents usually needed and rough timescales, in general terms, before it mentions a consultation.

What it must not do is tell a visitor whether they personally qualify, predict the outcome of their application, estimate their chances, or tell them what to do in their own case. This is that part of its instructions, word for word:

BOUNDARIES (respect these, but never let them turn into a refusal to help)
- Explaining the law, the routes and the requirements in general terms is
  information, not advice. Give it freely and in useful detail.
- Do NOT tell a visitor whether they personally qualify, predict the outcome of
  an application or appeal, estimate their chances of success, or prescribe a
  course of action for their individual case. When asked those, explain what
  factors decide it and what an adviser would examine, then suggest the
  consultation.
- Never invent Home Office rules, fees, or processing times. If you are not
  sure of a current figure, describe what generally applies and say the exact
  figure should be confirmed with an adviser or on GOV.UK.
- You are not a substitute for regulated advice, and should not imply you are.

There is one more limit. About the firm itself, such as opening hours, offices, consultation fees and how to book, it may only use a fixed list of facts we give it. If something about the firm isn't on that list, it says so and suggests calling or emailing.

The handover

When someone asks about their own case, the bot explains what an adviser would look at, then offers a consultation. When it does, its reply ends with a "Book an appointment" button. That starts the booking right inside the chat, or opens the booking page already filled in. Availability is checked, and both the client and the firm get a confirmation email.

These rules are instructions to the model, not a hard wall, so I don't rely on them alone. Messages that look like a request for personal advice, such as "my visa was refused" or "what are my chances", are flagged for the firm to review. They are never blocked. And every conversation is saved in the admin chat logs, so the firm can see what the bot actually said.

Why handover matters more than the answers

It is tempting to measure a chatbot by how many questions it answers. For a law firm, I think the better measure is how well it hands over.

A visitor who asks about their own case is a potential client with a real problem. If the bot tried to answer that personal question, the firm would risk giving bad advice and lose the chance to help properly. If it gives useful general information and then hands over cleanly, that visitor becomes a booked consultation.

What it costs

The limit has a cost, and the firm agreed to it knowingly: some visitors want a straight yes or no on their own case, and the chatbot won't give one, so they still have to book. A chatbot that answers everything would feel more impressive in a demo. It would also be the wrong product for a law firm.

Why this interests me beyond one project

This project is a small example of a question I care about a lot: how do you make AI useful in a real business without letting it do things it shouldn't? The answer here was not a smarter model. It was a clear line between information and advice, a well-designed way out to a human, and a log the firm can check.

It's close to the question behind my research: how reliable and safe AI is when it meets real business software.