For the complete documentation index, see llms.txt. This page is also available as Markdown.

Governance

Control how the product runs and who can see which rows and columns. Access policy is created with the product, not bolted on.

Different users should see different slices of the same data. An executive might see every row; an analyst might see only active users, with sensitive columns like email hidden. Governance is how you make Vulcan enforce that, as part of the product itself rather than as a separate access layer someone bolts on later.

Governance in Vulcan works through physical-model policies, in two steps:

  1. After DataOS authorizes a user, a small project plugin you write decides which policy group that user belongs to, such as analyst or executive.

  2. A policy attached to the backing physical model uses that group to decide which rows can be queried and which columns are masked. Semantic and metric models inherit those rules; they never author policy directly.

For the full schema reference, see Vulcan policies.


How plugin governance works

Plugin governance has two parts:

  1. The project registers an authorization plugin in config.yaml.

  2. Policy files under policies/access/ match the group returned by that plugin.

At query time, Vulcan authorizes the user with DataOS's authorization service and then calls your configured plugin. The plugin receives an AuthExtensionContext (user_id, user_tags, and request_headers) and returns a SecurityContext: an object that names the user's policy group and can include extra claims. Vulcan applies the physical model policy that matches that group before running the query.

If after_authorize isn't configured, or the hook raises or fails to import, Vulcan does not attach a SecurityContext: every policy rule that matches on group silently fails to match. Any model with an attached policy needs a working plugin.


Register an auth plugin

Add an after_authorize hook in config.yaml. The value is a Python import path in the form module:function.

This points to a function named resolve_user_groups in plugins/auth_ext.py.

The b2b_saas example keeps the plugin small. It reads DataOS role tags, converts each role tag into a group label, and returns the first group:

The orders-analytics-with-auth example maps DataOS role tags to policy groups and chooses the highest-priority group:

Write a plugin like this when your policies need a project-specific group name that doesn't match DataOS's raw tags. For example, DataOS might return a role tag like roles:id:vulcan-ap-user2, while your policy file expects vulcan_ap_user2. The plugin does that translation.


Apply policies to physical models

Policies live in YAML files under policies/access/. Each file targets exactly one physical model through depends_on. Each rule starts with a group; if the plugin returns that group in the SecurityContext, Vulcan applies the rule before running the query.

A policy can:

  • Leave a group unrestricted, by declaring only group.

  • Mask sensitive dimensions with mask.

  • Restrict rows with filter.

  • Combine masking and row filters in the same policy.

Mask a column

The physical model defines its masking expression:

The policy decides which groups receive the mask:

When vulcan_ap_user2 queries a semantic or metric model backed by silver.dim_customer_profile, Vulcan returns email using the configured column_mask_expressions expression instead of the real value. Every column named in a policy's mask must have a matching column_mask_expressions entry, or vulcan plan fails.

A separate column_classifications block on the same MODEL (for example, plan_type = restricted) is catalog metadata only: it documents sensitivity for discovery, but it doesn't mask anything at query time.

Filter rows

Use filter to limit the values a group can query:

The member must be a column on the protected physical model. The examples use these operators:

  • equals - allow rows where the member equals one of the listed values.

  • notEquals - exclude rows where the member equals one of the listed values.

  • in - allow rows where the member is in the listed values.

  • notIn - exclude rows where the member is in the listed values.

A values entry can be a literal or a {securityContext.<key>} template, resolved from the claims your plugin returns. A missing key at query time returns 403.

Filters can also nest with and / or for multi-condition logic:

Combine mask and filter

This policy uses one unrestricted group and several restricted groups:

In this example:

  • vulcan_ap_user1 can query the model with no masks or filters.

  • vulcan_ap_user2 can't see raw email values and can't query churned customers.

  • vulcan_ap_user3 can't see raw email or customer name values, and can only query selected segments in the East region.

A policy-governed response can include filter_display: a read-only summary of the row filter actually applied for the caller's group, useful for showing consumers what slice of data they're looking at.

Masking and rollups

If the project sets enable_rollup: true, a rollup's group by dimension can only use a column whose mask is a constant expression, such as CAST(NULL AS TIMESTAMP) or a string literal. A value-referencing mask like CONCAT(LEFT(email, 2), '***') can't be safely re-derived from already-aggregated data, so Vulcan rejects it for rollup dimensions.


End-to-end flow

  1. A user sends a semantic query through SQL, REST, or GraphQL.

  2. DataOS authorizes the request and returns user tags.

  3. Vulcan calls your configured plugin, such as plugins.auth_ext:resolve_user_groups.

  4. The plugin returns a SecurityContext with a primary group.

  5. Vulcan finds the matching physical-model policy rule and applies its masks and filters before executing the query.

Keep policy group names consistent between the plugin and the policy YAML. If the plugin returns vulcan_ap_user2, the policy file must declare group: vulcan_ap_user2 for that policy to apply.

Last updated

Was this helpful?