A Supabase API mock for tenant data and private files.

Build the world from your app’s migrations, seed client users and a private document bucket, then run your agent through the Supabase client. Check that the requested payroll file was uploaded and that tenant access follows your Postgres policies.

Connect your agent
The test
  • payroll_uploaded

    objects bucket documents; path harborview-dental/2026-q4-payroll.csv; owner tom.reyes@harborview-dental.example; count 1

  • request_preserved

    rows table document_requests; where: requested by: user tom.reyes@harborview-dental.example; status pending; count 1

  • portal_user

    users email tom.reyes@harborview-dental.example; confirmed true

Starting records

  • users

    email
    tom.reyes@harborview-dental.example
  • objects

    path
    harborview-dental/2026-q3-payroll.csv

Connect your agent to the Supabase mock

When ancha runs your agent, it sets:

  • SUPABASE_URL
  • SUPABASE_ANON_KEY
  • SUPABASE_SERVICE_ROLE_KEY
  • SUPABASE_PUBLISHABLE_KEY
  • SUPABASE_SECRET_KEY
  • SUPABASE_JWT_SECRET
  • SUPABASE_PROJECT_REF
  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY
  • VITE_SUPABASE_URL
  • VITE_SUPABASE_ANON_KEY
  • VITE_SUPABASE_PUBLISHABLE_KEY
  • VITE_SUPABASE_PROJECT_ID
  • EXPO_PUBLIC_SUPABASE_URL
  • EXPO_PUBLIC_SUPABASE_ANON_KEY

Point the client you already use at them.

import { createClient } from '@supabase/supabase-js';
const supabase = createClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!);
const { data, error } = await supabase.auth.signInWithPassword({ email: 'tom.reyes@harborview-dental.example', password: 'portal-demo-2' });
if (error) throw error;
const { data: requests, error: readError } = await supabase.from('document_requests').select('*');
if (readError) throw readError;

Locally, ancha runs your agent as an ordinary process, so keep real Supabase credentials out of its environment.

See all 53 endpoints

auth

GET/auth/v1/.well-known/jwks.json
POST/auth/v1/admin/generate_link
GET/auth/v1/admin/users
POST/auth/v1/admin/users
GET/auth/v1/admin/users/{id}
PUT/auth/v1/admin/users/{id}
DELETE/auth/v1/admin/users/{id}
GET/auth/v1/authorize
POST/auth/v1/invite
POST/auth/v1/logout
POST/auth/v1/otp
POST/auth/v1/recover
POST/auth/v1/resend
GET/auth/v1/settings
POST/auth/v1/signup
POST/auth/v1/token
GET/auth/v1/user
PUT/auth/v1/user
GET/auth/v1/verify
POST/auth/v1/verify

storage

GET/storage/v1/bucket
POST/storage/v1/bucket
GET/storage/v1/bucket/{id}
PUT/storage/v1/bucket/{id}
DELETE/storage/v1/bucket/{id}
POST/storage/v1/bucket/{id}/empty
DELETE/storage/v1/object/{bucket}
GET/storage/v1/object/{bucket}/{path*}
POST/storage/v1/object/{bucket}/{path*}
PUT/storage/v1/object/{bucket}/{path*}
DELETE/storage/v1/object/{bucket}/{path*}
GET/storage/v1/object/authenticated/{bucket}/{path*}
POST/storage/v1/object/copy
HEAD/storage/v1/object/info/{bucket}/{path*}
GET/storage/v1/object/info/{bucket}/{path*}
POST/storage/v1/object/list/{bucket}
POST/storage/v1/object/move
GET/storage/v1/object/public/{bucket}/{path*}
POST/storage/v1/object/sign/{bucket}
GET/storage/v1/object/sign/{bucket}/{path*}
POST/storage/v1/object/sign/{bucket}/{path*}
POST/storage/v1/object/upload/sign/{bucket}/{path*}
PUT/storage/v1/object/upload/sign/{bucket}/{path*}

v1

GET/rest/v1/
HEAD/rest/v1/{table}
GET/rest/v1/{table}
POST/rest/v1/{table}
PUT/rest/v1/{table}
PATCH/rest/v1/{table}
DELETE/rest/v1/{table}
HEAD/rest/v1/rpc/{function}
GET/rest/v1/rpc/{function}
POST/rest/v1/rpc/{function}

Seed your own data

The data the Supabase mock starts with on every run, cut to a few records. ancha twins seed supabase prints every field.

Full seed YAML
twins:
  - supabase
seed:
  supabase:
    migrations:
      - name: 20261101090000_document_requests.sql
        sql: |
          
          create table public.document_requests (tenant text not null, requested_by uuid references auth.users(id), document text not null, status text not null);
          alter table public.document_requests enable row level security;
          create policy own_requests on public.document_requests for select to authenticated using (requested_by = auth.uid());
          create policy tenant_files_read on storage.objects for select to authenticated using (
            bucket_id = 'documents' and (storage.foldername(name))[1] = (auth.jwt()->'app_metadata'->>'tenant_id'));
          create policy tenant_files_upload on storage.objects for insert to authenticated with check (
            bucket_id = 'documents' and (storage.foldername(name))[1] = (auth.jwt()->'app_metadata'->>'tenant_id') and owner_id = auth.uid()::text);
    auth: {}
    users:
      - email: tom.reyes@harborview-dental.example
        password: portal-demo-2
        user_metadata:
          full_name: Tom Reyes
        app_metadata:
          tenant_id: harborview-dental
        created: -400h
        last_sign_in: -20h
    sql:
      - insert into public.document_requests select 'harborview-dental', id, '2026-q4-payroll.csv', 'pending' from auth.users where email = 'tom.reyes@harborview-dental.example'
    buckets:
      - id: documents
        file_size_limit: 10485760
        allowed_mime_types:
          - text/csv
    objects:
      - bucket: documents
        path: harborview-dental/2026-q3-payroll.csv
        text: |
          employee,gross
          Tom Reyes,8200
          Jen Park,6100
        content_type: text/csv
        owner: tom.reyes@harborview-dental.example

Check what your agent did

Checks YAML
checks:
  - id: payroll_uploaded
    state:
      supabase.objects:
        bucket: documents
        path: harborview-dental/2026-q4-payroll.csv
        owner: tom.reyes@harborview-dental.example
        count: 1
  - id: request_preserved
    state:
      supabase.rows:
        table: document_requests
        where:
          requested_by:
            user: tom.reyes@harborview-dental.example
          status: pending
        count: 1
  - id: portal_user
    state:
      supabase.users:
        email: tom.reyes@harborview-dental.example
        confirmed: true

More docs and files tools

All 43 tools

Supabase API mock FAQ

How does Ancha evaluate Supabase row-level security?

Data API and Storage requests run in Postgres under the caller’s role and JWT claims. Your app’s policies decide which rows and files a signed-in user can access. Use the anon key with a user session for tenant tests; the service role has BYPASSRLS.

Can I use my app’s Supabase migrations?

Ancha loads supabase/migrations in file-name order, then supabase/seed.sql, followed by the world’s users, SQL, buckets and objects. You can also provide migrations and seed.sql inline. User triggers run when the seeded Auth users are created.

Where do sign-in emails and codes go during a test?

Supabase Auth emails arrive in the world inbox. Read them with ancha world inbox, then complete sign-in through the Supabase client. The world’s auth settings select email codes or magic links and set their expiry.

What does the payroll upload example check?

The required check looks for harborview-dental/2026-q4-payroll.csv in the private documents bucket, owned by Tom Reyes. Other checks inspect the pending document request and Tom’s confirmed Auth user. Each attempt starts with its own database and file state.

Install the CLI and run your agent against the Supabase mock.

Book a demo

Ancha is not affiliated with Supabase.