Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 5 min read Case study mediumAdept

Are Supabase docs agent-friendly? We didn't know, so we checked

Supabase built an eval that runs coding agents against its Row Level Security guide using a non-leading "vibe coder" prompt, then grades the resulting database setup against a checklist derived from experts and outside sources rather than from the guide itself. The first runs showed agents leaving anon with insert/update/delete/truncate grants on every public table. Adding explicit steps to revoke default grants fixed that immediately. Test-writing guidance only took effect once it sat next to the policy code agents actually copy. The takeaway is that agents read selectively, so critical instructions belong beside copyable code, and clear structure and signposting serve agents and humans alike.

Related posts

  • AI Agents Know About Supabase. They Don't Always Use It Right.

    Supabase mediumAdept

    Supabase Agent Skills is an open-source ~100-line SKILL.md that steers AI coding agents to check current docs before writing code, follow inline security rules, and use a defined schema workflow. The inline rules include security_invoker on views, app_metadata rather than user_metadata for authorization, SELECT policies for UPDATE, and revoking sessions on user deletion. The schema workflow is iterative DDL via execute_sql or `supabase db query`, then advisors, then a migration. Critical content was moved inline because agents often skipped reference files. In LLM-judged evals across six scenarios, MCP+Skill beat baseline and MCP-only for every model tested (e.g. Sonnet 4.6 46%→58%→71%, GPT-5.4 71%→88%), and MCP-only agents never called search_docs.

  • Introducing Supabase Evals

    Supabase mediumAdept

    Supabase has open-sourced supabase/evals, a framework that runs coding agents like Claude Code, Codex and OpenCode against real Supabase tasks in containerized hosted-like and local CLI stacks. It scores them with deterministic checks plus LLM-as-a-judge, allowing one retry before grading. Scenarios are split into a breadth-oriented published benchmark and a daily regression suite of known failure modes. Early findings: skills add only modest gains because most models already pass Build tasks. Agents still hand-write migrations instead of using declarative schemas and miss newer packages like @supabase/server. A rewritten description raised the Postgres skill's activation from about 10% to 60%, and Claude Code consults docs far less often than Codex.

  • Defense in Depth for MCP Servers

    Supabase easyNovice

    Stored prompt injection, where malicious instructions hidden in database rows trick an AI agent into reading private data and writing it somewhere visible, is a property of LLM tool calling generally, not an MCP-specific flaw. Supabase's guardrails reduced the risk but did not eliminate it: read-only mode, project scoping, feature groups, warnings wrapped around query results and LLM classifiers. The recommended fix is environmental: never connect agents to production data, keep manual tool-call approval on, limit tools via feature groups, log all MCP queries, and consider CaMeL-style separation of quarantined and privileged LLMs. Planned work includes a production mode, branching, a PostgREST-backed MCP that reuses RLS, and scoped access tokens.

  • Operate with confidence: check production with your coding agent

    Supabase mediumAdept

    Supabase now ships Agent prompts that let a coding agent (Claude, Codex, Cursor) check a production project on a schedule for error spikes, security findings, slow queries and resource growth, reporting only new or worsening issues with the measured value, threshold and a next step. Setup connects the Supabase MCP server scoped to one project with read_only=true, then schedules a prompt; deduplication requires the agent tool to persist alert state between runs. The launch also adds a query_logs MCP tool for read-only SQL over 24 hours of logs, a debugging-aware supabase agent skill, a Health tab in Advisors for abnormal error rates, and a Database Connections page for finding and cancelling blocked or long-running queries.

  • Supabase CLI

    Supabase mediumAdept

    Supabase's new CLI runs the full Supabase stack locally via Docker Compose, using the same tooling as production, and walks through wiring it to a React app. For migrations, Supabase prefers schema diffing over hand-written migration scripts. After evaluating migra, dbdiff, pgdiff, apgdiff, pgquarrel and pgAdmin Schema Diff, it picked pgAdmin's because it tracks VIEW owner changes, which Row Level Security on views depends on, and it also handles domains. Since pgAdmin's diff was GUI-only, Supabase built a CLI mode for it and shipped it as a Docker image. A `supabase eject` command emits docker-compose, Kong and Postgres configs for self-hosting.

The quest for software engineering knowledge.

Look:
Layout: