Back to writing
ArchitectureAIGovernanceDataSecurity

Data Governance for AI: Context Is Data Too

Wictor VargasWictor Vargas6 min

Data governance for AI: context is data too.

In the previous article, I wrote about multi-model routing and why choosing a model should be a decision made per task.

But there is one question that almost always shows up too late in that conversation:

Where does the data go when the router picks a model?

When a system starts using several models, several vendors, and several context sources, the paths data can take multiply.

And what is not designed is not governed.

The data left the database

For a long time, data governance had a clear address.

Data lived in databases and data warehouses. Governance took care of who could access which tables, for how long, and for what purpose.

In AI systems, the same data passes through many other places:

  • Prompts, assembled at runtime with user information
  • Vector indexes, with document chunks copied and turned into embeddings
  • Caches, which store questions and answers for reuse
  • Traces, which record the full context of every interaction
  • Model vendors, which receive the content for processing
  • Agent memory, which persists information across sessions
  • Evaluation sets, built from real production cases

Each of these points is a copy.

And each copy is a risk surface that traditional governance does not see.

The risks that show up in production

In most of the projects I follow, data problems in AI do not come from sophisticated attacks.

They come from decisions nobody made explicitly.

Some common examples:

  • A restricted document is indexed without its source ACL, and the assistant starts citing it to anyone
  • A user asks for their data to be deleted; it disappears from the database but stays in the vector index and the traces
  • Personal data is sent to a vendor in another region without anyone assessing the impact
  • A semantic cache returns one customer's answer to another customer
  • Real cases with sensitive data become fixed examples in the prompt or in the test set

None of these cases is a model failure.

All of them are architecture failures.

The four principles I use

When I design the data layer of an AI system, I start from four principles.

1. Permissions travel with the data

If a document has access restrictions, every chunk derived from it carries the same restriction.

In the index, in the cache, and in the context.

Search filters by what that user is allowed to see before ranking, not after generating the answer. This is the same principle behind permission-aware RAG: the model only receives context that is already authorized.

2. Minimum necessary

The model does not need everything that is available. It needs what is enough for the task.

In practice:

  • Mask or pseudonymize personal data before building the prompt
  • Send fields, not entire records
  • Avoid putting sensitive data in fixed prompt examples
  • Define per task which data classes may enter the context

Less data in the context means less risk, lower cost, and often better answers.

3. Traceable lineage

For each answer, it should be possible to know where every piece of information came from.

That requires recording:

  • The original source of each chunk
  • The version of the knowledge base
  • The transformations applied
  • The vendor and region that processed the call

This is where governance and observability meet. The trace that explains an answer is the same one that proves where the data came from.

4. The lifecycle includes the copies

Retention and deletion have to reach every place the data ended up.

If data is deleted at the source, the architecture needs to propagate that to:

  • The vector index
  • The caches
  • The stored traces
  • Agent memory
  • The evaluation sets

Without that design, every deletion request becomes a manual investigation.

And, at some point, something gets forgotten.

Vendors are part of the architecture too

Using third-party models means sending data outside your perimeter.

That is not a problem in itself. But it needs to be a conscious decision, recorded and reviewable.

Some questions that should have answers before any integration:

  • Does the vendor use the data sent to train models?
  • How long is the data retained on their side?
  • In which region is the data processed?
  • Which data classes may be sent to this vendor?
  • What happens to the system if this vendor has to be replaced?

Here the router from the previous article becomes a governance tool. A rule like "health data only goes to approved vendors in the right region" lives in one place and applies to every call.

Data protection laws, such as Brazil's LGPD, already require purpose limitation, necessity, and transparency.

In AI, meeting those principles depends much more on architecture than on a policy document.

Governance is not a brake

There is a common perception that governance slows down AI adoption.

In my experience, the opposite happens.

Teams without data governance get stuck in the pilot. Every new source requires a round of approvals, every incident triggers a full review, and every legal team says "no" because it cannot see what is happening.

Teams with governance designed from the start can say yes more often, because they know how to answer:

  • What data the system uses
  • Who can see what
  • Where the data goes
  • How to delete it when needed

Well-designed governance is not what keeps AI from reaching production.

It is what lets it stay there.

Where to start

A pragmatic path:

  1. Map the data flow of each AI feature, including indexes, caches, traces, and vendors
  2. Classify the data that enters the context: public, internal, personal, and sensitive
  3. Propagate source ACLs to the index and filter before ranking
  4. Mask personal data before the prompt and before storing traces
  5. Define per vendor which data classes may be sent and in which region
  6. Implement cascading deletion for every derived copy
  7. Record lineage in the trace of every answer

You do not have to solve everything at once. But the map needs to exist before the next incident.

Final reflection

In traditional systems, data governance could be treated as a layer around the system.

In AI, it has to live inside it.

Because the context that makes an answer useful is made of the same data that needs to be protected.

Context is data too.

And ungoverned data, in a system that copies, transforms, and sends information on every call, is risk piling up in silence.

Protecting it does not depend on the model.

It depends on how the system was designed.

It is architecture.

Wictor Vargas
Written by Wictor Vargas

AI & Systems Architect. A new article every 15 days.

Enjoyed the article?Share it with someone taking AI to production.
Biweekly newsletter

Continue this reading in your inbox

Join the newsletter and receive new articles every 15 days on architecture, AI, governance, and the decisions that connect technology to business.

Read next