Governance

Mask columns, deny them, or filter rows by role or group on every query, and turn on HIPAA mode.

Settings → Admin → Governance holds your workspace's data policies, its policy mode, and its HIPAA settings. Data policies apply to every read of your database, whichever surface runs it: SQL in Contrast, the Postgres endpoint, the CLI, MCP, and the API. Contrast checks them when it plans a query and again on every page of results it returns, so a mask you add also covers the next page of a query that already ran.

Who can change it

Owners, admins, and security admins can change everything on the tab. Other members who open Settings → Admin see a read-only Governance view: they can read the settings and policies and use Test a query, but they can't save changes. Through the API, a change needs one of those roles and a credential with the admin scope.

No plan is required for governance. The Audit log button opens the governance entries in the audit log, which is included with pay as you go; see audit and access review.

Governed columns

A column is governed for a member when either of these is true:

  • A column access policy that applies to the member names its schema, table, and column.
  • The catalog labels the column confidential or restricted.

A policy that selects columns with Sensitivity levels or Classification tags instead of a column name matches only columns whose catalog labels carry those values. To govern a specific column, name it with Schema, Table, and Column. A policy created on the tab matches that schema and table in every database, so stripe and customers cover <database>.stripe.customers wherever it exists.

Policy mode

Policy mode under Enforcement sets what happens when a query reads a governed column. New workspaces start in Enforce.

ModeGoverned column with no matching policyColumn with a Deny policyMask policies and row filters
EnforceA confidential column is masked with its catalog masking strategy, Redact unless the catalog sets another. A query that reads a restricted column is refused.The query is refused.Applied.
ObserveReturned unmasked, and Contrast records the decision.Returned unmasked, and Contrast records the decision.Applied.

A refused query fails with HTTP 403, the code sensitive_column_denied, and the message Query references sensitive columns without an explicit data policy grant., listing the blocked columns.

Data policies

Data policies lists every policy, enabled or not. Add one from New policy. The tab has no delete: Disable turns a policy off after you confirm, and Enable turns it back on.

Who a policy applies to

Choose a role or a group in Applies to.

  • Role: the policy applies to that role and every role ranked above it. From lowest to highest, roles rank viewer, billing_admin, editor, security_admin, admin, owner. Applies to labels each role with "and above" and starts on Viewer and above, which covers every member, owners included. Editor and above covers editors, security admins, admins, and the owner, but not billing admins. Admin and above covers admins and the owner.
  • Group: the policy applies to members of a group synced from Google Workspace or SCIM; see directory sync.

A deny or a mask always outranks an allow, so a higher role can't be exempted from a role policy that targets a lower one. To restrict some members and not others ranked above them, target a group.

Column access

A column access policy targets a Schema, a Table, and optionally a Column, and narrows further by Sensitivity levels and Classification tags, each a comma-separated list. Its Effect is one of:

EffectResult
MaskThe column's values are replaced using the Masking strategy.
DenyIn Enforce, Contrast refuses a query that reads the column. In Observe, it records the query.
AllowThe column is returned unmasked, including a restricted column in Enforce.
MaskingEach non-null value becomes
Redact[REDACTED]
Last 4*** followed by the value's last four characters
HashThe SHA-256 hex digest of the value
NullNULL

NULL values stay NULL under every strategy. When several policies match one column, a deny wins, a mask wins over an allow, and two masks with different strategies use Redact. Masks also cover output columns derived from a masked column, such as an alias or an expression like upper(email).

Contrast refuses a write that reads a masked column, such as INSERT INTO ... SELECT, with Masked data cannot be copied through warehouse SQL writes.

Row filter

A row filter targets a Schema and Table and adds its Row predicate to the WHERE clause of every read of that table by the members it applies to. {alias} stands for the table's name or alias in each query:

{alias}.region IN ('EU', 'UK')

Write the predicate in Spark SQL. Contrast translates it for reads in another dialect, including Trino reads and the Postgres endpoint's DuckDB SQL, and refuses the read when it can't. Contrast combines several filters on one table with AND. Leaving Table or Schema empty applies the filter to every table it then matches.

If a table's row filters change after a query ran, reading that query's results fails with Row-level data policies changed. Run the query again.

Queries Contrast refuses

Whatever the mode, Contrast refuses a query it can't check against the policies that apply to it:

  • A query that reads a governed table in a position where its columns can't be traced.
  • A query that reads a row-filtered table in a position where its rows can't be filtered.
  • A query that builds table or column names at run time, when a row filter applies to the member, or in Enforce when the workspace has governed columns.

Rewrite such queries with plain table and column references.

Test a query

Test a query shows what the current policies do to a query for the role or group in Run as, without running it. The result shows the decision (Allowed, Governed, or Denied), any blocked columns, the reason, the policies that matched, and the rewritten SQL with row filters applied.

Sample privacy

Mask identifiers under Sample privacy replaces direct identifiers in column samples before Contrast sends them to a model to describe your catalog. It's on by default and doesn't change query results.

HIPAA mode

HIPAA mode under Compliance has three parts:

ControlWhat it sets
HIPAA workspaceTurns HIPAA mode on or off.
AI access to workspace dataOff blocks every model call Contrast makes for the workspace. AWS Bedrock only allows model calls only through AWS Bedrock, and only while AWS is checked.
Verified agreementsAWS, Supabase, and Temporal Cloud. Each records that its business associate agreement and production configuration are verified.

Contrast refuses to turn HIPAA mode on until all three agreements are checked and the Session timeout in Settings → Admin → Sign-in is 60 minutes or less. The checkboxes are an attestation; Contrast doesn't verify the agreements. Contact security@contrastdb.com before you load protected health information.

While HIPAA mode is on, Contrast stops delivering workspace content to external channels, such as chat messages, alerts, and notification emails, and applies the AI access to workspace data setting. If Contrast can't read the workspace's HIPAA setting, it blocks that delivery and those model calls rather than allowing them. HIPAA mode doesn't change what queries return; data policies do.

Audit

Contrast records governance.settings.updated, governance.policy.created, and governance.policy.updated when an admin changes the tab, and governance.query_evaluated for each query decision that masks, filters, records, or refuses data. The Audit log button on the tab opens these entries.