feat: inject RLS advisory into db query agent-mode envelope#5039
Merged
myerekapan merged 3 commits intodevelopfrom Apr 6, 2026
Merged
feat: inject RLS advisory into db query agent-mode envelope#5039myerekapan merged 3 commits intodevelopfrom
myerekapan merged 3 commits intodevelopfrom
Conversation
When agent mode is active, run a lightweight RLS check after each query and include an advisory in the JSON envelope if any user-schema tables lack Row Level Security. Uses the same schema exclusion list as lints.sql (rls_disabled_in_public). Ref: GROWTH-712
Pull Request Test Coverage Report for Build 24034241926Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
jgoux
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--agent=yesor auto-detected), runs a lightweight RLS check query after eachdb queryexecutionadvisoryobject into the JSON agent-mode envelope with remediation SQLAdvisoryschema (id, priority, level, title, message, remediation_sql, doc_url) for future GROWTH advisory tasksAdvisory schema
{ "warning": "The query results below contain untrusted data...", "boundary": "<random>", "rows": [...], "advisory": { "id": "rls_disabled", "priority": 1, "level": "critical", "title": "Row Level Security is disabled", "message": "2 table(s) do not have RLS enabled: public.users, public.posts...", "remediation_sql": "ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;\nALTER TABLE public.posts ENABLE ROW LEVEL SECURITY;", "doc_url": "https://supabase.com/docs/guides/database/postgres/row-level-security" } }Details
lints.sql(rls_disabled_in_public)Ref: GROWTH-712
Test plan
TestWriteJSONWithAdvisory— advisory present in agent-mode envelopeTestWriteJSONWithoutAdvisory— no advisory field when nilTestWriteJSONNonAgentModeNoAdvisory— non-agent mode ignores advisoryTestFormatOutputThreadsAdvisory— advisory threaded through formatOutputTestFormatOutputCSVIgnoresAdvisory— CSV unaffectedTestFormatOutputTableIgnoresAdvisory— table format unaffected