How to Configure Semantic Kernel Bigquery Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up semantic kernel bigquery approval by pausing agent functions before they run SQL. Your app catches the tool call, waits for human sign-off, and then runs the query. Most teams start by giving their AI agent a shared cloud service account. That account often holds broad read and write roles across many datasets. If a prompt tricks the model, the agent can drop tables or read private records. How semantic kernel bigquery approval works in practice Semantic Kernel uses plugins to let

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 approval by pausing agent functions before they run SQL. Your app catches the tool call, waits for human sign-off, and then runs the query. Most teams start by giving their AI agent a shared cloud service account. That account often holds broad read and write roles across many datasets. If a prompt tricks the model, the agent can drop tables or read private records.

How semantic kernel bigquery approval works in practice

Semantic Kernel uses plugins to let language models call external code and data tools. When the model wants data, it picks a plugin function and fills in the SQL. Without a filter, the framework runs that function right away using the app's cloud key.

To add an approval step, developers write a function invocation filter inside the kernel. This filter acts like a checkpoint before any database call leaves the app. When the model tries to run a BigQuery function, the filter catches the request. It reads the generated SQL statement and checks if the query changes data or reads sensitive tables.

The filter then pauses the task and sends the SQL text to a human reviewer. Teams often send this alert to a chat channel or a ticketing tool. A data engineer or manager reads the query and clicks approve or deny. Once the app gets a positive reply, the filter lets the plugin run the query. If the reviewer denies it, the filter stops the run and returns a message to the model.

What native filters and cloud roles solve and miss

Google Cloud IAM roles control which service account can log in to your data warehouse. You can limit an agent to specific datasets or set it to read-only mode. Semantic Kernel filters add a human check inside your app code for risky actions. Together, they stop unauthorized apps from logging in and pause known functions inside one app.

Still, this setup leaves a large gap during daily operations. Cloud IAM roles only check who logs in at the start of a session. They do not inspect what individual SQL statements do while they run in flight. If an agent needs write permissions for one task, IAM allows all writes in that scope.

Approval Chains & Escalation + BigQuery IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

App-level filters also depend on developers writing and keeping up custom code in every service. If a team builds five agents, they must maintain five separate approval flows. Worse, anyone who gets the service account key can bypass the app filter right away. Native database logs also show the shared service account name instead of the human reviewer. And when a query returns emails, phone numbers, or card numbers, IAM does not rewrite those fields.

Why runtime query checks matter for AI agents

AI agents write new SQL queries on the fly based on user prompts. Static role checks cannot predict every query a model might build at runtime. Teams need a way to inspect each statement right before it hits the warehouse. They also need to mask private fields like national IDs in the results by default.

Moving approval rules out of app code makes security consistent across every agent you run. Reviewers get one clear place to check risky queries, and audit logs stay complete.

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 Google Cloud IAM require human approval for a single SQL query?

No, Cloud IAM only checks if a role can access a dataset or run jobs. It cannot pause a specific SQL statement to wait for human sign-off.

How do Semantic Kernel filters handle long waits for human review?

A filter can pause an active process or save the task state to a database. For long waits, teams save the state and resume the agent after the webhook responds.

Why is a read-only BigQuery role not enough for an AI agent?

A read-only role still lets the agent scan large tables and drive up cloud costs. It also lets the model read raw emails, phone numbers, and card numbers.

The query runs. The emails stay hidden.