Masked at the moment of reading, AI included
DataAstra
Brightmoor is a sample retailer we built to prove the platform. Its loyalty programme holds members' names, email addresses and postcodes. Two people work with that table in the same afternoon.
Tomasz is the customer steward. He reads the member table and sees the real values, because looking after customer records is his job. Sam is a sales data engineer. He runs the same SELECT on the same table and sees each email as a hash and each name redacted. The same email gives the same hash every time, so Sam can still count members and join on them. He cannot read who they are.
Neither of them is looking at a copy. There is one table, and the platform decides, for each person, at the moment they read it, what they get back.
The rule is code
Brightmoor's masking rules are written in its setup worksheet, in its repository. This one is quoted as it is:
CREATE POLICY IF NOT EXISTS 'mask-member-email' (TYPE = 'data_masking', PRIORITY = '100', ENABLED = 'true',
RULES = '{"rules":[{"tag":"pii.direct_identifier.email","except_roles":["CUSTOMER_STEWARD"],"action":{"kind":"mask","mask":"hash"}}]}');
The rule names a classification, not a column. Any column tagged as an email address is hashed for every reader except those holding the customer steward role. A new table with an email column needs a tag, not a new policy. When rules overlap, the higher priority wins, then the more specific tag.
One decision, every path
A policy that holds in one tool and not the next is a policy with a door in it. So the decision is taken once, by governance, and every path that reads data asks for it:
- SQL. A query in the workbench,
SELECT *included, answers under the reader's masks. The SQL answer matches the column policy governance gives for that person, value for value. - The catalog's sample. Opening a table's sample shows the rows masked for the person looking. A steward and an engineer see different samples of the same table.
- Apps and APIs. An app reads its data under the grants and masks of the person viewing it, not of the person who built it.
- Pipelines. The compiler takes the same answer when it plans a pipeline.
- Lineage. A table a person may not see keeps its place in the lineage graph, showing only what its classification allows.
There is no second copy of the rules for any of these. That is the difference between read-time masking and masking at copy time: a policy attached to a copy can be lost in the next copy, while a policy taken at read has nothing to lose.
The AI path
This is where most platforms make an exception, usually without saying so. An AI feature needs data, so it gets a service account, and the service account reads everything.
On DataAstra an agent task inside a pipeline reads as the run's principal: the person who ran it, with their masks and their row filters. If Sam runs a pipeline that asks a model to label rows, the task reads the rows Sam may read, with the email hashed, exactly as his own SELECT would. If there is no principal to read as, the task fails closed and reads nothing.
The platform's own engine, the part that watches the estate for changes, is held to the same line. In the sample retailer it reads the estate as a role whose description in the seed says it plainly: no exemption from any masking policy. The hosted model the engine calls never sees row values; it works through tools that return masked results.
And the AI is accountable in the usual ways. Every model call is admitted against the organisation's AI policy, written to one ledger with its cost, and a change the engine proposes waits for a person in the approvals inbox.
Where it stops
Masking is enforced where DataAstra reads and serves the data. Somebody who connects to the warehouse directly with their own credentials is governed by the warehouse. We say so on the trust page.
A pipeline is the other edge. A deployed pipeline runs with its domain's rights, which can be wider than its author's, so masking at read cannot stop it on its own. That gap is closed at publish: a pipeline that would read data hidden from its author waits for a second person.
How this differs from classify once
We wrote earlier about classifying a column once: how a tag travels down compiled lineage to columns nobody tagged. That post is about where the classification goes. This one is about when it is enforced: at the moment of reading, for every reader, the AI included, with no path that skips it.