How to Configure Semantic Kernel Bigquery Read Only Access
You set up semantic kernel bigquery read only access by giving a Google service account viewer roles. Then, you link that account to a custom plugin inside your AI app. Many teams start by using an existing admin key during early tests. This fast shortcut gives the AI model total control over production data tables. A bad prompt can then trigger a plugin to alter or delete key records. How semantic kernel bigquery read only access works Semantic Kernel uses plugins to let AI models talk to ou
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up semantic kernel bigquery read only access by giving a Google service account viewer roles. Then, you link that account to a custom plugin inside your AI app. Many teams start by using an existing admin key during early tests. This fast shortcut gives the AI model total control over production data tables. A bad prompt can then trigger a plugin to alter or delete key records.
How semantic kernel bigquery read only access works
Semantic Kernel uses plugins to let AI models talk to outside data tools. You write a native function that wraps the official Google Cloud client library. The AI model reads your function notes to learn what queries it can run. When a user asks a question, the model picks your plugin and writes SQL. The plugin sends that SQL string to BigQuery and returns the matching rows.
To keep the database safe, you must restrict the Google Cloud service account. You create a new account just for this specific AI app. Next, you assign a role that can run jobs and view data tables. You never grant roles that allow table edits, row deletions, or permission changes. You also scope the viewer role to one dataset instead of the whole project.
Where native cloud permissions fall short
Cloud roles control which account can log in and read a given dataset. Still, those roles cannot inspect the actual SQL text that the AI model writes. A viewer role stops data changes, but it still allows full table reads. If a dataset holds customer info, the AI can pull every single row.
Private fields like emails, phone numbers, and card numbers sit inside analytics tables. When the plugin runs a query, those raw values flow right into the model. The AI might include those private details in its reply to the user. Data masking rewrites matched fields in results so raw values stay out of prompts.
Cost and speed also create big risks for AI apps that write SQL. BigQuery charges by the amount of data each query reads across a table. An AI agent does not know how to write low-cost queries by default. It may run a huge join without a date filter and drive up bills. Native cloud roles do not review or pause risky queries before they run.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing credentials and audit logs for AI plugins
Most teams connect their plugin to Google Cloud using a static JSON key file. Developers store this key in a local file or an app secret store. If that key leaks, anyone can read your cloud tables from outside your network. Using workload identity removes the need to store static files on disk. Even then, the app holds broad read rights as long as it runs.
Tracking what the AI does also takes extra work with native cloud logs. BigQuery logs show that the shared service account ran a specific SQL statement. Those logs do not show which user prompt caused the AI to run it. Security teams struggle to link a strange database read back to a user session. You need clear logs and field rules before the query ever hits the data.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can BigQuery roles stop an AI plugin from reading sensitive columns?
Yes, you can set up column policy tags in Google Cloud to block columns. Still, the query fails if the AI includes a blocked column in its request. Data masking rewrites matched fields like emails or national IDs so queries still finish.
How do I keep a Semantic Kernel agent from running huge queries?
You can set a maximum bytes billed limit inside the Google Cloud client settings. If the AI writes a query that reads too much data, the job fails. You should also partition your tables by date and tell the prompt to filter.
Should my AI app share a service account with other backend tools?
No, you should always make a unique service account just for the AI agent. Sharing an account makes it hard to track which tool ran a bad query. Separate accounts let you cut off the AI app without breaking other services.
Related guides
In this post