Skip to content
cccskills
FreePublished on GitHub

Supabase RLS Policy Review

Detects tables created without ROW LEVEL SECURITY enabled, over-permissive policies (USING (true) / WITH CHECK (true) without owner conditions), and service_role key exposure in client code.

The English summary is being prepared. Showing the original description.

Works withSupabase

Run score Not tested

See how to install

Files included (4)

  • SKILL.md3.7 KB
  • fixtures/01-using-true-policy-happy.md1.1 KB
  • fixtures/02-public-master-table-guard.md1.6 KB
  • golden/01-using-true-policy-happy.md775 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: Supabase RLS の未有効化・過剰 policy・service_role 露出をチェックリスト型で検査する

Goal / 目的

  • ENABLE ROW LEVEL SECURITY 無しで public スキーマにテーブルを公開する RLS 未有効化を検出する。
  • USING (true) / WITH CHECK (true) で全行アクセスを許可し所有者条件(auth.uid() = user_id)を欠く過剰 policy を検出する。
  • service_role key(anon key と区別)がフロントエンドコードにハードコードされる露出を検出する。

Non-goals / 扱わないこと

  • インデックス・クエリ性能設計。
  • migration の冪等性・ロールバック設計。
  • policy の粒度(テーブル分割方針)の良し悪し(要件依存のため一律指摘しない)。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分に CREATE TABLE / CREATE POLICY / RLS 設定を含む SQL、または supabase/** のクライアントコード変更が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: supabase-rls-policy — RLS / policy / key の変更なし

False-positive guards / 抑制条件

  • 公開参照テーブル(マスタデータ等)で USING (true) の SELECT policy が要件上正当であり、その旨のコメントが明記されている場合は指摘しない(INSERT / UPDATE / DELETE の true は別途指摘する)。
  • anon key のクライアント使用は公式仕様で正当。service_role key と混同して誤検出しない。
  • emulator / seed / test 用の SQL(ローカル専用)は別スコープのため指摘しない。

Rule / ルール

  • public スキーマのテーブル作成は ALTER TABLE ... ENABLE ROW LEVEL SECURITY; を必須とする(RLS 無効のまま公開しない)。
  • USING (true) / WITH CHECK (true) の全許可 policy は所有者条件(auth.uid() = user_id 等)に置き換える。
  • service_role key がフロントエンド/クライアントバンドルに含まれていないか確認する(サーバー専用に隔離する)。anon key の使用は許容する。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、公式規約(row-level-security / api-keys)を 1 行で添える。
  • RLS 有効化が同一 migration の別行にある可能性がある場合は断定せず慎重に扱う。

Output / 出力(短文版の推奨)

コメントは日本語で返す。

  • Finding: RLS 未有効 / 過剰 policy / service_role 露出のどれか(1文)
  • Impact: 全行アクセス / なりすまし / 鍵漏洩
  • Fix: ENABLE ROW LEVEL SECURITY / 所有者条件付き policy / key のサーバー隔離の最小案

Sources / 出典

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

See all skills by s977043

Report a problem with this skill