pitcheye.dev← All 30 rules
severity: errorpack: dbv1.0 core

db/supabase-rls-missing

Table created in `public` with no RLS

npx @pitcheye/check . --pack db

whyItBreaks

Supabase exposes every `public` table through PostgREST. Without RLS the anon key — which is shipped to the browser by design — can SELECT, INSERT, UPDATE and DELETE every row of it. This is a full data breach with a public credential.

✖ Bad — triggers errorfixtures/db-supabase-rls-missing/bad
CREATE TABLE public.applications (id uuid PRIMARY KEY);
✓ Good — passes checkfixtures/db-supabase-rls-missing/good
CREATE TABLE public.applications (id uuid PRIMARY KEY);
ALTER TABLE public.applications ENABLE ROW LEVEL SECURITY;

suggestedFix

Add `ALTER TABLE public.<name> ENABLE ROW LEVEL SECURITY;` immediately after the CREATE TABLE, plus the policies that should allow access.

explain_rule({"db/supabase-rls-missing"})

Agent & MCP JSON output contract

{
  "ruleId": "db/supabase-rls-missing",
  "pack": "db",
  "severity": "error",
  "file": "apps/web/src/app/api/health/route.ts",
  "line": 6,
  "message": "CREATE TABLE public.<name> with no ENABLE ROW LEVEL SECURITY and no policy for that table in the file",
  "whyItBreaks": "Supabase exposes every `public` table through PostgREST. Without RLS the anon key — which is shipped to the browser by design — can SELECT, INSERT, UPDATE and DELETE every row of it. This is a full data breach with a public credential.",
  "suggestedFix": "Add `ALTER TABLE public.<name> ENABLE ROW LEVEL SECURITY;` immediately after the CREATE TABLE, plus the policies that should allow access.",
  "docsUrl": "https://pitcheye.dev/rules/db-supabase-rls-missing"
}

Markdown: curl -H "Accept: text/markdown" https://pitcheye.dev/rules/db-supabase-rls-missing

raw markdown
# db/supabase-rls-missing

- **severity:** error
- **pack:** db
- **docs:** https://pitcheye.dev/rules/db-supabase-rls-missing

## whyItBreaks

Supabase exposes every `public` table through PostgREST. Without RLS the anon key — which is shipped to the browser by design — can SELECT, INSERT, UPDATE and DELETE every row of it. This is a full data breach with a public credential.

## bad

```ts
CREATE TABLE public.applications (id uuid PRIMARY KEY);
```

## good

```ts
CREATE TABLE public.applications (id uuid PRIMARY KEY);
ALTER TABLE public.applications ENABLE ROW LEVEL SECURITY;
```

## suggestedFix

Add `ALTER TABLE public.<name> ENABLE ROW LEVEL SECURITY;` immediately after the CREATE TABLE, plus the policies that should allow access.

## commands

```bash
npx @pitcheye/check . --pack db
```

```json
{"tool":"explain_rule","arguments":{"ruleId":"db/supabase-rls-missing"}}
```
← db/shared-client-max-oneBack to rule catalogdb/rls-permissive-using-true →