Skip to content

Extract the BigQuery observer probe out of google.ts - #372

Draft
Maximo-Guk wants to merge 2 commits into
restricted-data-followupsfrom
restricted-data-bigquery
Draft

Extract the BigQuery observer probe out of google.ts#372
Maximo-Guk wants to merge 2 commits into
restricted-data-followupsfrom
restricted-data-bigquery

Conversation

@Maximo-Guk

@Maximo-Guk Maximo-Guk commented Aug 27, 2026

Copy link
Copy Markdown
Member

WIP

@github-actions github-actions Bot added the gatekeeper Changes to a gatekeeper integration label Aug 27, 2026
@github-actions

Copy link
Copy Markdown

Preview: pr372-restricted-da-104cb6bb

https://pr372-restricted-da-104cb6bb-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

Maximo-Guk and others added 2 commits August 28, 2026 15:01
hasDatasetAccess passes on any 2xx from datasets.get, which requires only
bigquery.datasets.get -- dataset *metadata* access (e.g.
roles/bigquery.metadataViewer). It proves neither bigquery.tables.getData on
the tables the workspace's queries actually read, nor row-level security,
nor column policy tags, so an observer admitted by this probe may see query
rows they could not query themselves.

Decision: document only, no behavior change. Record the limitation and the
tightening direction (per-table tracking via the dry-run's referencedTables,
which is already in hand at both query call sites but currently reduced to
dataset prefixes, plus a table-data probe) at the probe, in the observers
decision table, and in the user-facing README. Full row/column-policy parity
is unprovable via any Google API regardless: row-level security filters rows
without ever denying access.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A table-free SELECT (`SELECT SESSION_USER()`, `@@project_id`) dry-runs
with empty referencedTables, was allowed for project-only scope, tracked
zero datasets, and executed with the owner's token -- returning
owner/session context no dataset probe can verify an observer against.
An empty tracked set admits any verifier without a single probe.
INFORMATION_SCHEMA reads that dry-run with empty refs rode the same
path.

now refuses empty referencedTables on every binding shape, with a
message pointing the agent at gadget code for table-free computations.
The scalar-function-with-a-table variant (SELECT SESSION_USER() FROM t
LIMIT 1) is unfixable at the referencedTables level and is documented as
part of the existing metadata-class residual.

BigQuerySessionImpl moves to its own module so Node vitest can construct
it directly (google.ts imports workerd-only modules and bundled assets);
the tests stub `cloudflare:workers` and `capnweb-validate`, the same
pattern as mcp-shared.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Maximo-Guk
Maximo-Guk force-pushed the restricted-data-followups branch from 97da468 to 85082a7 Compare August 28, 2026 20:16
@Maximo-Guk
Maximo-Guk force-pushed the restricted-data-bigquery branch from 50a5904 to 8f18b17 Compare August 28, 2026 20:16
@ask-bonk

ask-bonk Bot commented Aug 28, 2026

Copy link
Copy Markdown

LGTM!

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gatekeeper Changes to a gatekeeper integration

1 participant