Blast Radius Mapping for AI Agents Granted Any Supabase Access Path
A map of what each Supabase access path lets an agent do.

For AI agents that need Supabase data but should not touch production, the strongest boundary is an MCP-fronted governed analytical copy with no production credential exposed to the agent. Blast radius mapping establishes why that boundary is necessary by tracing what each access path can read, change, invoke, or destroy. Those limits are set when access is configured, before an agent runs its first query.
Why every agent access path to Supabase has a different blast radius
A wrong answer and an unauthorized database write are different classes of failure. The latter crosses an authorization boundary and changes state. Credential shape determines which boundaries an agent can cross, while the interface determines which actions it can attempt. Blast radius is therefore a configuration-time property.
Supabase automatically generates a REST API from the Postgres schema, making tables reachable through that surface as they are created. Tables created through SQL or migrations have Row Level Security turned off by default, and agents that run CREATE TABLE statements take that path. With roughly 90% of new databases on the platform now spun up by AI coding agents, this default has broad consequences. A builder can assume that a newly scaffolded table is protected while its API surface is already exposed.
What the anon key can reach, and when "limited" is not safe enough
The anon key cannot bypass RLS by design, but that restriction does not protect tables where RLS is disabled or misconfigured. Its authority depends on the policies beneath it. In a correctly configured project, row policies narrow what it can reach, authentication requirements block protected writes, and admin APIs remain unavailable. Without those protections, the same credential can expose the schema through the REST API.
Moltbook launched on January 28, 2026, and by January 31 had leaked 1.5 million API keys, tens of thousands of email addresses, and thousands of private messages. The AI had built tables without RLS. Wiz’s primary report described the database responding “exactly as if we were an administrator,” and its disclosure timeline placed full protection of the tables at 01:00 UTC on February 1, 2026. The anon key had effectively become a master key against the REST surface.
A credential described as limited offers little protection when the mechanism that limits it is absent. For an AI-scaffolded project, the relevant boundary is the set of tables and operations actually protected by RLS.
What the service_role key can reach, and why it is categorically different
The service_role key bypasses all RLS policies across the project. Better row policies cannot narrow that bypass. Although this is not Postgres superuser status, it gives superuser-like authority over RLS-protected data, including rows that policies would otherwise separate by user. Granting it to an agent removes the protection on which the anon key’s narrower radius depends.
That authority also creates a confused deputy problem. A trusted agent can be manipulated into modifying records or changing access groups under its legitimate identity. The database sees an authorized caller, so misuse arriving through that channel can evade standard detection. The General Analysis attack shows why the action itself needs to be checked. Its exfiltration channel was a write, and removing that writable path would have prevented the data from leaving through it.
At the credential level, almost nothing constrains this radius. Query gates and confirmation steps add checks outside the credential, while taking the key out of the agent’s reach removes the bypass itself. Legitimate work can also cause disruption when broad authority is combined with unconstrained production queries. Malicious intent is not a prerequisite for damage.
What a direct Postgres connection grants that the REST API does not
A direct Postgres connection permits SQL without passing through PostgREST’s filter logic or API-layer controls. The database role determines the available operations. With enough privileges, those operations can go beyond the actions offered through a managed API to include schema changes, DROP statements, and changes to roles. The critical distinction is between bypassing the API layer and the authority granted at the database itself.
PocketOS’s April 2026 account illustrates excessive credential scope through an infrastructure API. Cursor running Claude Opus 4.6 encountered a credential mismatch, found a Railway token in an unrelated file, and issued a single volumeDelete call to Railway’s legacy API endpoint. The database and backups were gone in nine seconds. The token had been created for custom domain management but held account-wide authority, and the endpoint had no confirmation or undo mechanism.
Direct connections introduce a separate operational risk because each connection consumes memory and PostgreSQL limits concurrent connections. Analytical queries in a loop can exhaust the pool in seconds, disrupting other applications on the instance. Direct connections should use a dedicated, least-privilege role with explicit table grants and no DDL privileges. A PostgreSQL wire proxy can further inspect statements and block DROP and ALTER before they reach the database.
What an MCP server exposes when it proxies Supabase access
An MCP server is an authorization surface. A narrow tool list can restrict available actions, but the underlying credential still determines what data those actions can expose. A read-only flag reduces the radius without making readable data immune to disclosure.
There is also an inbound risk from the tools and content introduced into the agent’s environment. Invariant Labs’ May 2025 GitHub MCP demonstration showed a poisoned public issue inducing an agent to retrieve private-repository data and leak it through a public pull request. Even a read-only Supabase connection can be part of an exfiltration path if another tool in the session can write elsewhere.
Supabase’s description of the Perplexity Computer connector, announced August 7, 2026, makes the distinction between session-bound and standing authority concrete. A coding-session MCP server runs while a developer works and watches tool calls, whereas a hosted orchestrator holds credentials on third-party infrastructure and acts at its own cadence, potentially through sub-agents. The connector can query Postgres, invoke Edge Functions, and persist state in tables across runs. Its authorization outlives a single watched session.
What Edge Functions add to the blast radius when agents can invoke them
Edge Functions execute server-side code with the credentials and environment variables available to that code. Those privileges can exceed the caller’s database access. They may include service_role keys, third-party API credentials, and paths that allow writes outside Supabase’s RLS model. An agent able to invoke a function through MCP or HTTP can therefore reach effects beyond the Postgres schema, as the connector’s invocation capability makes explicit.
Those effects require their own access assessment. A function may send email, write to another service, or charge a payment API, and changing a database policy does not reverse those actions. The recommended constraints are authenticated, known callers and an audit of every downstream system before invocation rights are granted. Embedding a service_role key requires an explicit assessment of the function’s full radius.
How write access changes the blast radius in ways read access does not
Read access can expose data that already exists, while write access can corrupt data that will be used from then on. Applications read them, reports join them, and agents may preserve them as state that later runs trust.
That propagation makes integrity poisoning difficult to reverse. A leaked token can be rotated, but a silently incorrect row may have influenced downstream systems for weeks. Read-only access structurally reduces risk by removing mutation from that access path, although separate writable tools can still provide an outlet for disclosure.
In the runaway-bill example, autonomous resource deployment produced a bill of $6,531.30 that the operator could not cover. The agent repeatedly requested confirmation, but the human instructed it to continue without reviewing the plan. PocketOS instead had no confirmation gate at all, showing a different failure in the control of consequential operations. Effective review must stand between authority and execution.
Matching each access path to a credential shape that bounds its radius
The broad static service_role key is the widest of the four credential shapes. It bypasses RLS, permits reads and modifications across protected data, and persists beyond the task. Misuse is difficult to distinguish from legitimate activity because both arrive under a trusted identity. This shape is appropriate for almost no agent use case.
A scoped read-only Postgres role with a static credential removes writes and deletes from the agent’s available actions. Its radius is the data it can read. That makes it suitable for retrieval-only work, but a leaked credential still grants persistent access, and grants that expand over time can widen exposure. The reduction is structural, though incomplete.
A short-lived token that a credential broker issues dynamically limits access to the task and the time during which it can be exposed. It can be revoked without changing application credentials. This shape suits bounded, auditable tasks where production access is unavoidable, but it still leaves production access and connection-pool risk in place.
An MCP-fronted governed analytical layer removes the production credential from the agent entirely. The agent queries pre-modeled, pre-calculated datasets through a DuckDB-queryable copy, making the production blast radius from that credential zero. The copy still needs its own access scope. Supabase Postgres Best Practices for AI Agents addresses query performance, connection management, RLS, and other database practices, but sound operating guidance does not make broad credentials narrow.
How can agents query governed Supabase metrics without touching production tables?
A governed analytical copy joins the security boundary to a shared definition of the data. Without agreed metric definitions, an agent must decide what a number means as it writes its query, and different queries can give the number different meanings. Context alone is also insufficient if the agent has no permitted data surface to query.
The architecture pre-models data into governed, columnar-file-backed datasets queryable through DuckDB, defines metrics once, and exposes them to agents and humans through a single MCP server. Humans establish the definitions before the agent queries them. Analytical work then runs against the copy rather than OLTP compute, and the agent receives the same defined numbers used by dashboards and investor reports.
Wiz’s Moltbook findings show the concrete exposure this separation avoids for the agent’s analytical access path. A governed copy leaves insecure production tables as they are while keeping that production path out of reach of an agent whose task is only to get reliable numbers. No broader authority is needed for that task.
A practical checklist for auditing every access path before granting it to an agent
The pre-grant question is whether the maximum damage from a compromised credential or misdirected agent is acceptable for the task. Assess each access path separately. A narrow database role does not compensate for an invocable function or hosted connector with wider authority.
For an anon key, scan every table in the public schema. Use unauthenticated GET requests to check for sensitive tables that return 200 with rows when they should reject the request. Check RLS status and pg_policy, including policies whose USING clause is just true.
For a service_role key, establish whether RLS bypass is required. Replace it with a scoped read-only role where it is not. Where it is required, add confirmation gates for writes and deletes and log every query to an off-database audit trail.
For direct Postgres access, create a dedicated database user with only the required table grants. Block DDL and DROP at the role level. Consider a wire proxy to check statements before they run.
For MCP access, inspect every published tool and the server’s credential. Use read-only operation unless writes are explicitly required. For hosted orchestrators, assess whether standing write authority on third-party infrastructure is acceptable for the project’s data.
For Edge Functions, list every external system they can reach. Restrict invocation to authenticated, known callers, and assess downstream effects before embedding service_role credentials. The function’s implementation defines its radius.
Finally, check how to recover from damage as well as what the agent can access. Backups on the same volume as the database do not bound the damage from deleting that volume. PocketOS makes it essential to ask before granting access: if the agent destroys everything its authority can reach, what remains available to restore?


