Enable access grants
In the project, click Settings on the left sidebar, find Security & Policy, and turn on Allow access grants. The indicator next to the toggle shows which approval flow requests will follow.
Configure the approval flow
Access grant requests are reviewed with Custom Approval (Workspace > CI/CD > Custom Approval): add a rule under the Request Access Grant source to route them to the right approver. If no rule matches, the workspace Fallback Rules apply.
Turning on the project setting requires the
bb.projects.update permission — for example a Project Owner or Workspace Admin. Editing approval flows requires bb.settings.set — for example a Workspace Admin.Request an access grant
When you don’t have permission to query a database in SQL Editor, you can request an access grant for a single statement. In SQL Editor, choose the project with Allow access grants enabled, select the database, and run your query. Without permission, the result panel returnspermission_denied along with a Request query button.
The button reads Request query only when the project allows access grants and the missing permission is read-only (
bb.sql.select / bb.sql.info). Otherwise it reads Request role and opens a role request instead.
- Databases — the targets you need to access.
- Statement — the SQL to run. Only read-only statements are allowed.
- Unmask — see unmasked sensitive data in the result.
- Export — also export the query result (see just-in-time data export).
- Expiration — how long the grant stays valid once approved: 1 hour, 4 hours, 1 day, 7 days, or a custom date.
- Reason — the justification reviewers see; required.

Approval
The approver sees the requested databases, the exact statement, the granted permissions (including any Unmask or Export), the expiration, and the requester’s reason.
request.data_export == true— the request includes export.request.unmask == true— the request includes unmasking.
resource.database_name, resource.table_name, and similar attributes.
Use the grant
Open the Access Grants tab — the shield icon on the SQL Editor left sidebar — to track your requests. Each shows its status (Pending while awaiting approval, Active once approved and usable), the databases, any Export or Unmask badge, the time left before expiration, and a link to the approval issue.

Only a statement that exactly matches the one in the grant is allowed to run — leading and trailing whitespace is ignored, but any other edit to the SQL, even reformatting, is denied. Use the Run button on the Access Grants list to re-run the approved statement reliably.
Review and revoke
To review every access grant in a project, go to Data Access > Access Grants in the project sidebar. Revoking an active grant requires thebb.accessGrants.revoke permission — Project Owner, Workspace Admin, or Workspace DBA.

