Not tax advice. Computation tools only. Have a professional check your work before filing.
All posts

How to Build an AI Tax Agent That Cites Its Sources

Michael Cutajar|11 May 2026|4 min read
developersaitaxmcpopen-sourcetutorial

Anyone can build an AI agent that spits out a tax number. The hard part — the part that makes it usable in the real world — is building one that can show why the number is what it is, and that knows when to stop and hand off to a human.

This is the architecture I'd use, learned from building exactly this for tax.

The principle: the model applies rules, it doesn't invent them

The single most important design decision is this: the language model should never be the source of the tax rule. Its job is to apply a rule it was given, plug in the user's numbers, and explain the working. The moment the model is also the source of the rate or threshold, you've built a hallucination machine with good formatting.

So the agent needs three things wired in from the start:

  1. A verified source of rules it reads from, not from memory.
  2. A citation trail so every figure traces back to where it came from.
  3. An escalation path for anything that needs human judgement.

Step 1: Ground the agent in verified rules

Connect the agent to an authoritative source of tax rules over MCP. The OpenAccountants server exposes verified skills — rates, thresholds, deductions, deadlines, and computation steps — that the agent fetches by jurisdiction and tax type.

In your agent loop, the pattern is:

1. Identify the user's jurisdiction + tax type
2. Fetch the relevant skill via the MCP server
3. Apply the rule's steps to the user's facts
4. Return the result WITH the rule it came from

The agent is now computing from a source instead of recalling from training data. That's 80% of the reliability gain right there.

Step 2: Make it cite — every figure, every time

A tax answer with no provenance can't be trusted or corrected. Build citation into the output contract, not as an afterthought. Every rate, threshold, and step in the agent's answer should reference the verified skill (and, through it, the underlying legislation) it came from.

A useful test: if a user (or an accountant) reads the output, can they trace any single number back to a rule without asking the agent a follow-up? If not, your agent isn't citing — it's asserting.

Step 3: Build in escalation — knowing what it can't answer

This is what separates a toy from something you'd put in front of a client. Not every tax question has a clean, deterministic answer. Some require professional judgement; some are genuinely ambiguous or high-risk.

Design your agent to classify each rule it touches:

  • Deterministic — clear-cut. The agent applies it directly. ("The standard rate is X.")
  • Judgement required — the rule exists but applying it to these facts needs a professional. The agent flags it rather than guessing.
  • Escalate — complex, ambiguous, or high-stakes. The agent stops and tells the user to get a human.

An agent that confidently answers everything is more dangerous than one that knows its limits. Build the limits in.

Step 4: Close the loop with a real human

For the flagged and escalated items — and for any output the user will actually file — route to a qualified accountant. OpenAccountants has a built-in handoff for exactly this: the agent's work goes to a credentialed professional who reviews it and stands behind it.

That handoff is what makes the whole thing trustworthy. The agent does the fast, deterministic work and shows its sources; the human owns the judgement calls. Speed and accountability, instead of one at the expense of the other.

Putting it together

A good AI tax agent looks like this:

  • Reads verified rules from an authoritative source (not its training data)
  • Cites every figure back to that source
  • Classifies what it can answer deterministically vs. what needs a human
  • Escalates the judgement calls to a qualified accountant

Build it that way and you get an agent that's genuinely useful and genuinely safe — one whose answers an accountant could review without wincing.

The skills are open-source and the MCP server is free to connect. Start here, and if you want to see the coverage first, browse the library.