How to Configure Copilot Studio Supabase Sandbox
To set up a copilot studio supabase sandbox, create a dedicated database role with read-only permissions. Then link that restricted account to your agent workflow instead of using admin credentials. Many teams start by pasting their default project password into the agent settings. This quick shortcut gives the bot full admin control over every table. If an agent misinterprets a user prompt, broad permissions allow it to alter schemas or delete rows. A safe sandbox separates test data from produ
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 copilot studio supabase sandbox, create a dedicated database role with read-only permissions. Then link that restricted account to your agent workflow instead of using admin credentials. Many teams start by pasting their default project password into the agent settings. This quick shortcut gives the bot full admin control over every table. If an agent misinterprets a user prompt, broad permissions allow it to alter schemas or delete rows. A safe sandbox separates test data from production and limits what the bot can run.
How a copilot studio supabase sandbox works natively
Every new Supabase project comes with a default postgres role. This default role holds admin privileges across the database. Supabase does not grant full superuser status because superusers can run destructive system commands. Still, the default postgres role still has extra privileges for major admin tasks. The password you set during project creation belongs to this postgres admin role. Supabase docs warns against sharing this password with any external service. Instead, you should create a separate database user for each external service you link.
Supabase also provides built-in roles such as anon, authenticated, and service_role for API traffic. When you build an agent workflow, you must choose how the bot reaches your data. Some teams route requests through the standard REST API using built-in keys. Other teams link the agent directly to the Postgres database using a dedicated role. In a sandbox project, creating a custom read-only Postgres user is the safest native step. You grant this user select permissions only on the specific tables the agent needs. You also leave out write, update, and drop permissions so the agent cannot change records.
What native roles solve and what they leave open
Native Postgres roles and Supabase permissions control who can log in to the database. They also define which tables and columns a specific user account can touch. Setting up a dedicated sandbox user stops an agent from dropping tables or modifying rows. It keeps your test workflow from breaking the database structure during routine tests.
Still, static database roles only check permissions at the table or role level. Once the agent logs in, the database trusts every valid query that role sends. Native role settings do not inspect individual statements in flight for risky query patterns. They also cannot tell which human user triggered a specific agent request. Every query in the database log simply shows the shared agent role name. Also, sandboxes often hold copies of real customer records for testing. If a table contains emails, phone numbers, card numbers, or national IDs, a read-only role still returns them in plain text. Native permissions allow or block table access, but they do not rewrite sensitive fields in query results.
AI Sandbox Environments + Copilot Security Implications: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why shared sandbox credentials create audit blind spots
When multiple builders test an agent in a shared sandbox, they all use the same bot connection. Queries run directly inside the Supabase dashboard carry a comment showing the dashboard as the source. External agent queries all arrive under the single custom user you created for the bot. If a test prompt triggers a slow query or pulls sensitive rows, teams cannot trace which builder ran it. Rotating the shared password also breaks the agent until someone updates the stored secret. Teams need a way to tie every query to an individual identity and filter sensitive columns by default.
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 use the default postgres role for my sandbox agent?
No, the default postgres role has admin privileges across your entire project. Supabase recommends creating a separate database user for every external service you set up.
How do I keep a sandbox agent from changing test data?
Create a custom Postgres role and grant it read-only select permissions on specific tables. Do not grant insert, update, or delete privileges to the agent account.
Why is read-only access not enough for a test database?
A read-only role can still read plain text emails, phone numbers, card numbers, and national IDs. Without field masking, the agent receives raw personal data whenever it queries those tables.
Related guides
In this post