Scoped Supabase credentials for AI agents
Supabase projects expose different kinds of credentials with very different consequences. A publishable or anon key is used with Row Level Security (RLS) in client-facing flows, while a service-role key is a server-side administrative secret that bypasses RLS. Agents building schemas, debugging storage, or running migrations should never receive the latter by default. Keep projects and environments distinct, validate RLS policies and database migration review, and use Gazebo to broker the particular project key only to the approved agent.
Why scope Supabase credentials for AI agents?
A service-role key can bypass RLS and must be treated as a production administrator credential; Gazebo cannot make it row- or table-limited after delivery. The real capability boundary is the selected Supabase project, key type, RLS policy, database role, and any server-side API design. Gazebo adds agent-specific retrieval decisions and logs, so an agent that only needs a frontend integration receives the appropriate lower-privilege credential. Disable its profile for containment, but rotate the Supabase key if it may have been copied and use Supabase/database logs to investigate actual data or schema operations.
How it works
- 1
Identify the project and credential type required for each workflow. Confirm RLS is enabled and tested for client-facing access; reserve service-role credentials for trusted server-side administration.
- 2
Store development, staging, and production keys as separate secrets and map each to the exact build, migration, or runtime profile.
- 3
Agents request the approved secret through MCP, and Gazebo authorizes the profile before release.
- 4
Review Gazebo retrievals with Supabase logs, database audit/query tooling where configured, migration history, and application errors. An allowed retrieval does not show which SQL or storage operation followed.
- 5
Remove a profile when work finishes. Rotate a project key after suspected disclosure, review RLS changes and migrations, and update only the still-authorized runtime profiles.
Common use cases
Anon key vs service role separation
Give frontend integration work the project’s client-facing key and test the intended RLS policies with representative users. Put any service-role key in a separate, tightly limited profile for a trusted migration or administrative workflow. Gazebo controls who can fetch it; RLS, key type, and server-side design control what it can do once fetched.
Per-project isolation
Use distinct project credentials as well as distinct Gazebo profiles. A profile name alone is not isolation if the underlying secret belongs to multiple environments. This separation makes a mistaken target URL or agent retry easier to contain and makes key rotation for one project less disruptive to the others.
Connect Supabase to Gazebo
Give your agents scoped access to Supabase in minutes. Every call logged. Revoke anytime.
Connect SupabaseAgents that commonly use Supabase
Further reading
Using Gazebo with Doppler: Adding AI Agent Access Controls to Your Secrets Setup
Doppler handles secret storage and environment sync. Gazebo adds per-agent identity, approval gates, and action-level audit logs on top. Here's how to layer them without changing your existing Doppler setup.
AI Agent Security Checklist: Cursor, Replit, and Copilot
Six things to do before shipping AI agents to production — scoped credentials, approval gates, audit logs, and a revocation path that doesn't take down everything else.
Secrets Management for AI Agents: Architecture and Core Controls
A reference architecture for keeping agent credentials out of prompts: vault storage, brokered access, scoped policy, audit logs, and revocation.
AWS Secrets Manager for AI Agent Workflows: IAM Roles vs. Scoped Tokens
IAM roles are the right answer for AI agents running inside AWS. The moment your agent needs Stripe, GitHub, or Vercel too, you need scoped tokens instead. Here's where the boundary is and how to handle both sides of it.
Using Gazebo with HashiCorp Vault: Adding AI Agent Access Controls to Vault
Vault handles infrastructure-grade secret storage. Gazebo adds per-agent identity, approval gates, and action-level audit logs on top — without changing how Vault is operated. How the two layers compose.
HashiCorp Vault Agent: What It Is and How It Fits with AI Agent Credential Management
Vault Agent handles Vault authentication for infrastructure services. AI agent credential management sits above it — per-agent identity, approval gates, and audit logs. How the two layers compose.