Skip to content

Purpose-Based Access Control

Overview

Purpose-Based Access Control (PBAC) decides what a group or role sees in a data product based on the purpose they use it for. You write the row filters and column masks for a purpose once, such as Claims Processing or Research, and apply that purpose to each data product for the groups and roles that use it for that purpose.

This page explains what PBAC is for, why it is hard to do on a data platform, and how Trust3 AI handles it. To set it up, see Manage Purposes.

Where PBAC is enforced

  • PBAC is enforced only by the connectors built on Omni. Legacy PolicySync connectors do not enforce purposes.
  • Snowflake only. Purposes are enforced on Snowflake; see PBAC on Snowflake. They are not enforced on Databricks yet; Databricks support is planned. Other data platforms are not supported.
  • The Omni Connector runs on Self-Managed and Partially Managed (D2P) runtime planes. Deployments that use the PolicySync connectors cannot enforce purposes.

What is needed

Most access control answers one question: who is asking? A role or group is granted a table, and row filters and column masks decide which rows and columns that role sees. The answer is the same every time the person runs a query.

In practice, what someone should see often depends on why they are asking. Take a healthcare claims data product:

The person is... They should see
Reviewing a specific claim The member's details for that claim
Building a utilization report De-identified rows, with no direct identifiers
Running member outreach Only members who agreed to be contacted

It is the same person and the same table. The difference is the purpose.

Large organizations often add more dimensions on top of purpose:

  • Population. Which business segment or member group the rows belong to. A team may be approved for one population and not another.
  • Sensitivity. Data is classified into sensitivity profiles, and each purpose is approved for some of them.
  • Location. Onshore and offshore teams may be allowed different fields.

Access is often requested through a data catalog. The consumer subscribes to a data product and states what they will use it for, and a governance team approves the request. After that, the rules have to hold every time a query runs.

Example use cases

  • Consent. Marketing and outreach see only customers who gave consent.
  • De-identification. Analytics and research see masked identifiers. Operations sees the full record.
  • Client separation. Data held for a client is used only for that client's work.
  • Approved exceptions. A purpose that has been approved for a sensitive column can see it, while the column stays masked for everyone else.
  • Population. A user approved for one population sees only those rows.

Why it is hard to implement

Permissions are given to users, groups and roles

Data platforms such as Snowflake and Databricks grant access to roles or groups. A query does not say why it is being run, so the platform has nothing to base a purpose decision on.

The purpose therefore has to be carried by a role or group. Creating one role for every purpose on every data product multiplies the number of roles quickly, and pushes users to switch roles to get the right view.

A user can reach the same data through several roles

Most users hold more than one role or group. Each one can reach the same table with different row filters and masks, and a policy written for one route says nothing about the others.

  • In Snowflake, secondary roles let a user have several roles active at the same time.
  • In Databricks, all of a user's groups apply at once.

Without a clear rule, the most permissive route wins. A user who switches from a Marketing role to another role can lose the consent filter.

In the following example, one user holds two roles, and both reach the same claims table. Each role brings its own rules, and the policies on the table come from four sources. The platform can apply only one row filter and one mask.

flowchart LR
  U((One user)) --> C["Role: CLAIMS PROCESSING<br/>member details shown"]
  U --> R["Role: RESEARCH<br/>member IDs masked,<br/>consented members only"]
  C --> T["CLAIMS table<br/>one row filter, one mask"]
  R --> T
  S1[Resource] --> T
  S2[Tag] --> T
  S3[Data product] --> T
  S4[Purpose] --> T
  T --> Q{{"Which rows?<br/>Which mask?"}}

If both roles are active at once, as Snowflake secondary roles allow, the claims role's unmasked access can show up in research queries. The research restriction is lost without anyone choosing to drop it.

A platform allows one row filter per table and one mask per column

The row filters and masks on a table can come from four places:

  1. Policies on the resource itself
  2. Tag-based policies
  3. Data product policies
  4. The purpose applied to the data product

A user who holds several groups or roles can also get a different row filter and mask from each of them. All of these have to be merged into one answer: which rows the user sees, and which mask applies to each column.

The order of merging matters. Merged in the wrong order, the result can show more data than intended. Without a fixed order, the same policies can show different data from one sync to the next, or on one platform and another.

Trust3 AI merges them into one row filter per table and one mask per column, in a fixed order, before writing them to the platform. See How Policies Combine.

How Trust3 AI handles it

PBAC is built from three parts. Each part is defined separately, so a change in one place carries through to everything that uses it.

Purpose policies

The smallest part is a policy that does one thing to a column or to rows. Keep policies small, so they can be mixed and matched in purposes:

Kind Examples
Mask a column Redact SSN, Redact Member ID, Redact Phone Number
Show a column in the clear Show SSN, Show Member ID, Show Phone Number
Remove rows Filter out population A, Filter out population B
Keep only some rows Show population A, Show population B

A mask finds its columns by tag or classification. "Redact SSN" applies to every column tagged as an SSN, whatever the column is called, and a table without the tag is not affected. A row filter is written as a standard row filter is: it names one or more Record Identifiers, and keeps or removes the rows they match. A Record Identifier can name its column by tag with columnTag('<tag>'), so one row filter works across the differently named columns of a data product's tables.

A policy can be used in several purposes. "Redact SSN" can be in both Claims Processing and Research. Editing it changes every purpose that uses it, and every data product those purposes are applied to.

Purposes

A purpose groups the policies that matter for one way of using data. Admins mix and match what is masked, what is shown and which rows are filtered out.

Purpose Policies
Claims Processing Show Member ID, Show Phone Number, Redact SSN
Research Redact SSN, Redact Member ID, Redact Phone Number, Filter out population B

Planned: governance approval of purposes

Trust3 AI does not yet have an approval step for purposes. A purpose can be applied as soon as it is created.

Sharing a data product for a purpose

Sharing a data product for a purpose takes four steps:

  1. Select roles. Choose the groups or roles the data product is shared with.
  2. Select the purpose. Choose the purpose those groups or roles will use it for. Its policies apply to them on top of the data product's own policies.
  3. Deselect policies (optional). Turn off any of the purpose's policies that do not suit this data product. This affects this data product only. The purpose itself is unchanged.
  4. Add users to the roles. This is an external process. Users get access by being added to the groups or roles in the identity provider or the data platform, outside Trust3 AI, as they do today.

Steps 1 to 3 are one action in Trust3 AI, called applying a purpose. See Apply a purpose to a data product in the UI.

Example: the same data, two purposes

The two example purposes, applied to the same claims table for two roles. The values are made up.

Role: CLAIMS PROCESSING (Show Member ID, Show Phone Number, Redact SSN)

Member ID Population SSN Phone
M-10482 A ***-**-**** 555-0147
M-20931 A ***-**-**** 555-0193
M-30577 B ***-**-**** 555-0122
M-41206 B ***-**-**** 555-0168

Role: RESEARCH (Redact SSN, Redact Member ID, Redact Phone Number, Filter out population B)

Member ID Population SSN Phone
******** A ***-**-**** **********
******** A ***-**-**** **********

Claims Processing sees member IDs and phone numbers, with SSNs masked, for both populations. Research sees every identifier masked, and only population A, because population B is filtered out.

Principles

These rules hold for every purpose. Some are planned, as marked.

  1. Applying a purpose gives its groups and roles read access to every table in the data product. The purpose's row filters and masks then narrow what they see, and its row filters can leave a table with no rows. Removing the purpose removes that read access. A purpose cannot add a table that is not in the data product. On Snowflake this grant is on by default. This read access is not given to a purpose applied for everyone (public), or for a group that is not mapped to a Snowflake role (see Groups that are not mapped).

    Untagged and new tables are read unfiltered or unmasked

    A mask applies only to columns that carry its tag. A table, or a column, that is not tagged yet is readable without the purpose's masks as soon as the purpose is applied, and so is any table added to the data product later. A purpose row filter is skipped on a table that lacks one of its columns, so that table is read unfiltered. Tag the columns and add the row-filter columns before you apply the purpose, and review the data product's tables again whenever you add one.

    1. For columns, the purpose's policy wins, including Show. The purpose's mask wins over every other mask on the same column. A Show policy shows the column in the clear. This is how an approved exception works: a column stays masked for everyone except the groups and roles the purpose is applied for.
    2. Purposes are applied to groups and roles. A purpose is never applied to an individual user.
    3. A group or role has at most one purpose per data product.
    4. Masks find columns by tag or classification; row filters use Record Identifiers. A mask names a tag or classification, such as SSN, and applies to every column with that tag, whatever the table or column is called. A row filter keeps or removes the rows its Record Identifiers match.
    5. For rows, the purpose's filters apply together with all other filters (AND). The resource, tag and data product filters always apply, so a purpose can only narrow the rows a group or role sees.
    6. A role that inherits a purpose's role also gets the purpose's policies. On Snowflake, a user who holds the role the purpose is applied for, directly or through another role, gets the purpose's policies, whatever role is active in their session. See Which roles are checked.
    7. If a purpose's policies contradict each other, nothing is shown. For rows this holds today: Filter out population B and Show population B in one purpose show no rows. For columns it is planned: Redact SSN and Show SSN in one purpose will keep the column masked. Until then, avoid putting contradictory masks in one purpose. See How Policies Combine.

Architecture

Trust3 AI holds the policy definitions in its control plane. The Omni Connector runs in the data plane, next to the data platform. The data platform enforces the policies on every query. Trust3 AI is not in the query path.

Component Plane What it does
Trust3 AI Portal and API Control plane Where policies, purposes and data products are managed
Metadata Service Control plane Holds the data assets (resources, tags, data products) and the policies (RBAC, ABAC, TBAC, PBAC)
Omni Broker Control plane Merges the policies and translates them into constructs for each data platform
Omni Connector Data plane Applies them to the data product's tables
Data platform, such as Snowflake Outside both planes Enforces them when a user runs a query
flowchart LR
  subgraph CP[Trust3 AI control plane]
    P[Trust3 AI Portal and API] --> M["Metadata Service<br/>Data assets: resources, tags, data products<br/>Policies: RBAC, ABAC, TBAC, PBAC"]
    M --> B["Omni Broker<br/>translates to data platform<br/>constructs"]
  end
  subgraph DP[Data plane]
    C["Omni Connector<br/>applies to the data product"]
  end
  B --> C
  C --> S[Snowflake]
  Q[User query] --> S

The flow from a policy change to enforcement:

sequenceDiagram
  participant P as Trust3 AI Portal and API
  participant M as Metadata Service
  participant B as Omni Broker
  participant C as Omni Connector
  participant S as Data platform (Snowflake)
  P->>M: Policies, purposes, data product
  M->>B: Policies for the data product
  B->>C: Snowflake constructs
  C->>S: Native row access and masking policies
  Note right of S: User queries are enforced here

For what the connector writes on Snowflake, see PBAC on Snowflake.

Scope and limits

  • Connectors built on Omni only. Legacy PolicySync connectors do not enforce purposes.
  • Snowflake only. Purposes are enforced on Snowflake. They are not enforced on Databricks yet; Databricks support is planned. Other data platforms are not supported.
  • Row filters and column masks narrow access; applying a purpose also grants read. Applying a purpose gives its groups and roles read access to every table of the data product, and removing it revokes that read. Untagged and newly added tables are read unmasked. See Principles.
  • Groups and roles only. A purpose is applied for groups and roles. It cannot be applied for an individual user.
  • One purpose per group or role on a data product.
  • Other routes to the same data are not detected. A user who reaches the same data only through roles or groups the purpose is not applied for gets those routes' policies, without the purpose's restrictions. Trust3 AI does not detect or block this. A user who holds any role the purpose is applied for gets the purpose, whichever route they use.
  • A purpose that cannot be read holds new access to its tables. If Trust3 AI cannot read a purpose's policies for a table, it keeps the purpose's previous row filters and masks on that table, and a new SELECT grant on that table waits until the problem is fixed. Revokes on that table still apply at once, though other changes in the same sync may be delayed.
  • Tags must be in place. A mask applies only to columns that carry its tag. A table without the tag is not masked by that policy, and no warning is shown.

Planned: Databricks

Enforcing purposes on Databricks is planned.

Planned

Feature Status
Governance approval of purposes Planned.
Auditing which purpose a query ran under Planned.
On Snowflake, data product tables closed by default Planned. See PBAC on Snowflake.
On Snowflake, Exclude filters apply to everyone they name, whatever other roles they hold Planned. See PBAC on Snowflake.
Contradictory masks in a purpose keep the column masked Planned. Contradictory row filters already show nothing.
Databricks Planned.

Next steps