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.
payroll_uploadedobjects bucket documents; path harborview-dental/2026-q4-payroll.csv; owner tom.reyes@harborview-dental.example; count 1
request_preservedrows table document_requests; where: requested by: user tom.reyes@harborview-dental.example; status pending; count 1
portal_userusers email tom.reyes@harborview-dental.example; confirmed true
Starting records
users
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_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYSUPABASE_PUBLISHABLE_KEYSUPABASE_SECRET_KEYSUPABASE_JWT_SECRETSUPABASE_PROJECT_REFNEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYVITE_SUPABASE_URLVITE_SUPABASE_ANON_KEYVITE_SUPABASE_PUBLISHABLE_KEYVITE_SUPABASE_PROJECT_IDEXPO_PUBLIC_SUPABASE_URLEXPO_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
/auth/v1/.well-known/jwks.json/auth/v1/admin/generate_link/auth/v1/admin/users/auth/v1/admin/users/auth/v1/admin/users/{id}/auth/v1/admin/users/{id}/auth/v1/admin/users/{id}/auth/v1/authorize/auth/v1/invite/auth/v1/logout/auth/v1/otp/auth/v1/recover/auth/v1/resend/auth/v1/settings/auth/v1/signup/auth/v1/token/auth/v1/user/auth/v1/user/auth/v1/verify/auth/v1/verifystorage
/storage/v1/bucket/storage/v1/bucket/storage/v1/bucket/{id}/storage/v1/bucket/{id}/storage/v1/bucket/{id}/storage/v1/bucket/{id}/empty/storage/v1/object/{bucket}/storage/v1/object/{bucket}/{path*}/storage/v1/object/{bucket}/{path*}/storage/v1/object/{bucket}/{path*}/storage/v1/object/{bucket}/{path*}/storage/v1/object/authenticated/{bucket}/{path*}/storage/v1/object/copy/storage/v1/object/info/{bucket}/{path*}/storage/v1/object/info/{bucket}/{path*}/storage/v1/object/list/{bucket}/storage/v1/object/move/storage/v1/object/public/{bucket}/{path*}/storage/v1/object/sign/{bucket}/storage/v1/object/sign/{bucket}/{path*}/storage/v1/object/sign/{bucket}/{path*}/storage/v1/object/upload/sign/{bucket}/{path*}/storage/v1/object/upload/sign/{bucket}/{path*}v1
/rest/v1//rest/v1/{table}/rest/v1/{table}/rest/v1/{table}/rest/v1/{table}/rest/v1/{table}/rest/v1/{table}/rest/v1/rpc/{function}/rest/v1/rpc/{function}/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: trueMore docs and files tools
All 43 toolsSupabase 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.
Ancha is not affiliated with Supabase.