Enable access grants
In the project, click Settings on the left sidebar, find Security & Policy, and turn on Just-In-Time access — this lets project members request 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 Just-In-Time Access 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 Just-In-Time access enabled, select the database, and run your query. Without permission, the result panel returnspermission_denied along with a Request just-in-time access button.

- 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 Just-In-Time Access 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 Just-In-Time Access 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.

