To let AI agents query company data safely, connect them through MCP servers that are read-only by default, run under the asking person's own identity, choose from governed definitions rather than writing free SQL, and log every call. Most major data platforms now ship a managed MCP server that already enforces your existing permissions.

Why “just give it a SQL login” goes wrong

The tempting shortcut, once a team has an AI assistant they trust for drafting and summarising, is to hand it a database login and let it write its own queries. It feels efficient, and for a single curious question it can even work. It goes wrong at scale for a specific, predictable reason: a large language model asked to write SQL against raw tables has to guess which tables, joins and filters “revenue” or “active customer” actually means, and it guesses differently each time it is asked. The result is not a system that fails loudly. It is a system that answers confidently and wrongly, in a way nobody checks because the query looks plausible.

There is a second, quieter risk sitting underneath the first: a shared, all-access login has no idea who is actually asking. Once an assistant can query anything a service account can see, “can Sarah see this contract” and “can the assistant answer using this contract” become two different, unsynchronised questions, and the gap between them is exactly where oversharing happens. Neither problem is really about AI being untrustworthy. Both come from skipping the same two disciplines that database access always needed: agreed definitions, and access that follows the person, not the tool.

The six rules

None of this needs to be complicated, and none of it is unique to AI. It is largely the same discipline any well-run reporting system already needed, applied consistently to an assistant that can now ask its own questions.

  1. Agents pick from a governed menu; they don't write SQL on production

    Route metric questions through a semantic layer, relationship questions through predefined query templates, and document questions through permission-trimmed retrieval. Free-form text-to-SQL stays in a sandbox for exploration, never against a live system a decision depends on.

  2. Act as the person asking, not as a super-user

    On-behalf-of authentication (Entra delegated access, a warehouse's own row-level security, or an equivalent) means each query runs with the asking person's real permissions, not a shared service account's.

  3. Least privilege at the tool level

    Read-only by default, with access scoped to exactly what one job needs. Anything that writes or deletes sits behind a separate, explicit step-up, and anything irreversible waits for a person to approve it.

  4. Return evidence with every answer

    The metric's definition, where the number came from, and a query reference, so an answer can be checked rather than taken on faith.

  5. Log everything, and evaluate continuously

    Every call recorded, and a set of known-answer questions re-run whenever a model, schema or definition changes, so drift gets caught before a client or colleague does.

  6. Label and block at the source

    Sensitivity labels and data-loss-prevention rules stop restricted content reaching an agent's context in the first place, rather than trusting the agent to notice and decline politely.

The order matters less than covering all six. A team that nails read-only access but skips governed definitions still gets confidently wrong numbers; a team with a beautiful semantic layer but no permission model still risks an agent repeating something it should never have been shown.

What this looks like, platform by platform

The good news, as of September 2026, is that most of the platform-specific plumbing already exists. The differences are in exactly what each platform’s MCP server lets an agent do, and what governs it.

MCP access by platform
PlatformWhat the agent can doWhat governs it
dbtQuery semantic layer metrics, browse lineage and freshness, run SQL or text-to-SQL in scoped casesRead-only access layer; plan-dependent tools; OAuth or tokens
Power BI / Microsoft FabricDiscover reports and models, run DAX over a certified semantic model, browse OneLake tablesMicrosoft Entra OAuth; existing permissions enforced; audit logging
SnowflakeAsk natural-language questions over semantic views (Cortex Analyst), search, run SQL with an optional read-only flagInherits the warehouse's own role-based access control and masking policies
DatabricksNatural-language analytics (Genie), document retrieval, SQL, governed functions as callable toolsUnity Catalog permissions; OAuth scopes per server; usage monitoring
Neo4jRead the graph schema, run read or write Cypher, call graph algorithmsAn explicit read-only mode plus the database's own role model

Server names and GA/preview status current as of the sources below. Last verified: September 2026.

The pattern across every row is the same: the platform’s own permission system, not a new one built specifically for AI, is what decides what the agent can see. That is deliberate. A second, parallel access-control system invented just for AI is one more thing to keep in sync, and the kind of thing that quietly drifts out of date within a year.

A reference architecture

  1. Person asks

    Claude, Copilot or another assistant the team already uses, signed in as themselves.

  2. MCP server, read-only

    One governed connection per platform, running under the asking person's own identity.

  3. Governed layer

    A semantic layer for metrics, a query template for relationships, or permission-trimmed retrieval for documents: never a raw table.

  4. Source system

    The warehouse, Fabric estate, graph or document store, queried only for what that person is already allowed to see.

  5. Answer, with evidence and a log entry

    A cited, checkable answer, and a record of exactly what was asked and returned.

The same shape of access, whichever platform sits behind it: governed, scoped to the person, and logged. Illustrative interface

Notice what does not appear in that chain: a step where the assistant writes its own SQL against a live system, and a step where it operates as anyone other than the person who asked. Removing those two steps is most of what makes this safe.

Proving it works before anyone relies on it

A governed connection is not finished the day it is switched on. The detail that separates a system people actually trust from one that quietly drifts is a small, standing set of known-answer questions: real questions with a checked, correct answer, run against the connection before launch and again after anything changes upstream. A new column in the warehouse, a redefined metric, or a model upgrade can each change what an agent returns without anyone noticing until a wrong answer surfaces in a meeting.

Re-running that question set on a schedule, and after any material change, turns “we think it’s still working” into something you can actually check. It is also, deliberately, the same discipline good analytics teams already applied to dashboards before AI made it tempting to skip: define what “correct” looks like once, and test against it repeatedly, rather than trusting that nothing quietly moved. The audit log from rule five earns its keep here too: when a known-answer test does fail, the log usually shows exactly which query or definition changed, rather than leaving a debugging exercise from scratch.

A staff policy, worth copying and adapting

Most of the friction in getting this approved internally is not technical; it is that nobody has written the rule down where staff and IT can both point at it. A short, plain policy tends to do more good than a long one nobody reads. A reasonable starting point, to adapt to your own systems:

A short AI data access policy

  • AI assistants connect to company data only through an approved MCP server, never a shared database login.
  • Access is read-only by default. Any write action needs a named, documented business reason and sign-off.
  • An assistant only ever sees what the person asking could see themselves. No shared, all-access service accounts.
  • Answers involving a business metric come from an agreed definition, not an improvised query, and say so.
  • Every query is logged, and someone is named as responsible for reviewing the log on a set schedule.
  • Sensitivity labels and data-loss-prevention rules apply to AI the same way they apply to a person, with no separate exemption.

Adopting even that short a list, and actually enforcing it, closes most of the realistic gap between “our team pastes exports into a chat tool” and a governed MCP integration an AI agent can be trusted to use unattended for read access.

What this deliberately doesn’t solve

None of the above fixes a semantic layer that was never built, or definitions that were never agreed in the first place: an agent given governed, read-only, logged access to bad definitions will simply return bad definitions faster and more confidently. It also isn’t a substitute for the ordinary access-control housekeeping most businesses already owe their systems: stale accounts, over-broad group membership and unreviewed permissions are still worth fixing on their own merits, whether or not an AI assistant ever queries the data behind them. Safe AI access assumes the underlying data governance is basically sound, and makes it visible rather than inventing it.

Getting started without a big-bang rollout

The businesses that get this right rarely start with every system connected at once. A focused first build, scoped to one or two platforms and a specific set of questions, tests the whole pattern (governed menu, act-as-user, logging) end to end before it is extended further. That is deliberately the same shape as an MCP integration for one system: pick the job, scope the access tightly, prove it with real questions, and only then decide what to connect next.

Illustrative interface

Frequently asked questions

Can AI query our database directly? Is that safe?

It can, through the Model Context Protocol, but letting it write free-form SQL against a live production database is not wise. Connect it read-only, through approved definitions and query templates, running with the asking person's own permissions and a full audit log, and keep free-form SQL for a sandbox copy.

What is MCP and why does it matter for our data?

MCP is an open standard, now governed by the Linux Foundation's Agentic AI Foundation, that lets AI assistants such as Claude, ChatGPT and Copilot connect to tools and data in one consistent way. It means a single, governed connection to your data can serve whichever AI assistants your team actually uses.

How do you stop AI showing people data they should not see?

By making the agent act as the person asking, not as an administrator: syncing document permissions, honouring sensitivity labels and row-level security, defaulting to read-only access, and logging every query. The access rules are the ones you already manage, not a parallel system to keep in sync by hand.

Will connecting AI to our data lock us into one vendor?

Not if you lean on open standards where they exist. MCP itself is vendor-neutral, most platforms' semantic layers are portable in plain text or YAML, and keeping definitions in version control means moving platforms later is an export, not a rebuild.

What happens if an agent tries to do something it should not?

With least privilege set up properly, it mostly cannot: a read-only connection has no write tool to call, and anything genuinely irreversible sits behind a human approval step. The audit log then shows exactly what was attempted, which is the detail that turns a near-miss into a fixable pattern rather than a mystery.

How long does it take to set up safe MCP access to our data?

A focused build, for one or two platforms with a clear scope, is usually two to four weeks: agreeing which systems and questions are in scope, configuring the MCP server and its permissions, and testing against a set of real questions before anyone relies on the answers day to day.

Sources

  1. MCP security best practices. Model Context Protocol project, July 2026.
  2. MCP joins the Agentic AI Foundation. Model Context Protocol Blog, December 2025.
  3. About the dbt MCP server. dbt Labs, 2026.
  4. What is the Fabric MCP Server. Microsoft Learn, 17 September 2026.
  5. Cortex Agents and the Snowflake MCP server. Snowflake Documentation, 2026.
  6. Managed MCP servers on Databricks. Databricks Documentation, 2026.
  7. Neo4j MCP server. Neo4j (GitHub), 2026.