env | grep SUPABASE
SUPABASE_DB_PASSWORD=<redacted:SUPABASE_DB_PASSWORD> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> SUPABASE_URL=https://<ref>.supabase.co SUPABASE_SERVICE_ROLE_KEY=<redacted:SUPABASE_SERVICE_ROLE_KEY> SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=<redacted:SUPABASE_ANON_KEY>
psql "$SUPABASE_DB_URL" -c "\df supabase_functions.http_request"
List of functions Schema | Name | Result data type | Argument data types | Type --------+------+------------------+---------------------+------ (0 rows)
psql "$SUPABASE_DB_URL" -c "CREATE EXTENSION IF NOT EXISTS pg_net;"
CREATE EXTENSION
psql "$SUPABASE_DB_URL" -c "\df net.http_post"
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+-----------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------
net | http_post | bigint | url text, body jsonb DEFAULT '{}'::jsonb, params jsonb DEFAULT '{}'::jsonb, headers jsonb DEFAULT '{"Content-Type": "application/json"}'::jsonb, timeout_milliseconds integer DEFAULT 5000 | func
(1 row)
psql "$SUPABASE_DB_URL" -c "\d public.signups"
Table "public.signups"
Column | Type | Collation | Nullable | Default
------------+--------------------------+-----------+----------+----------------------------------
id | bigint | | not null | generated by default as identity
email | text | | not null |
plan | text | | not null | 'free'::text
created_at | timestamp with time zone | | not null | now()
Indexes:
"signups_pkey" PRIMARY KEY, btree (id)
curl -X POST "$SUPABASE_URL/functions/v1/hook-recorder" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","plan":"pro"}'
{"ok":true} % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 52 0 11 100 41 23 87 --:--:-- --:--:-- --:--:-- 110
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+----------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
(1 row)
cat << 'EOF' > setup_webhook.sql
CREATE OR REPLACE FUNCTION public.deliver_webhook()
RETURNS trigger AS $$
BEGIN
PERFORM net.http_post(
url := current_setting('app.settings.webhook_url'),
headers := jsonb_build_object(
'Content-Type', 'application/json',
'Authorization', 'Bearer ' || current_setting('app.settings.service_role_key')
),
body := jsonb_build_object(
'email', NEW.email,
'plan', NEW.plan
)
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
DROP TRIGGER IF EXISTS signups_webhook_trigger ON public.signups;
CREATE TRIGGER signups_webhook_trigger
AFTER INSERT ON public.signups
FOR EACH ROW
EXECUTE FUNCTION public.deliver_webhook();
EOF
psql "$SUPABASE_DB_URL" -c "ALTER DATABASE postgres SET app.settings.webhook_url TO '$SUPABASE_URL/functions/v1/hook-recorder';"
ERROR: permission denied to set parameter "app.settings.webhook_url"
cat << 'EOF' > setup_webhook.sql
CREATE OR REPLACE FUNCTION public.deliver_webhook()
RETURNS trigger AS $$
DECLARE
v_url text := current_setting('current_schema', true);
v_jwt text;
BEGIN
v_url := current_setting('app.webhook.url', true);
v_jwt := current_setting('app.webhook.jwt', true);
-- since we can't alter database settings easily as non-superuser,
-- we can hardcode it or use Vault/pg_net with custom headers.
-- Let's just hardcode the env variables.
END;
$$ LANGUAGE plpgsql;
EOF
cat << EOF > setup_webhook.sql
CREATE OR REPLACE FUNCTION public.deliver_webhook()
RETURNS trigger AS \$\$
BEGIN
PERFORM net.http_post(
url := '$SUPABASE_URL/functions/v1/hook-recorder',
headers := jsonb_build_object(
'Content-Type', 'application/json',
'Authorization', 'Bearer $SUPABASE_SERVICE_ROLE_KEY'
),
body := jsonb_build_object(
'email', NEW.email,
'plan', NEW.plan
)
);
RETURN NEW;
END;
\$\$ LANGUAGE plpgsql SECURITY DEFINER;
DROP TRIGGER IF EXISTS signups_webhook_trigger ON public.signups;
CREATE TRIGGER signups_webhook_trigger
AFTER INSERT ON public.signups
FOR EACH ROW
EXECUTE FUNCTION public.deliver_webhook();
EOF
psql "$SUPABASE_DB_URL" -f setup_webhook.sql
CREATE FUNCTION DROP TRIGGER CREATE TRIGGER
psql:setup_webhook.sql:19: NOTICE: trigger "signups_webhook_trigger" for relation "public.signups" does not exist, skipping
psql "$SUPABASE_DB_URL" -c "INSERT INTO public.signups (email, plan) VALUES ('test-insert@example.com', 'enterprise');"INSERT 0 1
sleep 5; psql "$SUPABASE_DB_URL" -c "SELECT * FROM public.webhook_receipts;"
id | received_at | payload
----+-------------------------------+------------------------------------------------------------
2 | 2026-07-24 05:15:33.160813+00 | {"plan": "pro", "email": "test@example.com"}
3 | 2026-07-24 05:16:27.517413+00 | {"plan": "enterprise", "email": "test-insert@example.com"}
(2 rows)
psql "$SUPABASE_DB_URL" -c "SELECT * FROM net.http_request_queue;"
id | method | url | headers | body | timeout_milliseconds ----+--------+-----+---------+------+---------------------- (0 rows)
A shell script executed against the live project and asserted on the state the agent left behind. No model judged another model.
Raw transcript · Task definition and verifier · Every attempt