How to Configure Codex Snowflake Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a codex snowflake prevent delete workflow, assign your agent a custom role without delete permissions. This role stops the AI tool from dropping rows or removing tables during a session. Teams often let AI coding agents query cloud data warehouses to build features and fix bugs. When developers share their own admin credentials with the agent, they create a major risk. An AI assistant with broad role permissions can wipe production tables with one bad query. Scoping permissions down b

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 codex snowflake prevent delete workflow, assign your agent a custom role without delete permissions. This role stops the AI tool from dropping rows or removing tables during a session.

Teams often let AI coding agents query cloud data warehouses to build features and fix bugs. When developers share their own admin credentials with the agent, they create a major risk. An AI assistant with broad role permissions can wipe production tables with one bad query. Scoping permissions down before the agent starts a session is the primary native defense.

How a codex snowflake prevent delete setup works

Snowflake manages table actions through a role-based permission model. Account admins create roles and grant specific rights on databases, schemas, and tables. The system splits data modification rights into separate actions for adding, changing, and removing rows.

To build a codex snowflake prevent delete rule, an admin makes a dedicated role for the agent. The admin grants usage rights on the warehouse, database, and schema to that role. Next, the admin grants select rights so the AI agent can read table schemas and sample rows. If the agent must load test records, the admin adds insert and update permissions.

The admin leaves out the delete, truncate, and drop permissions from this role. Finally, the admin assigns this restricted role to the user account that OpenAI Codex uses to log in. When the agent runs a delete statement, the database engine checks the active role and blocks the query.

What native roles solve and what they miss

Native database roles solve the basic problem of broad account permissions. They ensure that a dedicated service user cannot run a delete or drop command on protected tables. This setup works well when every agent session uses its own separate login and role.

Still, static roles only check who logs in at the start of a session. They do not inspect what individual statements try to do while in flight. Many developers run OpenAI Codex locally and let it use their own workstation credentials. If the developer holds an engineer role that allows deletes, the agent inherits that exact power.

Snowflake Access Control + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Even with a no-delete role, an agent with update rights can still ruin table data. A bad update query without a filter clause can overwrite every row with blank values. Native role permissions cannot tell a safe single-row update apart from a bulk table wipe. They also cannot require a human to approve risky queries one by one.

Managing sensitive data during AI agent sessions

Blocking deletes protects data integrity, but it does not stop data leaks during read queries. When an AI coding agent reads production tables to debug code, it pulls real customer records. Those records often contain emails, phone numbers, card numbers, or national IDs.

Database admins can build column masking rules inside the data warehouse to hide sensitive fields. Maintaining those rules across hundreds of tables and schemas takes constant manual work. If an admin misses one new column, raw data flows straight into the agent prompt context. Teams need a simpler way to block destructive commands and rewrite sensitive fields in results.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How do you stop OpenAI Codex from deleting rows in Snowflake?

Create a dedicated database role for the agent and grant only select, insert, and update privileges. Do not grant delete, truncate, or drop rights to that role.

Can an AI agent still damage data without delete permissions?

Yes, an agent with update permissions can still overwrite existing rows with null or bad values. Role permissions check the command type, not how many rows a query changes.

Why do developer logins bypass database role limits for AI agents?

Local coding agents often reuse the human developer's active session and credentials. If the developer has permission to delete data, the agent gets the same permission by default.

The query runs. The emails stay hidden.