Skip to main content

Row-level security

One dashboard, and each viewer reads only their own rows. Rules on the dataset match each member's attributes, an API key reads as the group it is bound to, and a customer's signed embed token carries their filters, all applied on the server.

The folder ACL decides which dashboards and datasets exist for you. It does not decide which rows inside them you read. That is a different question, and Vibedasher answers it with different machinery: row rules on the dataset, matched against whoever is asking.

In the app​

Every dashboard a member opens signed in reads with their rules applied, and so does the in-app assistant. Row rules and attributes are written by an admin through the API (below), and an admin binds each API key to a group in the admin page's API keys tab.

Row rules live on the dataset​

A dataset can carry a row policy — a list of rules, each pairing one of its columns with a viewer attribute:

{
"rowPolicy": {
"rules": [
{ "column": "tenant" },
{ "column": "sales_rep_email", "attribute": "$email" }
],
"fallback": "deny"
}
}

Read each rule as rows where column is one of the viewer's values for attribute. The attribute defaults to the column's own name, so { "column": "tenant" } matches a tenant column against a tenant attribute. A viewer must match every rule.

  • Three attributes are derived, never stored: $user_id, $email and $group_ids come from whoever is asking, so "rows where sales_rep_email is the person reading" needs no setup at all. A stored attribute with one of those names is ignored.
  • fallback answers the viewer who has no value at all for a rule's attribute. deny, the default, means they read nothing; allow means the rule does not gate them.
  • An empty list is a decision, not an absence. {"region": []} means entitled to no regions and reads no rows, whatever the fallback. The single value "*" means no restriction for that key.
  • Only an account admin or the dataset's owner can set, change or clear a policy; anyone else gets a 403. The policy lives in the dataset's config as rowPolicy, written with PUT /v1/datasets/{id}. Changing it clears that dataset's cached results.

Members: attributes, set by an admin​

A member's attributes are a map of key to a list of values — {"tenant": ["acme"]} — set by an admin on the user (PUT /v1/users/{userId}) or on a group (PUT /v1/groups/{groupId}), in the attributes field. Both fields are in the published SDKs. A member's effective values are the union, per key, of their own and those of every group they are in: somebody in EMEA and in APAC reads both.

A member cannot change their own attributes — that would be self-service on the data itself — and a change reaches them on their next query. The rules apply wherever a member's query is answered on our side: a dashboard they open signed in, and POST /v1/query or /v1/sql under their session, whether from the app or from an SDK or agent signed in with vibedasher login.

Account admins read every row, the same override they take on the folder ACL. A dataset's owner reads every row of their own dataset — they uploaded it.

API keys: bound to a group, never to a person​

For rows, a key is not the person who created it. It carries no admin override, whoever minted it, and on a dataset with row rules an unbound key is refused with a 403 named row_access_api_key_not_bound — never an empty result that reads as "no data". On datasets without rules, a key reads exactly as before.

An account admin binds a key to a group, and the key then reads with that group's attributes:

PUT /v1/api-keys/{id}
{ "rowGroupId": 12 }

null unbinds it. The group must exist, and the key's creator must be an account admin or a member of that group, so a key is never bound wider than the person it came from. This route takes a signed-in browser session, not a key — a key cannot rebind itself — which is also why it is not in the SDKs. A binding change reaches requests within 60 seconds: the authorizer caches a key's record for up to a minute, the same window as revoking it.

For a bound key, $user_id is the key and $group_ids is its one group; it has no $email, so a rule on $email takes the policy's fallback.

Viewers outside your account: the signed embed token​

For people who are not members, the scope travels in the embed token. When your server mints one, it can attach filters to the token payload. On every query the platform rewrites each dataset reference into a filtered subquery, so the viewer physically cannot read rows outside their slice. The filters come exclusively from the verified token — never from the request body — so a viewer cannot widen their own scope by editing a request. A filter naming a column that exists in no dataset schema is rejected with a 403 rather than silently ignored, because a filter that quietly does nothing is a hole. See Embedding for how a token is minted and presented.

What holds across all of them​

  • A credential only ever narrows. Nothing a session, a key or a token carries can widen what a viewer reads beyond what they are entitled to.
  • A dataset with row rules cannot back a public link. A public link is read by anyone, with no account, and serves every visitor the same rows. Share it with members instead.
  • A dashboard that queries in the browser cannot be scoped at all. Decide this one before you build. A self-hosted dashboard on the credential-free lane — the ejected tree whose dataLane is wasm, or anything you built yourself over a Parquet or JSON extract — downloads the data and runs every query in the visitor's browser. The extract is keyed by dataset and snapshot, not by a query, so it holds every row of that dataset, and every visitor receives the same file. No server is left in the path to narrow it: a filter written into the page changes what is drawn, never what was delivered.
Row scope and the credential-free lane are mutually exclusive

That lane's whole appeal is that there is no key in the bundle, no token to mint and no backend of your own to run — and the price is exactly the same property seen from the other side: nothing can hand one viewer fewer rows than another. It is what putting the data in the browser means.

If some viewers must see fewer rows, keep the query on a server. Three shapes do that, and none puts a credential on the page: members read signed in, and the dataset's row rules apply to them; your own backend mints a short-lived embed token carrying the filter (the platform appends that predicate to every query it authorizes, ahead of any join or aggregate, so the page cannot widen it); or trusted server code queries under an API key bound to a group and returns those rows. Choosing the fast lane first and "scoping" it later with a filter in the page produces a dashboard that looks right, raises no error, and ships every row.

Reference​