How to Configure Windsurf Redshift Least Privilege

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf redshift least privilege by creating a scoped database role for your agent. Next, you store those limited login details in your local shell or MCP tool. Many teams start by giving their AI coding tool their personal admin login. That choice lets the agent read or drop any table in the warehouse. A single bad prompt can delete production rows or pull private customer records. Scoping the database role early stops the agent from touching sensitive tables. How windsurf redshif

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 windsurf redshift least privilege by creating a scoped database role for your agent. Next, you store those limited login details in your local shell or MCP tool. Many teams start by giving their AI coding tool their personal admin login. That choice lets the agent read or drop any table in the warehouse. A single bad prompt can delete production rows or pull private customer records. Scoping the database role early stops the agent from touching sensitive tables.

How windsurf redshift least privilege works in practice

Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The product keeps the same IDE features and uses the Cascade agent. Cascade can run terminal commands on its own when the user gives permission. It opens a dedicated shell that uses zsh on macOS or bash on Linux. That shell loads the user profile, along with all local aliases and variables. Cascade also talks to local MCP servers to reach outside systems like data warehouses.

To lock this down, you first build a dedicated role inside your Redshift cluster. You grant that role usage on one schema and read rights on chosen tables. You deny write commands and block rights on system tables or billing views. Then you create a database user just for the agent and attach the role. Finally, you pass those scoped login details to the local shell or MCP server. When Cascade runs a query, the warehouse checks the role and blocks outside tables.

Why native roles alone leave a gap

Database roles do a good job of deciding who can log into the cluster. They also control which schemas and tables a user can read or change. Still, native roles only check permissions at the table or column level. Once a role has read rights on a table, it can pull every row by default. The warehouse cannot tell if a query came from a human or an agent. It also cannot stop a valid select statement that pulls millions of sensitive rows.

Local shell variables create another problem for security teams. Since the agent shell loads the user profile, any process can read those keys. If a developer stores a long-lived password in a profile file, it stays exposed. Rotating those passwords across a whole engineering team takes hours of manual work. Also, native database logs only show the shared role name, not the developer identity. Teams need a way to inspect queries in flight and mask fields like emails.

Least Privilege Principle + Redshift Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to tighten local agent database rules

Start by separating human logins from the logins used by your local AI tools. Never let Cascade use a personal admin account stored in a default shell profile. Instead, create a read-only warehouse role that only sees test or staging schemas. If the agent must query production data, limit its role to summary views. Summary views let the agent check data shapes without reading raw phone numbers.

Next, review how the agent runs commands inside the IDE terminal. Require manual user approval before Cascade runs any shell script or database client call. Check the local MCP setup to see which servers start when the IDE opens. Remove any unused database tools or old keys from the local shell profile. Finally, check your warehouse query logs each week to spot strange agent queries. Look for large table scans or failed permission checks from the agent user.

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

Is Windsurf still the same tool after the Devin Desktop rename?

Yes, Cognition renamed Windsurf to Devin Desktop in June 2026 while keeping the same IDE. Its Cascade agent still runs terminal commands with permission and uses local MCP servers.

Why can the agent see my local database keys?

The agent runs a dedicated zsh or bash terminal that loads your shell profile. Any database key stored in your profile variables becomes available to commands in that terminal.

Can native Redshift roles mask card numbers in query results?

Native roles mainly control which tables or columns a user can read or write. To rewrite matched fields like card numbers or emails in results, you need inline masking.

The query runs. The emails stay hidden.