Analytics

Giving an AI agent access to a payments estate without giving it everything

Model Context Protocol makes exposing a transaction database to an internal agent nearly trivial. The governance you need before doing that is the entire job.

· 7 min read

Model Context Protocol standardises how a model client reaches a tool or a dataset. A server declares what it offers, a client calls it, and wiring that used to be a hand-rolled integration per data source becomes a declaration. For an internal analytics estate the demonstration is short enough to fit on a slide.

It is also, written that way, how you hand an agent the whole ledger. MCP is a transport and a capability description. It does not bring an authorisation model with it, and nothing in the protocol will stop a server from exposing a query interface that answers any question put to it.

What is missing by default

Identity comes first. An agent calling your data acts as something, and the shortcut is a service account with broad grants because that makes the demonstration work. It is also the finding that ends a vendor security review: there is no way to answer who asked a question when every question arrives as the same principal. The agent should carry the entitlements of the human it is acting for, which means the identity has to survive the hop into the tool call.

Scoping comes second. A payment aggregator's analytics estate is multi-tenant by nature, and merchant isolation is the property that must not fail. Enforce it in the data, through row-level security on the tables themselves, not in the instructions given to the model. A prompt is not a security boundary. It is a request, and a sufficiently odd question will route around it.

Column scoping is the part teams forget. A support agent answering settlement questions needs amounts, UTRs and timestamps. It does not need the mobile number, the PAN or the account number, and the cheapest way to keep those out of a model's context window is to make them unreadable to the principal the agent runs as.

Put the semantic layer in front, not the database

Text-to-SQL against raw tables is the wrong shape for financial data, for a reason that has nothing to do with security. The number an agent returns has to match the number on the merchant's dashboard. If the agent joins the tables its own way, it will sometimes be right in a way that disagrees with the reported figure, and finance will stop trusting both.

A semantic layer with a defined set of certified queries fixes the definition of “settled volume” in one place. The agent chooses between measures rather than inventing joins, and a disagreement becomes a bug in a query everyone can read instead of an argument about which answer was right.

The failure mode specific to agents

There is one risk that scoping does not remove. A model can compose two permitted calls into an answer that neither call would have produced alone. Ask for a count filtered one way, then filtered another, and the difference can identify a single merchant or a single transaction that neither query was allowed to return directly.

This is the classic aggregation and inference problem, and it arrives with agents because agents iterate. A human analyst runs the query they meant to run. An agent runs forty variations looking for a pattern. Rate limits, minimum cohort sizes on aggregate measures, and alerting on query-shape sequences are the available mitigations; none of them is complete, and anyone telling you otherwise has not thought about it.

The second-order problem is that logging prompts and responses, which you need for audit, creates a new store of exactly the data you were careful about. It inherits the residency and retention obligations of the source. Plan for that store before you create it, not after someone asks where it lives.

Why we are writing this rather than selling it

Because the gap between the demonstration and something you would put in front of an auditor is most of the work, and the demonstration is what gets shown. The protocol is genuinely useful and the governance around it is unglamorous, which is the usual ratio.

If you are considering this, the order that works is: identity first, row and column scoping second, semantic layer third, and the agent last. Starting with the agent is how you end up retrofitting a security model around something already in use.

Want this applied to your system?

A 60-minute call with the engineers who wrote this. Bring the architecture, not the brief.