The BigQuery direct connector lets Evidence run queries live against your BigQuery project.Documentation Index
Fetch the complete documentation index at: https://docs.evidence.studio/llms.txt
Use this file to discover all available pages before exploring further.
This is the direct connector. If you’d like to extract data (to join data across multiple sources), use the managed BigQuery connector instead.
Connecting
You’ll create a service account in GCP, give it permission to run BigQuery jobs and read your datasets, then upload its JSON key to Evidence.The steps below use the
gcloud and bq CLIs, but every step has an equivalent in the GCP ConsolePrerequisites
- The
gcloudCLI, authenticated as a user with IAM Admin and BigQuery Admin roles on the target project (or Owner). - A GCP project that contains the datasets you want to query.
<project> with your GCP project ID.
1. Create a service account for Evidence
2. Grant it BigQuery access
Job user
Data viewer
3. Generate a JSON key
Note,4. Configure the connector in Evidence
Open the connectors page
Go to Connectors in the sidebar. In the Warehouse card at the top, select BigQuery.
Choose datasets
Add the datasets you want to use with Evidence in Visible datasets (comma-separated).
Row-Level Security
Evidence supports row-level security on the BigQuery direct connector via service account impersonation.How it works
You create one BigQuery service account per RLS role (per customer, per tenant, per region — whatever your access boundary is) and attach BigQuery row-access policies to those service accounts. Evidence’s primary SA is granted permission to impersonate each role SA, and at query time chooses which service account to use based on the user’s assigned role in Evidence.Setup
The example below creates two roles,customer_a and customer_b, with
filters on a client_id column. Substitute your own role names, table, and
filter logic.
Let the primary SA impersonate each role SA
Attach row-access policies
FILTER USING clause is plain SQL — you can use any
column, comparison, or join.Decide on a fallback for unassigned users
Once any policy exists on a table, every principal querying it needs
a matching policy or they see zero rows — including Evidence’s primary SA.To preserve the existing behaviour for users without a role assignment
(they see all rows), add a fallback policy:Skip this step if you’d rather unassigned users see nothing. That’s the
more secure default but you’ll need every viewer to have a role assigned.
Register the roles in Evidence
In Connectors → BigQuery → Roles, add one row per role:
| Role name | Service account email |
|---|---|
customer_a | customer-a@<project>.iam.gserviceaccount.com |
customer_b | customer-b@<project>.iam.gserviceaccount.com |
Security Considerations
Evidence executes queries against your BigQuery instance. You should take pragmatic steps to protect your instance against misuse, whether accidental or malicious.- Scope data viewer to specific datasets
- Keep the service account scoped
- Cap cost per query
- Audit logs and alerts
1. Scope data viewer to specific datasets
The setup above grantsbigquery.dataViewer project-wide, which also gives read access to every other dataset in the project and to INFORMATION_SCHEMA. To narrow this, grant dataViewer per-dataset instead:
2. Keep the service account scoped
The setup grants onlybigquery.jobUser and bigquery.dataViewer. Don’t add more — broader roles like bigquery.user, bigquery.admin, or bigquery.connectionUser enable behaviour Evidence doesn’t need and unlock features like EXTERNAL_QUERY and remote functions. Audit the SA’s IAM bindings with:
3. Cap cost per query
Set a project-level ceiling on bytes billed per job so a runaway query can’t drain budget. You can also set per-querymaximum_bytes_billed on the query itself or custom quotas per user.
4. Audit logs and alerts
Enable BigQuery audit logs and route them to a sink you monitor. E.g. alert on:EXPORT DATAjobs (data leaving the warehouse)- DDL or DCL statements run by Evidence’s SAs (they shouldn’t be running any)
- Unusually large scans by a single SA

