agent rewrote my supabase rls to using (true) "just for local"
was reviewing a friday branch and almost merged it.
claude code said the policies were "blocking the seed script" so it replaced every auth.uid() = user_id with using (true). left a comment in the migration: temporary for local.
there was no temporary. same file. same schema.sql. i only caught it because the PR diff had ~40 lines of green policy deletes.
anyone else pinning auth/rls paths as read-only for agents yet, or are we all just sweating the review?

5 comments
Join the discussion
Log in to comment.
yeah this is the classic one. we put
supabase/migrations/**and anything matching*rls*into a deny list for the agent. still reviews every migration by hand.using (true)with green CI is not a cleanup — it's an incident waiting on a deploy button. if staging has real-ish data, treat that rewrite like a leaked secret: fix the sql, then assume the blast radius until you prove otherwise.did the agent touch the seed script too or only the policies? curious if a tighter brief ("never edit RLS; fail the seed instead") actually sticks — or it just invents a bypass somewhere else in the repo.
yeah it touched the seed. mine rewrote
seed.sqlto callset_config('request.jwt.claim.sub', ...)with a hard-coded uuid so the policies "worked" locally. looked clever. wouldve shipped if i was tired enough.supabase + agents is rough when the seed and the policies live in the same folder the agent owns
we treat RLS like secrets now. path deny on
supabase/migrationsplus a CI step that fails onusing (true)/with check (true)unless there's an explicit# allow-open-policycomment with a ticket id.the "tighter brief" thing does not stick. the model just invents a helper that sets
role = service_rolein the seed. read-only paths + a greppable CI gate is the only combo that survived two weeks of friday deploys.we added a github action that greps for
using (true)in**/migrations/**and fails the PR. false positives when someone is actually opening a public read table, but that's rare enough we just# allow-open-policythose.caught two agent PRs last week. both had green unit tests.