Members and permissions
Set data access scope
Assign data roles to members so each person can query only the tables, fields, and rows they should see.
One agent can serve different people at the same time: a salesperson asking for “last month's sales” gets only their own region's figures, customer service cannot see customer phone numbers, and management sees everything. To do this, create data roles and assign them to members. Every query then applies the role automatically, and askers do not need to set anything up.
Configuring roles and policies requires a project owner or project administrator. Entry: main navigation on the left → “More” → “Data Access Control” → “Roles”, “Policies”.
How it works
- A policy is one rule: “Allow” viewing certain schemas, tables, and fields, optionally only some of their rows; or “Deny” viewing certain schemas, tables, and fields.
- A data role consists of one or more policies and is assigned to members in “Project members”.
- Members without a data role show “All data” and have no extra restriction.
- The data a question can reach is the intersection of the agent's data sources and the asker's data role. Creating an agent or receiving a shared one never expands this scope, and members cannot switch data roles in conversations.
First-time setup
The example is “salespeople can query only the orders table and cannot see customer phone numbers”. The orders table in the data source is sales.orders, and the phone number field is customer_phone.
Create an allow policy that defines what can be seen
“Policies” → “New policy”: name it “Orders visible” (up to 25 characters), choose “Allow” as the permission, and add the data source that contains the orders.
In the table name rules under “Field-level rules”, add “equals” orders. Without any rules, the policy allows all schemas, tables, and fields in the data source.
Create a deny policy that excludes a sensitive field
Create another policy, “Hide customer phone”, choose “Deny”, add the same data source, and in the field name rules add “equals” customer_phone.
Combine the policies into a role
“Roles” → “New role”: name it “Sales” and add both policies in “Applied policies”. “Data scope preview” shows the final combined scope: orders should be visible and customer_phone should not.
Assign the role to members
In “Project settings” → “Project members”, choose “Sales” in the member's data role column. After saving, the member's next question runs with the new scope.
Verify with the member's account
Start a new conversation with the member's account. The current data role is shown below the input box, where members can also check it themselves. Ask “List customer phone numbers” and confirm the field cannot be queried; then ask “Total order amount last month” and confirm it is answered normally.
How to configure common needs
The following can be combined; put them in the same role. For a complete example of designing roles by department and region, see Design data permissions by department and region.
Open only some tables
In the “Field-level rules” of an allow policy, set rules at the schema, table, and field levels. Match types are “equals”, “starts with”, “ends with”, and “contains”.
- Open only summary tables: table name rule “starts with”
dws_. - Open only two tables: add table name rules “equals”
ordersandcustomers, and set the connector to “Match any”.
A name matches only when the schema, table, and field rules are all satisfied; multiple rules at the same level are combined with the selected “Match any” or “Match all”.
Hide sensitive fields
Use an allow policy to define the scope, then add a deny policy that lists the sensitive fields, for example field name “contains” phone. When a field is both allowed and denied, deny wins.
If you only want to keep the real values from the AI but still need to aggregate or filter by the field, use hidden fields and masking instead of a deny policy.
Let each person see only the data they are responsible for
Use a role variable so one role serves every region or department, instead of creating a separate role per region.
- In the “Row filters” of an allow policy, click “Add filter”, choose table
sales.orders, fieldregion, operator=, choose “Role variable” as the value source, and enterregionas the variable name. - When assigning the role, fill in
regionfor each member, for exampleEast Chinafor East China salespeople andSouth Chinafor South China salespeople.
Variable names start with an English letter or underscore and contain only letters, digits, and underscores. The value type (number or text) is detected from the field; fill in values of that type when assigning the role.
Let one person cover several regions
When adding a row filter, choose operator IN and value source “Role variable”; the variable then represents a set of values. When assigning the role, enter one value per line, for example:
East China
South ChinaChoose NOT IN to exclude a set of values. When the list is empty, the member cannot see any rows of that table.
Take values from the company's organization structure automatically
When the organization syncs member profiles through enterprise integration login, a variable can reference a member profile instead of “Enter manually” when assigning the role: choose profile data such as department or position as the variable's value source.
A reference is saved, so queries use the latest profile and job changes take effect automatically, with no per-person edits by administrators. When the profile data becomes invalid, the variable stops working and the member is marked as missing variables. List-type data can use “All active values” or “Select values”.
Filter by a fixed condition
Choose “Fixed value” as the value source for conditions that are the same for everyone in the role:
- Only orders from 2026 onward: field
order_date, operator>=, value2026-01-01. - Only regions whose names start with “East”: operator
LIKE, valueEast%. - Exclude records without a region: operator
IS NOT NULL, no value needed.
When you need a function or expression (such as CURRENT_DATE), choose “SQL (advanced)” as the value source and write the complete condition value in that data source's SQL syntax.
Filter all tables by one field
When several tables share a field (such as tenant_id), set both the schema and table to * in the row filter and the field to tenant_id; the filter applies to every table that contains that field. Tables without the field are not affected by this filter; exclude them with field-level rules if needed.
Apply a role automatically when new members join
Project invite links and join request approvals can both specify a data role, so new members get the corresponding scope when they join. See Invite members.
Askers in Feishu, web embeds, and system integrations
These entry points use their own configured roles and variables, managed separately from web members:
- Askers in Feishu and Slack: authorized with people profiles and agent allowlists. See Feishu channel user permissions.
- Anonymous web embeds: each embed address is bound to one role shared by all visitors. See Web embedding.
- System integration keys: specify the data role and variables when calling. See REST API integration.
Common configuration mistakes
- A role with only deny policies can query nothing. A role's scope starts from its allow policies. To allow “everything except a few items”, first add an allow policy without rules, then add deny policies.
- A role covers only the data sources added to its policies. If an agent's data source does not appear in any allow policy, members with that role cannot query any data from that data source.
- All row filters in a role apply at the same time. If two allow policies filter
region = East Chinaandregion = South Chinarespectively, both conditions must be met, which usually returns no rows. Use a list variable when you need several values. - Row filters only restrict rows; they do not open tables. A table must first be allowed by field-level rules for a row filter to matter.
- Deny policies cannot have row filters. For a policy that already has row filters, delete the filters before changing it to deny.
- Schemas and tables can be
*, but partial wildcards such assales*are not supported. To match by prefix, use the “starts with” field-level rule.
Check the “Condition preview” before saving a row filter; after saving, check the role's “Data scope preview” for each data source to confirm the visible schemas, tables, and fields, and the row filters applied to each field.
When permissions take effect
- Web conversations and personal API keys run with the asker's current data role. After a role change, the next question uses it.
- Scheduled tasks and data table refreshes run with the current data role of the task's or table's execution user; even when an administrator triggers them, the administrator's permissions are not used.
- Tightening permissions does not delete historical answers. Continuing the same conversation may still reference earlier content. After agent access is revoked, accessible history can still be read but no further questions can be asked; after losing project access, that project's history can no longer be viewed.
- When a data role is deleted, members bound to it are unbound and become “All data”. To restrict a member, deactivate them or revoke project access instead of deleting the role.
Missing role variables
When a role has required variables that a member has not filled in, that member's restricted queries are rejected with “Data access configuration is incomplete. Contact a project administrator to fill in role variables before asking.” (error code MEMBER_ROLE_VARIABLES_MISSING). The member can still view their data role, and administrators can fix it normally.
Common causes: a required variable was added to the role; referenced member profile data became invalid or empty.
Fix: in the “Project members” list, find members marked as missing variables and click “Complete variables”.
Use full table names when writing SQL
Queries check permissions by the full schema.table name in the data source. When writing SQL yourself (such as in a training set), use the full table name from the metadata; queries that omit the schema or use unauthorized table names are rejected.
Common issues
| Symptom | Cause | Action |
|---|---|---|
| Nothing can be queried after a role is assigned | The role has only deny policies, or the agent's data source is not in any allow policy | Add an allow policy that covers the data source and confirm in the role's “Data scope preview” |
| “No tables or fields available to query” | The agent has no data sources, or the role allows no tables | Check the agent's data sources and the role's data scope preview |
| A table cannot be found in the data source | The table is outside the role's visible scope | Confirm in the policy's scope preview; adjust rules if needed |
| The table is visible but no rows are returned | No rows satisfy all row filters together, or a list variable is empty | Check the filters on each field in “Data scope preview” and merge them into one list-variable filter |
| “Data access configuration is incomplete” | The member is missing role variables | An administrator completes the variables (see above) |
| The role variable value does not match the type required by the row filter | The value does not match the field type, for example text entered for a numeric field | Re-enter the value with the field's type and save |
Creating a role or policy is rejected with RESOURCE_QUOTA_EXCEEDED | Over the project quota | Delete unused roles or policies; see Quotas and limits |
| Deleting a role is rejected because an agent allowlist uses it | An agent's people authorization uses the role | Remove or change the role in the agent's “People permissions” first |
| No “Add filter” in “Row filters” | The policy is “Deny” | Row filters work only with “Allow” policies |
| Saving a role or policy is rejected | No management permission | Ask a project owner or administrator |