How to Configure Semantic Kernel Bigquery Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up semantic kernel bigquery permissions by linking a cloud service account to your agent. You then assign read roles on specific datasets to that account. Most teams start by giving the agent broad project roles to make testing fast. Broad roles let the agent read sensitive tables or run huge queries by mistake. How semantic kernel bigquery permissions work in practice Semantic Kernel uses plugins to let language models run code and query external data. When an agent needs warehouse d

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 permissions by linking a cloud service account to your agent. You then assign read roles on specific datasets to that account. Most teams start by giving the agent broad project roles to make testing fast. Broad roles let the agent read sensitive tables or run huge queries by mistake.

How semantic kernel bigquery permissions work in practice

Semantic Kernel uses plugins to let language models run code and query external data. When an agent needs warehouse data, it calls a custom database plugin function. That plugin uses a Google Cloud service account or workload identity to log in. BigQuery checks the cloud role attached to that identity before running any query.

To keep data safe, you must split roles into two clear parts. First, the agent needs a role that allows it to start query jobs. Second, the agent needs a data viewer role on the target dataset or table. If you grant the viewer role at the project level, the agent sees every dataset.

Teams should create a dedicated service account just for the Semantic Kernel app. You bind the job user role at the project level so queries can run. Then you bind the data viewer role only on the exact tables the agent needs. This setup stops the plugin from reading unrelated business tables in your cloud project.

What native roles solve and where gaps remain

Native cloud roles do a great job of controlling which tables an agent can open. They also let you set daily byte limits to stop runaway query bills. You can even use authorized views to hide specific columns from the service account. For static apps with fixed queries, these cloud rules work well.

Still, AI agents do not run fixed queries like standard software apps do. The language model writes new SQL statements on the fly based on user prompts. Native cloud roles only check who logs in and which table they touch. They cannot check the intent of a query while it is in flight.

BigQuery IAM + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If an authorized table holds customer emails or card numbers, the query returns them. Data masking rewrites matched fields in results, such as phone numbers or national IDs. Without query checks and masking, the plugin sends raw rows straight into the model prompt. Also, native logs show the service account name instead of the human user.

Managing keys and query safety for AI plugins

Many teams store service account key files on the server that runs Semantic Kernel. Static keys create a big risk if a developer copies them to a laptop. Anyone who finds that key file gets the exact same database access as the agent. Using short-lived identity tokens is much safer than keeping long-lived JSON files on disk.

Teams also need a way to review risky queries before they hit the data warehouse. An agent might try to join ten large tables or pull millions of rows. Table roles alone cannot stop a bad query on an allowed table. You need statement-level rules to block risky commands and track every prompt to a user.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the minimum role needed for a Semantic Kernel BigQuery plugin?

The service account needs a project role to run query jobs and a dataset viewer role. Grant the viewer role only on the specific tables that the AI agent must read.

How can I stop my AI agent from running huge BigQuery scans?

You can set a maximum bytes billed limit inside the database client settings. You can also set daily quota limits for that specific service account in your cloud console.

Should I use a single service account for all Semantic Kernel users?

A shared service account is common, but it hides which human user triggered a query. You should pass user context in query labels or use a tool that logs user identity.

The query runs. The emails stay hidden.