A CTO friend recently asked me a simple question: how do you approach data protection now that AI is part of the analytics stack? It's a good question, and every data leader I talk to is working through some version of it right now.
My answer covered several layers of controls, and the conversation was useful enough that I wanted to write it down. I run a data platform company, so this is the framework we use at Datasparks, but the questions behind it apply to any stack, whether you build your own, buy one, or use ours.
Data protection for AI is a chain of custody with four links: where the data lives and what is allowed to leave, who can reach the data, what the data is and where it came from, and what the model is actually allowed to see. Each link limits what the next one has to catch.
How AI changes the threat model
For most of the last two decades, data protection followed a familiar pattern. You secured the perimeter, secured the database, and configured and audited the people who accessed it. That model assumed the consumers of data were people, or deterministic applications written by people, whose behavior was (somewhat) predictable and whose access could be reviewed.
AI introduces a different kind of data consumer. A language model works better with more context, uses that context non-deterministically, and in many deployments runs on a third party's infrastructure. That creates four new risks:
- Over-broad context. The simplest way to make an AI agent "smart" about your data is to hand it everything: whole tables, whole folders, whole document stores. Most of that data has nothing to do with the question being asked (and costs a lot of tokens).
- Boundary crossing. Data sent to an external model API leaves your environment, so what crosses that boundary, and how much of it, becomes a security question in its own right.
- Loss of attribution. When an agent retrieves data on someone's behalf, it is often unclear who asked, what was retrieved, and why.
- Untraceable answers. An AI-generated answer that can't be traced back to its source data is difficult to trust and hard to audit.
Least privilege and data minimization are old principles. What has changed is that they now have to apply to the agent as well as to the people.
The design constraint: protection has to be invisible
A good design also has to hide all of this from the end user.
Security that adds friction doesn't stay in place for long. When the protected path is slow or restrictive, people route around it. They export spreadsheets, paste data into consumer chat tools, and build shadow AI workflows that nobody governs, and the organization ends up with less protection than it started with. The goal is to make the protected path the easiest path and provide the best results, so that users ask their questions naturally and the controls do their work underneath.
Layer 1: controlling the infrastructure and the boundary
The first link in the chain is physical and network control. We run our production compute on our own hardware, and customer-facing traffic comes in through infrastructure that we operate. That gives us direct control over how the environment is reached. Encrypted backups and storage replicas are kept with a cloud provider for disaster recovery, because a single site with no off-site copy would be its own kind of risk.
Like everyone doing serious data analysis today, we use external model APIs. The leading models run on their providers' infrastructure, and that is where the capability is. Sending some data to a model is therefore a given, which makes the useful question what data leaves and how much of it. Our own services build the requests that go to the model, and any data the model asks for along the way passes through limits and boundaries that we set, so we decide what goes into it. The AI harness described in Layer 4 is how we make that decision precisely.
Side note: egress is also where a lot of organizations get surprise bills. Cloud providers commonly charge for data transferred out of their networks or across regions, and those charges are easy to miss until the invoice arrives. Pulling large datasets out of a warehouse to feed an AI workflow can be expensive in ways that never show up in the project plan, so keeping egress small also keeps costs down.
Layer 2: every query has a name
The second link is identity. Every request to read customer data in Datasparks is authenticated and tied to a signed-in user, and large downloads use short-lived links that are issued only after a permission check. Actions are checked on the server against that user's permissions, not in the browser. There are no shared logins that blur who did what.
This puts governance with the data owner, where it belongs. Customers manage their own team and decide who joins each project and in what role. A project admin manages the project and its members, an editor works with the data, and a viewer has read-only access. Those decisions are enforced on the server.
The important extension for AI is that the model has no access of its own. AI Studio is available only to the project roles that are allowed to use it, and the AI's data queries run read-only and are limited to the project that the user is working in. Access inside a project is project-wide rather than row-by-row, so the AI works within the same project boundary as the person asking, and it can't modify the underlying data.
Agentic use (in our future and probably yours) provides the agent with a short-lived token granted by the person user's login at the start of the session. All of this together preserves attribution. Every access, whether a person makes it directly or AI makes it on that person's behalf, ties back to a named individual.
Layer 3: provenance and lineage
The third link is knowing what the data actually is. We run the ingestion, harmonization, and transformation pipeline that turns raw source data into analysis-ready data, and we define the data model at the end of it. That means the ontology and the semantic layer are built into the application itself and into the prompts our AI features use. We don't bolt on a separate semantic-layer product to make sense of a warehouse full of inconsistent tables after the fact, because the data isn't stored in that state. Data products carry lineage for each record, meaning the raw source, the pipelines and calculation that produced it, alongside a quality score and the quality rules that were applied to it.
This matters for AI in three ways. First, the model works from governed definitions instead of guessing at what raw tables and cryptic column names mean, and better inputs produce more accurate answers with fewer invented interpretations. Second, an AI answer can be traced back to the exact query that produced it and from there to the pipeline that built the data, which makes the answer something you can defend to an auditor or a skeptical executive. Third, quality is part of what the model sees. AI reports and insights are given quality statistics and the active quality rules, so a reading that a quality rule flagged can be called out instead of quietly turning into a confident conclusion.
Layer 4: the AI harness and minimum necessary data
The final link, and for the AI era the most important one, is control over what the model actually sees.
We wrap AI use and AI data access in a harness. The harness is the layer between the model and the data, and it guides the model to request only the data needed to answer the user's question. Depending on the question, that might be returning summary statistics ("What's the p95 bearing temperature on pump_1?"), or an aggregation ("What is the average bearing temperature for all Acme pumps?"), or a focused subset when record-level detail is genuinely required ("What was the 1-minute bearing temperature in the hours before the pump failure?").
In practice, our AI reports, chart insights, and quality-rule recommendations are built from statistics that the platform computes first, so the model receives summaries rather than raw rows. In AI Studio, our conversational agent, the harness steers the model toward aggregation. The model sees only a small capped preview of any query result. Results that would be too large, above 50 million rows, are refused and the model is told to narrow or aggregate, and every query is also held to limits on how much it can scan and how long it can run. The AI only sees what's needed to answer the user's question.
A user wants to know whether customer churn increased last quarter. A simple implementation sends the model the entire customer table, with names, contacts, contract values, and history, and lets it work out the answer. A better implementation sends a filtered list of the customers who churned. The harness sends the churn rate by month. All three produce the same answer, while the amount of data exposed, and the amount of egress, shrinks sharply from the first to the last.
One doorway that can be audited
The harness has a second benefit. When AI Studio needs data, the request passes through the harness, so there is a single doorway for AI data access. Every query that the AI runs is recorded alongside the conversation turn that produced it. For any answer, you can see who asked, the exact query, and the size of the result that came back.
Compare that with the patterns that many organizations are using today. An agent pointed at a shared drive full of files can read anything within reach, and there is little record of what it opened, why, or how much of it ended up in a model's context window. A simple API sitting on a database will log the query, but it loses the surrounding context: which user's question prompted it, what the intent was, and what data ultimately reached the model. A harness turns AI data access from a diffuse, hard-to-observe activity into one that you can review.
How the layers work together
Each of these layers is sound practice on its own. Following one question through the chain shows how they combine.
A signed-in user asks a question in plain language, and their identity and project role travel with the request. The model writes a query, and the harness steers it toward the smallest one that can answer the question, preferring statistics and aggregations over raw records, and records what ran. That query runs against harmonized, lineage-tracked data with quality information available to the AI. Only the necessary result goes out to the external model, which keeps both exposure, token cost, and egress cost to a minimum.
This is defense in depth in the traditional sense. If any one layer is misconfigured or bypassed, the others still limit what can go wrong. None of it asks anything extra of the user, who asks a question and gets an answer whose sources can be traced.
Questions worth asking of any AI data stack
The framework above is how we approach the problem, but the questions behind it apply to any environment. If you're evaluating how ready your organization is for AI-driven data access, these are the ones that I'd start with:
- Do you know what data leaves your environment, and what that transfer costs?
- Does AI act within your users' permissions, or does it run with a service account that can see more than any single user should?
- Can you trace an AI-generated answer back to its source data when an executive or auditor asks where a number came from?
- What limits how much data the model actually sees? Is there a mechanism that favors summaries and aggregations over raw records (and guides the model to the summary and aggregation queries that your business has blessed), or does the model receive whatever is available and model your data however it likes?
- Is AI data access recorded in one place, or does it happen through many unlogged paths such as shared drives, ad hoc API keys, and direct database connections?
- Can you do all of this without adding friction for your users?
None of these questions has a single right answer, and every organization's constraints are different. You may or may not agree with how we've answered them, and I think that's a good thing. If you're working through the same questions, I'd be glad to compare notes.