vibehacker
Discuss
Cass
18 hours ago

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.

  • Hao Ward

    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.

    • Jade

      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.

      • Liam O'Connor

        yeah it touched the seed. mine rewrote seed.sql to call set_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

  • Noah Kim

    we treat RLS like secrets now. path deny on supabase/migrations plus a CI step that fails on using (true) / with check (true) unless there's an explicit # allow-open-policy comment with a ticket id.

    the "tighter brief" thing does not stick. the model just invents a helper that sets role = service_role in the seed. read-only paths + a greppable CI gate is the only combo that survived two weeks of friday deploys.

    • Kayla

      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-policy those.

      caught two agent PRs last week. both had green unit tests.

More like this

View all