AI delivery · Supabase

Prove your Supabase permissions hold, then fix what does not

If your app runs on Supabase and you are worried about data leaking between users, slow queries or an unsafe production setup, you can commission a scoped engineering review and remediation. I write permission tests for your row-level security, examine keys, functions, data model and environments, then fix the agreed findings and leave the tests running in your pipeline.

This is a good fit if…

  • Your app stores customer data in Supabase and nobody has tested whether one user can read or change another user's rows.
  • The app was generated by an AI builder and the policies were written by the same tool, without review.
  • Pages that read from Supabase have slowed down as data grew, and row-level security policies are a suspect.
  • You run development and production in one Supabase project, or deploy schema changes by hand, and want that fixed before it bites.

Look elsewhere if…

  • The whole AI-built application needs a launch review, not just its Supabase layer. Use take an AI-generated application into production.
  • The project is stalled and you need to decide whether to salvage it. Use rescue an AI application that cannot ship.
  • You want an engineer under your own manager for ongoing work. Hire a contract AI engineer instead.

What you get

Scoped database, authorisation and production remediation

  • An automated permission test suite that signs in as different users and roles and proves what each can and cannot read or write.
  • Row-level security enabled and correct on every table and storage bucket in exposed schemas, with the fixes merged.
  • Secret keys confined to server-side code, and views and privileged functions checked for ways around your policies.
  • Slow queries and policies profiled and fixed on your real workload, with before-and-after timings.
  • Separate environments and versioned migrations, so schema changes are reviewed and repeatable.

How it runs

  1. 01

    Describe the issue and share access

    You describe what worries you and grant read access to the Supabase project, the repository and a non-production copy of the data.

  2. 02

    Test before reading

    I write permission tests from your intended access rules and run them as real users against the non-production copy. Failures become findings with evidence.

  3. 03

    Review the rest

    Keys and their use, views, database functions, storage policies, indexes behind your policies, slow queries from the workload, and how migrations reach production.

  4. 04

    Fix and hand over

    I fix the agreed findings through your review process, wire the permission tests into CI and hand over a short runbook for adding tables safely.

What needs to be in place

  • Access to the Supabase project and the application repository.
  • A non-production copy of the database, or agreement to create one.
  • A written description, even a rough one, of who should see what.
  • A named developer who will own the tests and policies afterwards.

Not included

  • A statement that the database is secure. The work reports and fixes what was tested.
  • Formal penetration testing or compliance certification.
  • Changes to the Supabase platform itself, or support on Supabase's behalf. Platform issues go to Supabase support.
  • Ongoing database administration after handover unless agreed separately.

Why Supabase projects need permission tests

Supabase makes it easy to put a database directly behind your front end. The browser talks to the database through an API using a publishable key, and row-level security policies in Postgres decide which rows each signed-in user can see. When the policies are right, that is a clean, efficient design. When they are wrong, the database is one modified request away from showing every customer’s data to anyone with an account.

The trouble is that policies are easy to get subtly wrong, and AI app builders write a lot of them quickly. A policy that checks the user is signed in but not that they own the row reads plausibly in review. So does a view that was created for convenience and quietly ignores the policies on the table beneath it. Reading policies is not enough; you need tests that act as real users.

What the work involves

I start from your intended access rules, written in plain language, and turn them into tests before looking closely at the policies. The tests sign in as different users and roles and try to read, insert, update and delete each other’s data through the same API your app uses. Then I review the parts that commonly bypass or weaken row-level security, checked against Supabase’s current documentation:

  • Keys. Secret (service role) keys bypass row-level security and must never reach the browser. I trace where each key is used.
  • Views. Views created by the default database owner bypass the policies of their underlying tables unless they are set to run with the caller’s rights or kept out of exposed schemas.
  • Database functions. Functions marked to run with elevated privileges can read across policies; each one needs a reason and its own checks.
  • Storage. Bucket policies are separate from table policies and are often left open.
  • Performance. Policies filter every query, so the columns they reference need indexes, and per-row function calls in policies can be restructured.
  • Environments and migrations. Separate development and production projects, schema changes in versioned migrations, and a way to roll back.

The same approach is written up in my practical guide to hardening Supabase row-level security.

The signature deliverable

You receive scoped database, authorisation and production remediation: the permission test suite, the fixes, and a short runbook. Illustrative example of permission test results:

Table or bucketRuleTestBeforeAfter
documentsOwner and shared users onlyUser C reads A’s document by IDAllowedDenied
team_membersAdmins manage, members readMember promotes self to adminAllowedDenied
invoices_summary (view)Owner onlyUser B lists all rowsAll rows returnedOwn rows only
avatars bucketPublic read, owner writeUser B overwrites A’s avatarAllowedDenied

Illustrative example. Not taken from a client engagement.

How acceptance is judged

The permission suite is the acceptance test: every rule you agreed must pass, as every role, in CI. Performance work is accepted on before-and-after timings for the specific queries we agreed to fix, measured on a copy of your data. Environment and migration changes are accepted when your developer can deploy a schema change to staging and production using the documented process.

Ownership and handover

The tests, migrations and policy changes live in your repository. The runbook explains how to add a new table without reopening the same gaps: enable row-level security, write the policy, add tests for each role, then merge. Your named developer runs through that procedure once before handover.

I am an independent practitioner; not affiliated with, endorsed by or holding any certification from Supabase.

When to choose something else

If you need a launch review of the whole AI-built application, see take an AI-generated application into production. If the project is stuck and salvage is the question, see rescue an AI application that cannot ship.

Questions buyers ask

We have RLS enabled on every table. Is that not enough?

Enabled is the start, not the finish. A table with RLS enabled can still be exposed by a permissive policy, a view that runs with its creator's rights, a privileged database function, or a secret key used where a user token should be. Tests that sign in as different users are the reliable way to know.

Do you migrate projects between Supabase Cloud and self-hosting?

Yes, as a scoped piece of work, when there is a clear reason such as data residency or cost. A migration covers schema and data, auth users, storage objects and functions, with a rehearsal in staging before cutover. It is not a default recommendation; most teams are better served by fixing the project they have.

Can you help with performance as well as security?

Yes. Policies run on every query, so they are often the cause of slow reads. I profile the queries your app actually runs, then add indexes on the columns policies filter by, restructure expensive policy checks and use the connection pooler where appropriate, measuring before and after on your data.

How is this priced?

As scoped delivery with acceptance criteria, shown in the engagement model on this page. Scope depends on the number of tables and roles, whether storage and functions are involved, and how much remediation you want me to do rather than your team.

Are you a Supabase partner?

No. I am an independent practitioner; not affiliated with, endorsed by or holding any certification from Supabase. I check current behaviour against Supabase's official documentation for each engagement, because platform details such as key types, pooling and view behaviour change, and advice that was right a year ago may not be now.

Describe a Supabase production issue

A short, non-confidential description is enough to start. I read every brief personally and reply within two business days, including when the answer is that I am not the right fit.

Step 1 of 2 · The basics