How to Configure Goose Redshift Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up goose redshift prevent delete, remove delete grants from the database role. Then run your AI agent with that limited database user. Many engineering teams connect AI agents to data warehouses with shared admin keys. This wide permission lets an autonomous agent drop rows or clear production tables by mistake. A small prompt error can turn a read task into data loss. How to set up goose redshift prevent delete in your warehouse Start by making a dedicated database user for the Goose

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 goose redshift prevent delete, remove delete grants from the database role. Then run your AI agent with that limited database user. Many engineering teams connect AI agents to data warehouses with shared admin keys. This wide permission lets an autonomous agent drop rows or clear production tables by mistake. A small prompt error can turn a read task into data loss.

How to set up goose redshift prevent delete in your warehouse

Start by making a dedicated database user for the Goose agent. Do not reuse a human admin account or a general backend role. In your Redshift cluster, permissions flow from roles and groups to users. Create a group made just for automated agent tasks.

Grant this group usage rights on the target schema first. Next, grant select rights on the specific tables the agent needs to read. If the agent must add new rows, grant insert rights on those tables. Skip the delete and drop grants on all production tables.

You must also check default rules for future tables in that schema. Warehouse admins often grant full table rights to public groups by default. Revoke delete rights from the public group on your target schemas. This step stops the agent from inheriting delete power through a backdoor.

Finally, point the Goose database extension to this new limited user account. When the agent runs a query, the warehouse checks the user grants first. If the agent tries to delete rows, the warehouse blocks the statement right away.

Where native warehouse roles fall short for AI agents

Native database roles work well when an agent only needs static access. They block delete statements at the table level for that one user. Still, real engineering work often requires more flexible controls during a live session.

Sometimes an agent needs to clean up a staging table during a job. If you grant delete rights for staging, the agent keeps them all day. Native grants decide who logs in, not what each statement does in flight. A single role cannot ask a human to approve one risky delete query.

Redshift Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static roles also do not filter sensitive fields inside the query results. When the agent runs a select query, it gets every column in the table. Customer emails, phone numbers, card numbers, and national IDs flow straight into the model prompt. To fix this, teams must build and maintain complex custom views for every table.

Managing agent database keys on developer laptops

Goose runs on local machines and reads database keys from local files. Storing static warehouse passwords on laptops creates a clear security risk for teams. If a laptop gets lost, those keys can leak to outside attackers.

Rotating those local keys takes hours of manual work across the whole team. Every developer has to update their local setup when a password changes. Because of this friction, teams rarely rotate agent database keys on time. Shared static keys also make audit logs hard to read during an incident. Every query from every laptop shows up under the same database user name.

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 beside the service as an open-source proxy, a sidecar for your database or API.

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 review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Goose still read and insert data without delete rights?

Yes, Redshift separates select, insert, update, and delete permissions at the table level. Your agent can read rows and write new data while delete stays blocked.

Why did my agent delete rows after I revoked the permission?

The database user likely inherited delete rights from the default public group. Check group memberships and schema default rules to remove those hidden grants.

How do we protect sensitive columns when Goose queries a table?

Native roles return raw table values unless you build restricted database views. Data masking rewrites matched fields like emails and card numbers in query results.

The query runs. The emails stay hidden.