How it works

Four steps: paste your app's address, prove the project is yours, let us check it from the outside, then fix and re-check. Here is exactly what happens at each step.

1. Paste your app's address

Before you prove anything, we load your app's public page and up to 8 of its scripts, the same way a browser does. We look for three things only: your Supabase address, your public key and the names of the tables your app uses.

Nothing is sent to your database at this step. We don't run our secret-key search on your code until you have proved the project is yours, and we keep what we found for 1 day.

Then we show you what we found, for example: "Your app talks to Supabase project abcd...qrst and uses 6 tables: profiles, orders, credits, messages, notes, products."

App not published yet, or behind a login? You can enter your Supabase project address and public key by hand instead. Never paste a secret key. We refuse it, and you should rotate it.

2. Prove it's yours

The same checks that help you would help an attacker, so we only check a project after its owner proves control. You do that by adding one temporary function to your database. You never give us a password or a secret key.

What you're told before you run it: This creates one temporary function that only answers to Tightlatch's secret token and stops working at the time shown on your scan page (24 hours, or 3 days if you choose). It reads settings like table names and security rules. It never reads or changes your data.

Supabase's Security Advisor (and Lovable's security check) will warn about it, because the public role can call it. That warning is expected: it is us. It goes away when you click Remove now after the scan, or run the cleanup snippet.

Two ways to add it

  1. Your SQL editor (the default). Your scan page has an "Open your SQL editor" button that opens a new query in your Supabase dashboard. Paste the snippet, click Run, and leave the role selector on postgres.
  2. Your builder's chat. No SQL editor? Paste our prompt into your builder's chat (see Can't run SQL?). It asks the chat to add the SQL exactly as written. If the chat changes the SQL, we notice and refuse to scan.

How we know it's really ours

Before every scan, we check that the function in your database is exactly the one we gave you: same text, same settings, same permissions. We also send a wrong token on purpose and make sure it is refused. If anything is different, we stop and send nothing else.

The full snippet

This is the complete template. Only the expiry, the token hash and the nonce differ for your scan. Your secret token itself never appears in the SQL, so a copy that ends up in a public repository can't be used by anyone else.

Template SHA-256: 095af68f43483d48239aafde4716bb689afeb9d70ef05a2b0c1db351cf9deda5

The hash is of the template file as published, with Unix line endings and a final newline.

Show the install template (template v3)
-- Tightlatch read-only check for your Supabase project (template v3).
-- What this does: creates 1 temporary function. It answers only to Tightlatch's
-- secret token, and it stops working at __EXPIRES__ (UTC).
-- It reads configuration (table names, security settings, policies). It never reads your data rows.
-- Leave the role selector on "postgres". Remove it any time with the "Remove now" button
-- on your Tightlatch page, or with the cleanup snippet.
-- Full template and its SHA-256: https://tightlatch.com/how-it-works

create or replace function public.tightlatch_audit(p_token text, p_part text default 'verify', p_page integer default 0)
returns jsonb
language plpgsql
volatile
security definer
set search_path = pg_catalog, pg_temp
as $fn$
declare
  v_schemas  text[];
  v_cfg      text;
  v_src      text := 'default';
  v_size     integer;
  v_items    jsonb;
  v_more     boolean := false;
  v_buckets  jsonb := 'null'::jsonb;
  v_fn       record;
  v_removed  integer := 0;
  v_failed   integer := 0;
begin
  if p_token is null or pg_catalog.length(p_token) <> 43 then
    raise exception 'tightlatch: bad token' using errcode = '42501';
  end if;
  if pg_catalog.now() > '__EXPIRES__'::timestamptz then
    raise exception 'tightlatch: window expired' using errcode = 'PT410';
  end if;
  if pg_catalog.encode(pg_catalog.sha256(pg_catalog.convert_to(p_token, 'UTF8')), 'hex') <> '__TOKEN_SHA256__' then
    raise exception 'tightlatch: bad token' using errcode = '42501';
  end if;
  if p_page is null or p_page < 0 or p_page > 500 then
    raise exception 'tightlatch: bad page' using errcode = '22023';
  end if;

  if p_part = 'verify' then
    return pg_catalog.jsonb_build_object(
      'ok', true,
      'v', 3,
      'nonce', '__NONCE__',
      'pg', pg_catalog.current_setting('server_version'),
      'owner', current_user,
      'owner_bypassrls', (select r.rolbypassrls or r.rolsuper from pg_catalog.pg_roles r where r.rolname = current_user),
      'at', pg_catalog.now(),
      'self', (
        select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'schema', n.nspname,
            'name', p.proname,
            'args', pg_catalog.pg_get_function_identity_arguments(p.oid),
            'body_sha256', pg_catalog.encode(pg_catalog.sha256(pg_catalog.convert_to(
                pg_catalog.lower(pg_catalog.regexp_replace(p.prosrc, '\s', '', 'g')), 'UTF8')), 'hex'),
            'security_definer', p.prosecdef,
            'volatility', p.provolatile,
            'config', pg_catalog.to_jsonb(p.proconfig),
            'acl', p.proacl::text,
            'owner', pg_catalog.pg_get_userbyid(p.proowner)) order by n.nspname, p.proname, p.oid), '[]'::jsonb)
        from pg_catalog.pg_proc p
        join pg_catalog.pg_namespace n on n.oid = p.pronamespace
        where p.proname like 'tightlatch\_%'));
  end if;

  if p_part = 'remove' then
    for v_fn in
      select p.oid::pg_catalog.regprocedure as sig
      from pg_catalog.pg_proc p
      where p.pronamespace = 'public'::pg_catalog.regnamespace
        and p.proname in ('tightlatch_verify', 'tightlatch_audit')
    loop
      begin
        execute pg_catalog.format('drop function %s', v_fn.sig);
        v_removed := v_removed + 1;
      exception when others then
        v_failed := v_failed + 1;
      end;
    end loop;
    perform pg_catalog.pg_notify('pgrst', 'reload schema');
    return pg_catalog.jsonb_build_object('v', 3, 'removed', v_removed, 'failed', v_failed);
  end if;

  v_cfg := nullif(pg_catalog.current_setting('pgrst.db_schemas', true), '');
  if v_cfg is not null then
    v_src := 'session';
  else
    select pg_catalog.substr(s.cfg, 18) into v_cfg
    from pg_catalog.pg_db_role_setting d
    join pg_catalog.pg_roles r on r.oid = d.setrole
    cross join lateral pg_catalog.unnest(d.setconfig) as s(cfg)
    where r.rolname = 'authenticator'
      and s.cfg like 'pgrst.db\_schemas=%'
      and d.setdatabase in (0, (select db.oid from pg_catalog.pg_database db where db.datname = pg_catalog.current_database()))
    order by d.setdatabase desc
    limit 1;
    if v_cfg is not null then
      v_src := 'role_setting';
    end if;
  end if;
  v_schemas := array(
    select distinct pg_catalog.btrim(s)
    from pg_catalog.unnest(pg_catalog.string_to_array(coalesce(v_cfg, 'public') || ',public', ',')) as s
    where pg_catalog.btrim(s) <> ''
  );

  if p_part = 'summary' then
    if pg_catalog.to_regclass('storage.buckets') is not null then
      select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
          'id', b.id, 'name', b.name, 'public', b.public,
          'file_size_limit', b.file_size_limit,
          'allowed_mime_types', pg_catalog.to_jsonb(b.allowed_mime_types)) order by b.id), '[]'::jsonb)
      into v_buckets
      from (select * from storage.buckets order by id limit 200) b;
    end if;

    return pg_catalog.jsonb_build_object(
      'v', 3,
      'part', 'summary',
      'nonce', '__NONCE__',
      'generated_at', pg_catalog.now(),
      'pg', pg_catalog.current_setting('server_version'),
      'fn_owner', current_user,
      'fn_owner_bypassrls', (select r.rolbypassrls or r.rolsuper from pg_catalog.pg_roles r where r.rolname = current_user),
      'api_schemas', pg_catalog.to_jsonb(v_schemas),
      'api_schemas_source', v_src,
      'page_sizes', pg_catalog.jsonb_build_object('tables', 40, 'policies', 200, 'views', 50, 'functions', 40),
      'counts', pg_catalog.jsonb_build_object(
        'tables', (select pg_catalog.count(*) from pg_catalog.pg_class c
                   join pg_catalog.pg_namespace n on n.oid = c.relnamespace
                   where c.relkind in ('r', 'p', 'f') and n.nspname = any (v_schemas)),
        'policies', (select pg_catalog.count(*) from pg_catalog.pg_policies p
                     where p.schemaname = any (v_schemas)
                        or (p.schemaname = 'storage' and p.tablename in ('objects', 'buckets'))),
        'views', (select pg_catalog.count(*) from pg_catalog.pg_class c
                  join pg_catalog.pg_namespace n on n.oid = c.relnamespace
                  where c.relkind in ('v', 'm') and n.nspname = any (v_schemas)),
        'functions', (select pg_catalog.count(*) from pg_catalog.pg_proc p
                      join pg_catalog.pg_namespace n on n.oid = p.pronamespace
                      where n.nspname = any (v_schemas) and p.prokind in ('f', 'p')
                        and not (n.nspname = 'public' and p.proname = 'tightlatch_audit'
                                 and pg_catalog.pg_get_function_identity_arguments(p.oid) = 'p_token text, p_part text, p_page integer')
                        and not exists (select 1 from pg_catalog.pg_depend d
                                        where d.classid = 'pg_catalog.pg_proc'::pg_catalog.regclass
                                          and d.objid = p.oid and d.deptype = 'e'))),
      'schema_privileges', (
        select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'schema', s,
            'anon_usage', pg_catalog.has_schema_privilege('anon', s, 'USAGE'),
            'anon_create', pg_catalog.has_schema_privilege('anon', s, 'CREATE'),
            'auth_create', pg_catalog.has_schema_privilege('authenticated', s, 'CREATE'))), '[]'::jsonb)
        from pg_catalog.unnest(v_schemas) as s
        where pg_catalog.to_regnamespace(s) is not null),
      'storage_buckets', v_buckets,
      'realtime_tables', (
        select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'schema', pt.schemaname, 'table', pt.tablename) order by pt.schemaname, pt.tablename), '[]'::jsonb)
        from pg_catalog.pg_publication_tables pt
        where pt.pubname = 'supabase_realtime'),
      'extensions', (
        select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'name', e.extname, 'schema', n.nspname, 'version', e.extversion) order by e.extname), '[]'::jsonb)
        from pg_catalog.pg_extension e
        join pg_catalog.pg_namespace n on n.oid = e.extnamespace),
      'ext_exposed', (
        select coalesce(pg_catalog.jsonb_agg(x.j order by x.ext, x.sch), '[]'::jsonb)
        from (
          select e.extname as ext, n.nspname as sch, pg_catalog.jsonb_build_object(
              'extension', e.extname,
              'schema', n.nspname,
              'functions', pg_catalog.count(*),
              'anon_exec', pg_catalog.count(*) filter (where pg_catalog.has_function_privilege('anon', p.oid, 'EXECUTE')),
              'auth_exec', pg_catalog.count(*) filter (where pg_catalog.has_function_privilege('authenticated', p.oid, 'EXECUTE')),
              'sample', (pg_catalog.array_agg(p.proname::text order by p.proname))[1:5]) as j
          from pg_catalog.pg_proc p
          join pg_catalog.pg_namespace n on n.oid = p.pronamespace
          join pg_catalog.pg_depend d
            on d.classid = 'pg_catalog.pg_proc'::pg_catalog.regclass and d.objid = p.oid and d.deptype = 'e'
          join pg_catalog.pg_extension e on e.oid = d.refobjid
          where n.nspname = any (v_schemas)
          group by e.extname, n.nspname
          having pg_catalog.count(*) filter (where pg_catalog.has_function_privilege('anon', p.oid, 'EXECUTE')
                                               or pg_catalog.has_function_privilege('authenticated', p.oid, 'EXECUTE')) > 0
        ) x),
      'default_acl', (
        select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'role', pg_catalog.pg_get_userbyid(da.defaclrole),
            'schema', (select ns.nspname from pg_catalog.pg_namespace ns where ns.oid = da.defaclnamespace),
            'objtype', da.defaclobjtype,
            'acl', da.defaclacl::text)), '[]'::jsonb)
        from pg_catalog.pg_default_acl da),
      'triggers', (
        select coalesce(pg_catalog.jsonb_agg(x.j), '[]'::jsonb)
        from (
          select pg_catalog.jsonb_build_object(
              'schema', n.nspname, 'table', c.relname, 'name', t.tgname,
              'function', fn.nspname || '.' || p.proname,
              'function_security_definer', p.prosecdef,
              'enabled', t.tgenabled) as j
          from pg_catalog.pg_trigger t
          join pg_catalog.pg_class c on c.oid = t.tgrelid
          join pg_catalog.pg_namespace n on n.oid = c.relnamespace
          join pg_catalog.pg_proc p on p.oid = t.tgfoid
          join pg_catalog.pg_namespace fn on fn.oid = p.pronamespace
          where not t.tgisinternal
            and (n.nspname = any (v_schemas) or c.oid = pg_catalog.to_regclass('auth.users'))
          order by n.nspname, c.relname, t.tgname
          limit 500) x),
      'auth_users_est', (
        select pg_catalog.int8larger(c.reltuples::bigint, -1)
        from pg_catalog.pg_class c
        where c.oid = pg_catalog.to_regclass('auth.users'))
    );

  elsif p_part = 'tables' then
    v_size := 40;
    select coalesce(pg_catalog.jsonb_agg(x.j order by x.sch, x.rel), '[]'::jsonb) into v_items
    from (
      select n.nspname as sch, c.relname as rel, pg_catalog.jsonb_build_object(
        'schema', n.nspname,
        'name', c.relname,
        'kind', c.relkind,
        'rls', c.relrowsecurity,
        'rls_forced', c.relforcerowsecurity,
        'replica_identity', c.relreplident,
        'est_rows', pg_catalog.int8larger(c.reltuples::bigint, -1),
        'owner', pg_catalog.pg_get_userbyid(c.relowner),
        'anon', pg_catalog.jsonb_build_object(
          'select', pg_catalog.has_any_column_privilege('anon', c.oid, 'SELECT'),
          'insert', pg_catalog.has_any_column_privilege('anon', c.oid, 'INSERT'),
          'update', pg_catalog.has_any_column_privilege('anon', c.oid, 'UPDATE'),
          'delete', pg_catalog.has_table_privilege('anon', c.oid, 'DELETE')),
        'authenticated', pg_catalog.jsonb_build_object(
          'select', pg_catalog.has_any_column_privilege('authenticated', c.oid, 'SELECT'),
          'insert', pg_catalog.has_any_column_privilege('authenticated', c.oid, 'INSERT'),
          'update', pg_catalog.has_any_column_privilege('authenticated', c.oid, 'UPDATE'),
          'delete', pg_catalog.has_table_privilege('authenticated', c.oid, 'DELETE')),
        'realtime', exists (
          select 1 from pg_catalog.pg_publication_tables pt
          where pt.pubname = 'supabase_realtime' and pt.schemaname = n.nspname and pt.tablename = c.relname),
        'pk', (
          select coalesce(pg_catalog.jsonb_agg(a.attname order by a.attnum), '[]'::jsonb)
          from pg_catalog.pg_constraint con
          join pg_catalog.pg_attribute a on a.attrelid = con.conrelid and a.attnum = any (con.conkey)
          where con.conrelid = c.oid and con.contype = 'p'),
        'auth_fk_columns', (
          select coalesce(pg_catalog.jsonb_agg(a.attname order by a.attnum), '[]'::jsonb)
          from pg_catalog.pg_constraint con
          join pg_catalog.pg_attribute a on a.attrelid = con.conrelid and a.attnum = any (con.conkey)
          where con.conrelid = c.oid and con.contype = 'f'
            and con.confrelid = pg_catalog.to_regclass('auth.users')),
        'columns', (
          select coalesce(pg_catalog.jsonb_agg(pg_catalog.jsonb_build_object(
            'name', a.attname,
            'type', pg_catalog.format_type(a.atttypid, a.atttypmod),
            'not_null', a.attnotnull,
            'default', pg_catalog.left(pg_catalog.pg_get_expr(d.adbin, d.adrelid), 200),
            'priv',
              (case when pg_catalog.has_column_privilege('anon', c.oid, a.attnum, 'SELECT') then 's' else '-' end) ||
              (case when pg_catalog.has_column_privilege('anon', c.oid, a.attnum, 'INSERT') then 'i' else '-' end) ||
              (case when pg_catalog.has_column_privilege('anon', c.oid, a.attnum, 'UPDATE') then 'u' else '-' end) ||
              (case when pg_catalog.has_column_privilege('authenticated', c.oid, a.attnum, 'SELECT') then 's' else '-' end) ||
              (case when pg_catalog.has_column_privilege('authenticated', c.oid, a.attnum, 'INSERT') then 'i' else '-' end) ||
              (case when pg_catalog.has_column_privilege('authenticated', c.oid, a.attnum, 'UPDATE') then 'u' else '-' end)
          ) order by a.attnum), '[]'::jsonb)
          from pg_catalog.pg_attribute a
          left join pg_catalog.pg_attrdef d on d.adrelid = a.attrelid and d.adnum = a.attnum
          where a.attrelid = c.oid and a.attnum > 0 and not a.attisdropped)
      ) as j
      from pg_catalog.pg_class c
      join pg_catalog.pg_namespace n on n.oid = c.relnamespace
      where c.relkind in ('r', 'p', 'f')
        and n.nspname = any (v_schemas)
      order by n.nspname, c.relname
      limit v_size + 1 offset p_page * v_size
    ) x;

  elsif p_part = 'policies' then
    v_size := 200;
    select coalesce(pg_catalog.jsonb_agg(x.j order by x.s, x.t, x.n), '[]'::jsonb) into v_items
    from (
      select p.schemaname as s, p.tablename as t, p.policyname as n, pg_catalog.jsonb_build_object(
        'schema', p.schemaname, 'table', p.tablename, 'name', p.policyname,
        'permissive', p.permissive, 'roles', pg_catalog.to_jsonb(p.roles::text[]),
        'cmd', p.cmd,
        'using', pg_catalog.left(p.qual, 2000),
        'check', pg_catalog.left(p.with_check, 2000),
        'truncated', coalesce(pg_catalog.length(p.qual), 0) > 2000 or coalesce(pg_catalog.length(p.with_check), 0) > 2000,
        'md5', pg_catalog.md5(coalesce(p.qual, '') || pg_catalog.chr(31) || coalesce(p.with_check, ''))
      ) as j
      from pg_catalog.pg_policies p
      where p.schemaname = any (v_schemas)
         or (p.schemaname = 'storage' and p.tablename in ('objects', 'buckets'))
      order by p.schemaname, p.tablename, p.policyname
      limit v_size + 1 offset p_page * v_size
    ) x;

  elsif p_part = 'views' then
    v_size := 50;
    select coalesce(pg_catalog.jsonb_agg(x.j order by x.sch, x.rel), '[]'::jsonb) into v_items
    from (
      select n.nspname as sch, c.relname as rel, pg_catalog.jsonb_build_object(
        'schema', n.nspname,
        'name', c.relname,
        'kind', c.relkind,
        'owner', pg_catalog.pg_get_userbyid(c.relowner),
        'security_invoker', coalesce(
          pg_catalog.lower(c.reloptions::text)::text[]
            && array['security_invoker=1','security_invoker=true','security_invoker=yes','security_invoker=on'],
          false),
        'anon_select', pg_catalog.has_any_column_privilege('anon', c.oid, 'SELECT'),
        'auth_select', pg_catalog.has_any_column_privilege('authenticated', c.oid, 'SELECT'),
        'uses_auth_users', exists (
          select 1
          from pg_catalog.pg_rewrite rw
          join pg_catalog.pg_depend dep
            on dep.classid = 'pg_catalog.pg_rewrite'::pg_catalog.regclass and dep.objid = rw.oid
          where rw.ev_class = c.oid
            and dep.refobjid = pg_catalog.to_regclass('auth.users')),
        'base_tables', (
          select coalesce(pg_catalog.jsonb_agg(distinct (rn.nspname || '.' || rc.relname)), '[]'::jsonb)
          from pg_catalog.pg_rewrite rw
          join pg_catalog.pg_depend dep
            on dep.classid = 'pg_catalog.pg_rewrite'::pg_catalog.regclass and dep.objid = rw.oid
          join pg_catalog.pg_class rc on rc.oid = dep.refobjid and rc.oid <> c.oid
          join pg_catalog.pg_namespace rn on rn.oid = rc.relnamespace
          where rw.ev_class = c.oid and dep.refclassid = 'pg_catalog.pg_class'::pg_catalog.regclass),
        'definition', pg_catalog.left(pg_catalog.pg_get_viewdef(c.oid, true), 2000)
      ) as j
      from pg_catalog.pg_class c
      join pg_catalog.pg_namespace n on n.oid = c.relnamespace
      where c.relkind in ('v', 'm')
        and n.nspname = any (v_schemas)
      order by n.nspname, c.relname
      limit v_size + 1 offset p_page * v_size
    ) x;

  elsif p_part = 'functions' then
    v_size := 40;
    select coalesce(pg_catalog.jsonb_agg(x.j order by x.sch, x.fn, x.args), '[]'::jsonb) into v_items
    from (
      select n.nspname as sch, p.proname as fn, pg_catalog.pg_get_function_identity_arguments(p.oid) as args,
        pg_catalog.jsonb_build_object(
        'schema', n.nspname,
        'name', p.proname,
        'args', pg_catalog.pg_get_function_identity_arguments(p.oid),
        'returns', pg_catalog.left(pg_catalog.pg_get_function_result(p.oid), 300),
        'language', l.lanname,
        'security_definer', p.prosecdef,
        'volatility', p.provolatile,
        'config', pg_catalog.to_jsonb(p.proconfig),
        'owner', pg_catalog.pg_get_userbyid(p.proowner),
        'anon_exec', pg_catalog.has_function_privilege('anon', p.oid, 'EXECUTE'),
        'auth_exec', pg_catalog.has_function_privilege('authenticated', p.oid, 'EXECUTE'),
        'dynamic_sql', l.lanname = 'plpgsql' and p.prosrc ~* '\mexecute\M',
        'source', case
          when p.prosecdef
           and (pg_catalog.has_function_privilege('anon', p.oid, 'EXECUTE')
                or pg_catalog.has_function_privilege('authenticated', p.oid, 'EXECUTE'))
          then pg_catalog.left(p.prosrc, 4000) end
      ) as j
      from pg_catalog.pg_proc p
      join pg_catalog.pg_namespace n on n.oid = p.pronamespace
      join pg_catalog.pg_language l on l.oid = p.prolang
      where n.nspname = any (v_schemas)
        and p.prokind in ('f', 'p')
        and not (n.nspname = 'public' and p.proname = 'tightlatch_audit'
                 and pg_catalog.pg_get_function_identity_arguments(p.oid) = 'p_token text, p_part text, p_page integer')
        and not exists (
          select 1 from pg_catalog.pg_depend d
          where d.classid = 'pg_catalog.pg_proc'::pg_catalog.regclass
            and d.objid = p.oid and d.deptype = 'e')
      order by n.nspname, p.proname, pg_catalog.pg_get_function_identity_arguments(p.oid)
      limit v_size + 1 offset p_page * v_size
    ) x;

  else
    raise exception 'tightlatch: bad part' using errcode = '22023';
  end if;

  if pg_catalog.jsonb_array_length(v_items) > v_size then
    v_items := v_items - v_size;
    v_more := true;
  end if;

  return pg_catalog.jsonb_build_object(
    'v', 3, 'part', p_part, 'page', p_page, 'page_size', v_size,
    'has_more', v_more, 'items', v_items);
end
$fn$;

revoke all on function public.tightlatch_audit(text, text, integer) from public, anon, authenticated;
grant execute on function public.tightlatch_audit(text, text, integer) to anon;

notify pgrst, 'reload schema';

When you're done: Remove now

When your scan is finished, click Remove now on your scan page. The function deletes itself, and Supabase's warning clears within a few minutes. If you chose the 3-day window, the button stays available and we remind you on the page.

You can also remove it yourself at any time with the cleanup snippet below. Without the function, no scan can run. Your SQL editor may warn that this contains a drop statement. That is expected.

Show the cleanup snippet
-- Tightlatch cleanup: removes the temporary check function, including any older or edited copy.
-- Safe to run more than once. Your SQL editor may warn that this contains "drop". That is expected.
do $tl_cleanup$
declare
  f record;
begin
  for f in
    select p.oid::pg_catalog.regprocedure as sig
    from pg_catalog.pg_proc p
    where p.pronamespace = 'public'::pg_catalog.regnamespace
      and p.proname in ('tightlatch_verify', 'tightlatch_audit')
  loop
    execute pg_catalog.format('drop function %s', f.sig);
  end loop;
end
$tl_cleanup$;
notify pgrst, 'reload schema';

After the window ends, the function refuses every call, even if you forget to remove it. Only the Advisor warning remains until you run the cleanup snippet.

3. What we check

Once the function is verified, we read your security settings through it and check from the outside, one request at a time:

Every finding shows its evidence. If something could not be checked, your results say "Partly checked" and tell you what, so a partial scan never looks clean.

See the full list of checks and how we rate them

4. What we never do

Want to see exactly which requests we send? Our scanner page lists every one.

5. Your report

The free scan shows every finding with its severity and evidence, what a stranger can read, and the full fix for your most serious finding. If your scan finds only Low issues, every fix is free.

The full report ($49 per project, one time) gives you, for each finding:

Each fix runs as one block, so it either applies fully or not at all. Re-scan from your report for 30 days to see each finding marked fixed, still open or not re-checked. Your report link works for 12 months.

See a sample report or a real scan of our test app.

Free scan. Full report with every fix is $49.

6. Can't run SQL?

Some builders don't give you a SQL editor. Your scan page then shows a message to paste into your builder's chat. It looks like this, with your own expiry time and snippet filled in:

Please create and apply a new database migration that contains exactly the SQL between the lines
"BEGIN TIGHTLATCH SQL" and "END TIGHTLATCH SQL". Do not change, shorten, reformat or "improve" it,
and do not change anything else in the project. It adds one temporary function that Tightlatch uses
to confirm I own this project. It never reads or changes my data, and it stops working on
(your expiry time) UTC. When it has been applied, reply with the single word: applied.

BEGIN TIGHTLATCH SQL
(the snippet from your scan page)
END TIGHTLATCH SQL

When your scan is done, you get a second message that asks the chat to remove the function the same way, so it doesn't come back on a branch or a remix.

If the chat refuses or changes the SQL, we can't verify the project yet. Start a check and the page lets you join the list for your platform, and we'll email you when it works. Or let us do it with you through the Fix Pack.

Check my app