How to Configure Devin Supabase Sandbox
You set up a devin supabase sandbox by creating an isolated database and a custom role. You then give the AI agent that scoped role instead of your main admin password. Most teams start by pasting their default database string straight into the agent workspace. That approach gives an autonomous tool full admin control over every table and record. When an agent holds broad rights, one bad query can wipe out shared test tables. It can also read sensitive customer records that somebody copied into
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 a devin supabase sandbox by creating an isolated database and a custom role. You then give the AI agent that scoped role instead of your main admin password. Most teams start by pasting their default database string straight into the agent workspace. That approach gives an autonomous tool full admin control over every table and record. When an agent holds broad rights, one bad query can wipe out shared test tables. It can also read sensitive customer records that somebody copied into the test project.
Setting up your devin supabase sandbox roles
Every new project starts with a default postgres role that holds admin rights. The platform does not grant full superuser status because superusers can run destructive commands. Still, the default postgres role still holds broad privileges across your database schemas. The password you pick when you create a project belongs to this default admin role. Official docs states you should never share that password with an outside service. Instead, you should make a fresh database user for every tool or service.
Each project also comes with built-in roles like anon, authenticated, and service_role. When an AI coding agent builds features, it needs to test queries and schema changes. You can create a dedicated role for the agent inside your isolated test project. Grant this new user rights only on the specific tables it needs to edit. Do not let the agent log in with the default postgres password.
Your team should also check what data lives inside the test database. Teams often clone live databases into test projects so agents have real rows to query. Those clones often contain real emails, phone numbers, card numbers, or national IDs. Before the agent logs in, scrub those fields or replace them with fake values. This step keeps real user details out of agent logs and chat histories.
What native roles solve and what they miss
Creating a separate database user for your AI agent is a great first step. Native database roles let you limit which schemas and tables the agent can touch. You can block the agent from reading sensitive tables or changing system settings. If a prompt goes wrong, table permissions stop the agent from touching blocked areas. It also separates agent traffic from queries that humans run in the dashboard. Queries from the web dashboard run as the default postgres role with a dashboard tag.
Still, static database roles only check who logs in at the start of a session. They cannot inspect individual SQL statements while the agent runs them in real time. Once a role has write rights on a table, it can drop all rows there by default. A role with read rights on a customer table can pull every row at once by default. Native roles cannot rewrite emails or card numbers in query results on the fly. They also cannot pause a risky drop command and wait for a human to approve.
AI Sandbox Environments + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing schema changes and test data safely
AI coding agents work best when they can run migrations and test their own code. To support this safely, keep your test project separate from staging and production systems. Give the agent a role that can create tables only inside a scratch schema. When the agent finishes a task, a human engineer should review the migration files. The engineer can then apply those checked changes to higher stages using standard deployment pipelines.
You should also rotate the agent database password on a regular schedule. If a session ends or a project wraps up, revoke the temporary user right away. Combining scoped database users with clean test data reduces the risk of agent mistakes. Yet teams that run autonomous agents at scale still need tighter controls over live queries.
Run guardrails and masking on the Postgres connection
Role grants and firewall rules are needed setup. Setup alone cannot check single SQL statements or mask sensitive rows in a response. By design, hoop.dev is an open-source proxy that sits beside Postgres, RDS, or Aurora as a sidecar for your Postgres. Clients and agent tools keep their credentials and point their connection string at the listener.
On each query, hoop.dev guardrails refuse disallowed drops, deletes, or table reads before they run. Next, hoop.dev data masking rewrites sensitive fields in returned rows that match your rules. Furthermore, hoop.dev holds SOC 2 Type II and logs every statement and verdict per resource. Check out the project on GitHub.
Frequently asked questions
Should I give my AI agent the default postgres password?
No, the default password belongs to the main admin role for your project. You should create a separate database user with limited permissions for each external tool.
Does the default postgres role have superuser rights?
No, the platform gives the default postgres role admin rights instead of superuser status. It blocks superuser status so users cannot run destructive system commands on the database.
How do I protect sensitive fields in a test project?
Replace real emails, phone numbers, card numbers, and national IDs with fake test data. You can also use dynamic data masking to rewrite matched fields in query results.
Related guides
In this post