How to Configure Semantic Kernel Bigquery Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a semantic kernel bigquery prevent delete rule, assign read-only roles to your agent service account. You also need to add code checks in your plugin functions to block bad queries. Many teams start by giving their AI agents broad project editor roles for speed. When an agent holds too much power, one bad prompt can wipe out key tables. Good data safety starts with cutting down what the service account can do. How semantic kernel bigquery prevent delete works in native roles In Goog

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.

To set up a semantic kernel bigquery prevent delete rule, assign read-only roles to your agent service account. You also need to add code checks in your plugin functions to block bad queries. Many teams start by giving their AI agents broad project editor roles for speed. When an agent holds too much power, one bad prompt can wipe out key tables. Good data safety starts with cutting down what the service account can do.

How semantic kernel bigquery prevent delete works in native roles

In Google Cloud, identity roles decide what actions a service account can run. Your AI app uses this service account key to log in and run queries. If the account has standard data editor rights, it can drop tables or remove rows. To stop this at the cloud level, you must build a custom role. You keep the permissions to read tables, create jobs, and insert new rows. You leave out the permissions that let the user delete tables or update existing data. On the app side, you build a plugin function that sends SQL to the warehouse. You can add a filter inside the kernel before the query runs. This filter checks the text of the generated SQL statement for unsafe words. If the model writes a drop or delete statement, the filter stops the run. Combining cloud roles with app filters gives your team two layers of safety. The cloud blocks table drops while the app tries to catch row deletes.

Where native roles fall short for AI agents

Cloud roles check who logs in, not the exact SQL text inside a job. In this cloud warehouse, one single permission controls both updating and deleting rows. If your agent needs to update records, the cloud role also lets it delete rows. You cannot split row updates from row deletes using cloud roles alone. App filters inside your agent code also have clear limits in production. Language models can write complex queries or call stored procedures that hide delete actions. Simple word checks in your plugin code often miss tricky SQL patterns. Also, every app needs its own filter code and its own service account keys. When ten teams build agents, you end up managing ten different sets of keys. If an engineer changes a role to fix a bug, the safety rule breaks. Native roles also do not rewrite sensitive fields like emails or card numbers in results. Raw phone numbers and national IDs flow straight back into the model context.

How to design safe agent plugins for data queries

Instead of giving the model a single open SQL tool, build small specific functions. Create one plugin function just for reading summaries and another for adding new log rows. Each function should take plain text inputs and build the query from a fixed template. This stops the language model from writing raw SQL statements on its own. When the model cannot write raw SQL, it becomes much harder to delete data. You should also split your service accounts by the exact task they perform. Use a pure viewer account for chat agents that only answer user questions. Keep write accounts for background tasks that truly need to add new records. Check your cloud audit logs each week to see what queries your agents run. Look for failed jobs that show the model tried to run a blocked action. These failed attempts tell you when a system prompt needs clearer rules.

BigQuery IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

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 cloud roles block row deletes while allowing row updates?

No, the cloud warehouse groups data modification permissions together at the table level. If a service account can run an update statement, it can also run a delete statement.

Are text filters in Semantic Kernel enough to stop bad queries?

Text filters catch basic mistakes, but they are not enough on their own. A model can use multi-statement queries or stored procedures that slip past simple word checks.

How can we protect sensitive columns when agents read tables?

You can use authorized views to hide columns, or apply data masking rules. Masking rewrites matched fields like emails, phone numbers, and card numbers in query results.

The query runs. The emails stay hidden.