#AI agent for law firms and professional services

An AI agent for a law, accounting or consulting firm answers new enquiries on WhatsApp and your website, asks the few questions that classify the matter, books a first consultation in your calendar, and tells existing clients what stage their matter is at once your backend has checked who they are. It never gives legal or tax advice and never predicts an outcome. With Vatio you describe that agent in one vatio.yml file and it runs on your own WhatsApp number and your site.

This guide builds one for a firm of lawyers and accountants, end to end.

#What the agent handles

Most of what reaches a firm’s reception is a handful of conversations:

A typical exchange, with what the agent did inside:

Visitor: hi, my company got a notice from the tax office and I don’t understand it

Agent: I can book you with our tax team. Is there a date on the notice, a hearing or a deadline to reply?

Visitor: it came last week, says 30 days to reply

Agent: Thanks. Ms. Rojas has Tuesday at 11:00 and Wednesday at 16:30. Which one works? Bring the notice and your last two tax returns.

Behind the last reply were one knowledge lookup and one call to find_slots. What it did not do matters as much: it did not count the days left or say what the notice means. That is the lawyer’s job.

#Before writing anything: five questions for the firm

  1. Which practice areas does it route to? And what the firm does not take, so the agent can say so early.
  2. What must it never say? Advice, readings of the law or of a document, chances of winning, amounts, timelines, whether a deadline has passed.
  3. What is urgent? A detention, a hearing tomorrow, a filing due this week, in the firm’s own words, and where to send people.
  4. Which systems does it read from? The calendar’s API, the case management system, the fee schedule.
  5. What does the firm need before a first meeting? Usually the other party’s name, for a conflict check.

#The vatio.yml

workspace: vidal-rojas
agent:
  name: Vidal & Rojas
  personality: Courteous, precise and brief. Plain words, no legal jargon.
  instructions: |
    You are the front desk of Vidal & Rojas, a firm of lawyers and
    accountants. You take new enquiries, book first consultations, tell
    existing clients what stage their matter is at, and answer questions
    about practice areas and fees.

    New enquiries: ask, one at a time, whether they write as a person or a
    company, what the matter is about in one or two sentences, and whether
    there is a hearing, notice or deadline. Match it to a practice area in
    knowledge_lookup. If none fits, say the firm may not handle it.

    Booking: call find_slots for that area and offer at most three times.
    Before calling book_consultation, ask for their full name, their email
    and the name of the other party, and read the booking back. Only say it
    is booked when book_consultation returned it. If it fails for any reason
    other than a taken slot, say the team will confirm here and hand off.

    Matter status: ask for the matter number and the client's ID number,
    then call matter_status. Share only what it returns.

    Rules you never break:
    - Never give legal, tax or accounting advice, and never say what the
      law or a document means for their situation.
    - Never predict an outcome, a chance of success, an amount or how long
      a matter will take. Never say whether a deadline has passed.
    - Ask only what you need to classify and book. If someone starts
      telling the details of their case, say a lawyer will go through them
      in the consultation.
    - Never confirm or deny that anyone is a client of the firm.
    - If someone has been detained, or has a hearing or deadline in the
      next two days, send the urgent link and hand off at once.
  tools: [find_slots, book_consultation, matter_status, knowledge_lookup, identify_contact]
  knowledge: [firm]
  links:
    urgent:
      url: https://vidal-rojas.example/urgent
      when: Someone has been detained, or has a hearing or deadline in the next two days.
  handoff:
    after_turns: 10
    when:
      - the person asks what they should do or whether they have a case
      - the person shares sensitive details of their case
      - an existing client asks about anything beyond the stage of their matter
      - a complaint about the firm's work or its fees
      - an urgent matter (a detention, a hearing or deadline in the next two days)

A few choices worth explaining:

#Tools: calendar and case system

Store the address and the key as secrets so they never sit in the repository:

vatio secrets set FIRM_API https://api.vidal-rojas.example
vatio secrets set FIRM_API_KEY sk_live_...

tools/book_consultation.yml:

description: Book a first consultation in one practice area.
when_to_use: The person chose a time from find_slots and gave their name, email and the other party.
parameters:
  type: object
  properties:
    slot_id: { type: string }
    area: { type: string, description: "labor, family, tax or corporate" }
    client_name: { type: string }
    email: { type: string }
    other_party: { type: string, description: "Person or company on the other side" }
  required: [slot_id, area, client_name, email]
access: public
request:
  method: POST
  base_url: "$env.FIRM_API"
  path: /consultations
  requires: [params.slot_id, params.client_name, params.email]
  headers:
    Authorization: "Bearer $env.FIRM_API_KEY"
  body:
    slot_id: "$params.slot_id"
    area: "$params.area"
    client_name: "$params.client_name"
    email: "$params.email"
    other_party: "$params.other_party"
respond:
  data:
    consultation: "$.consultation"

tools/matter_status.yml:

description: The current stage and next step of a client's matter.
when_to_use: An existing client asks how their matter is going and gave the matter number and their ID number.
parameters:
  type: object
  properties:
    matter_number: { type: string, description: "e.g. VR-2026-0142" }
    national_id: { type: string }
  required: [matter_number, national_id]
access: public
request:
  method: POST
  base_url: "$env.FIRM_API"
  path: /matters/status
  requires: [params.matter_number, params.national_id]
  headers:
    Authorization: "Bearer $env.FIRM_API_KEY"
  body:
    matter_number: "$params.matter_number"
    national_id: "$params.national_id"
respond:
  data:
    stage: "$.stage"
    next_step: "$.next_step"

find_slots is a GET with the practice area and a start date that returns free consultation times.

#Where the checks live

A WhatsApp or Instagram contact is anonymous until they sign in, so this tool is public, and anyone can type a matter number. Your backend checks that the matter number and the ID number belong together; the model fills the parameters, so that check cannot live in the prompt. Return the same 404 whether the matter does not exist or the ID does not match, so the tool cannot reveal which numbers are real, and return only the stage and the next step. A POST keeps the ID number out of URLs and access logs.

The conflict check works the same way: your backend runs it on other_party before booking, and when it fails, returns an error whose message names no one. Documents and invoices belong behind a login on your client portal, where a tool marked access: private reads only the matters of the client your backend signed for. See Connect your backend.

#Knowledge: practice areas, fees and the first meeting

vatio kb create firm
vatio kb write firm practice-areas practice-areas.md
vatio kb write firm fees fees.md
vatio kb write firm first-consultation first-consultation.md

Each heading should answer a question on its own:

# Fees

## First consultation
45 minutes, at the office or by video call. Fixed fee, credited against
the fees if the firm takes the matter.

## Labor claims
For employees: a share of what is recovered, set out in the engagement
letter. Nothing is charged if nothing is recovered.

Vatio does not read your website, so put what the agent needs in entries. When fees change, a supervisor can edit the entry in the inbox, and every edit is kept as a version.

#Documents, voice notes and confidentiality

Clients send PDFs and photos of notices and contracts, and long voice notes telling the whole story. Vatio transcribes the audio, passes supported images and PDFs up to 8 MB to the agent, and groups what someone sends in a row into one question. The agent reads a document the way a receptionist would, to route it: a tax notice goes to the tax team, and a date on it can make the matter urgent. It does not interpret it. Files it cannot read stay in the conversation for your team.

The agent says plainly that it is an assistant, and when it hands over it tells the person it is checking with a colleague. Whoever picks up sees the whole thread and every tool call in the inbox.

#Try it before any client does

vatio push
vatio chat "Hi, I was dismissed yesterday without notice. Can someone see me?"
vatio chat "Do I have a case? How much could I get?"
vatio chat --new "What stage is matter VR-2026-0142 at?"
vatio chat --new "Is Pedro Soto one of your clients?"
vatio chat show

The second must not predict anything, the third must ask for the ID number before calling matter_status, and the fourth must neither confirm nor deny. Then add your phone as a test number on the inbox’s Test page and talk to the agent on the shared WhatsApp preview number; no Meta account is needed.

#Make it better every week

Whoever watches the inbox flags a wrong reply and writes what should have happened. vatio flags turns those notes into a document your coding agent fixes from, and each flag becomes an eval case that live must pass before it is marked fixed. See Improve your agent.

#Go live

vatio publish

Connect the firm’s WhatsApp Business number from Channels in the inbox and switch it on. A reply from the WhatsApp Business app takes the conversation over, and the agent steps back until it is released.

Bar associations and professional bodies have rules on confidentiality, advertising and who may give advice, and some jurisdictions require telling people they are talking to a machine. Check yours before going live: Vatio gives you the controls, not the compliance.

Frequently asked questions

Can an AI agent give legal advice to my clients?

It should not, and a Vatio agent only does what its instructions allow. Write the rules explicitly (no legal, tax or accounting advice, no predictions of outcomes) and list questions about what to do under handoff.when so a professional takes them. Which professional rules apply to your firm is still yours to check.

Can clients check the status of their case on WhatsApp?

Yes, with a public tool that takes the matter number and the client's ID number. Your backend checks that the two match and returns only the stage and the next step. Documents, invoices and anything more detailed belong behind a login on your client portal, where a private tool reads only that client's matters.

How does the agent handle confidential information?

It is told to ask only what it needs to classify the matter and book a consultation, and to hand sensitive details to a person. Your supervisors read conversations in the inbox, and Vatio shows them to no one else without a sign-in or a Vatio token. Whether that meets your duty of confidentiality is for the firm to check.

Can the agent book consultations in our calendar?

Yes, through tools that call your booking system's API: one to find free times and one to book. Vatio has no built-in calendar integration. If your calendar has no API, a small endpoint in your own backend that reads and writes it is where the work goes.

Does this work for accounting and consulting firms too?

Yes. The shape is the same: intake by service line, a meeting booked in your calendar, and the status of a filing or an engagement. The never-rule becomes no tax or accounting advice and no promises about what an authority will decide.

Updated: