Skip to content
Back to skills

Supabase Knowledge Patch

ASecurity

Supabase

  • 25 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
developmentpythonrustgoshellsqldockerapidatabasebackendsecurity

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill supabase-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Supabase Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Supabase Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-supabase-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-supabase-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: supabase-knowledge-patch
description: Supabase
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Supabase Knowledge Patch

Load this skill when implementing, upgrading, or troubleshooting Supabase
applications, hosted projects, local development stacks, or self-hosted services.
Use the topic references for complete configuration, examples, limits, and
product-specific behavior. The quick reference starts with compatibility changes.

## Reference index

| Reference | Topics |
| --- | --- |
| [Authentication, OAuth, Hooks, and Keys](references/auth-and-keys.md) | API keys, JWT signing, SSR, OAuth server and providers, passkeys, MFA, SAML, hooks, email |
| [Clients, Developer Tools, and MCP](references/clients-tools-and-mcp.md) | Query types, SDK behavior, framework setup, SQL tools, MCP authentication and tool scope |
| [Cron, Queues, and Platform Integrations](references/cron-queues-and-integrations.md) | Scheduling, queue RPCs, BigQuery pipelines, Management API, Marketplace, wrappers |
| [Database and Data API](references/database-and-data-api.md) | Grants, RLS, schemas, pooling, request hooks, errors, extensions, upgrades, query tools |
| [Edge Functions](references/edge-functions.md) | JWT checks, CORS, deployment, regions, background work, runtime limits, filesystems |
| [Local Development, CLI, Branching, and Deployment](references/local-cli-and-branching.md) | CLI migration, config, schemas, tests, stacks, seeds, preview and production deployment |
| [Platform Administration and Security](references/platform-administration-and-security.md) | Organizations, backups, networking, replicas, disks, audit logs, security and compliance |
| [Realtime](references/realtime.md) | Policies, token refresh, Broadcast persistence and replay, Postgres Changes, Presence, protocol, limits |
| [Self-hosting](references/self-hosting.md) | Docker upgrades, secrets, asymmetric keys, proxies, Auth, Storage, migration, service configuration |
| [Storage, AI, and Vectors](references/storage-ai-and-vectors.md) | Object APIs, S3, TUS, CDN, Iceberg, vector buckets, embeddings, Python collections, permissions |

## Breaking changes and deprecations

### CLI targets and hosted writes

In CLI v3, `db push`/`pull`/`dump`, `migration fetch`/`list`/`repair`/`squash`,
`inspect db`, `inspect report`, `gen types`, and `storage ls`/`cp`/`mv`/`rm`
default to local. Use `--remote` for the linked project or `SUPABASE_PROJECT_ID`,
or `--remote=<value>` for a project ref, linked branch name, or Postgres URL.
Migrate `--linked`, `--project-ref`, `--db-url`, and `gen types --project-id`
to `--remote`; deprecated flags conflict with `--remote=<value>`.

Hosted writes prompt for confirmation. Pass `--yes` for unattended or structured
output; piped input and `.env` values for `SUPABASE_YES` cannot confirm them.
The prompt normally defaults to No; `bootstrap` and creation of projects,
branches, organizations, and domains default to Yes.

```sh
supabase db push --remote --yes
```

Use `db pull --declarative` for the removed `db pull --use-pg-delta` or
`db pull --experimental` flags. Rename `[inbucket]` to `[local_smtp]` and
`INBUCKET_URL` to `MAILPIT_URL`. See the CLI reference for the complete removals,
remote configuration, password rules, and maintenance-channel commands.

### Auth access and recovery behavior

Auth v2.198.0 limits OAuth-server access tokens to OAuth endpoints and read-only
user access. Switch OAuth clients to `GET /oauth/userinfo`; `GET /user`, including
`auth.getUser()`, is only temporarily allowed for compatibility. Account-changing
endpoints reject these tokens with HTTP 403 and `no_authorization`.
Perform account changes from a backend with a normal user session or service-role
credentials where the endpoint supports them.

In Auth v2.198.0, verifying a password recovery link or OTP clears the old password.
Prompt the user to set a new password from the recovery session. Legacy sessions
whose `aal` is null are invalidated, and affected users must sign in again.
Password minimum length and passkey `friendly_name` length use Unicode code points.

In supabase-js v2.119.0, a server logout error from
`auth.signOut({ scope: 'global' })` leaves the local session active.
`auth.admin.deleteUser()` no longer produces a placeholder `User` for an empty
response; check the returned `error` to determine success.

### API exposure and key migration

New projects default to explicit grants for new `public` tables. Grant the API
role the operations it needs, and enable RLS explicitly for SQL-created tables.
New projects must enable `pg_graphql` explicitly. Fetch the Data API OpenAPI schema
from server-side code with a secret key or legacy `service_role` key;
the `anon` key receives `Access to schema is forbidden`.

Send opaque publishable or secret keys in `apikey` and the signed-in user's JWT
in `Authorization: Bearer ...`. Secret-key requests use `service_role` and bypass
RLS; browsers sending secret keys receive HTTP 401. Legacy keys can remain active
during migration. Check last-used indicators before disabling them.

For an opaque key with an Edge Function's legacy gateway JWT check, deploy with
`--no-verify-jwt` and implement authorization in the function. This also skips the
gateway's `apikey` check. Validate bearer tokens with `auth.getClaims(token)` in
the handler before using their claims.

### Database, Realtime, and Storage compatibility

Explicit versions in `CREATE EXTENSION` or `ALTER EXTENSION` emit a warning and
select the default version. Before a hosted Postgres 17 upgrade, drop `pgjwt`,
`plv8`, and `timescaledb`; migrate TimescaleDB hypertables to native partitions first.
The planned `pgsodium` deprecation concerns direct usage; existing Vault callers
can continue using the Vault SQL API.

Creating, altering, or dropping objects in the `realtime` schema fails with a
permission error; existing RLS policies on `realtime.messages` still apply.
From Realtime v2.151.4, invalid persistence TTLs return `persistence_invalid_ttl`;
update checks for `invalid_persist_ttl`.

Use `storage.objects.owner_id` for ownership checks; `owner` is deprecated.
Dashboard-created and service-key-created objects have an unset owner.
In supabase-js v2.119.0, check `error` from `storage.from(bucket).exists(path)`
before treating `data` as an existence result: invalid JWTs and missing buckets
are distinguished from missing objects.

## Authentication and authorization quick reference

The OAuth 2.1 server is beta. Preserve the consent request's `authorization_id`
through sign-in, read details with `auth.oauth.getAuthorizationDetails(id)`, and
redirect to the `redirect_to` returned by approval or denial. OAuth scopes govern
ID token and UserInfo claims; access tokens inherit the user's data permissions.
Use `auth.jwt()->>'client_id'` in RLS to restrict OAuth client access, with a
restrictive policy when permissive policies already grant access.

Use `auth.getClaims()` for SSR access-token verification and `auth.getUser()` when
the decision needs current server-side session state. With `@supabase/ssr` 0.10.0,
forward `Cache-Control`, `Expires`, and `Pragma` from the second `cookies.setAll`
argument on the same response as the refreshed cookies.

Before rotating JWT signing keys, update legacy-secret verification and refresh
custom JWKS consumers. Previous keys stay trusted until revocation. Allow for JWT
expiry and JWKS caches: 10 minutes at the edge and potentially 10 more in the client.
Revoking the legacy secret requires migrating API keys and disabling legacy keys.

## Functions and Realtime quick reference

Import SDK `corsHeaders` from the `/cors` export in supabase-js v2.95.0 or later,
and include them in preflight, success, and error responses. From CLI v3.1, the
experimental gateway no longer adds `Access-Control-Allow-Origin: *` for `/functions/v1`.

`EdgeRuntime.waitUntil(promise)` keeps a worker eligible to run after the response,
subject to worker limits. Set `[edge_runtime].policy = "per_worker"` locally for
background work and WebSockets; restart `supabase functions serve` after edits.
Hosted workers have 256 MB memory and 2 seconds of CPU per request excluding async
I/O. Worker lifetimes are 150 seconds on Free and 400 seconds on paid plans.

Register `postgres_changes` handlers before `.subscribe()`; joined channels reject
new `postgres_changes` listeners. Private Broadcast and Presence use `SELECT` policies for receiving
and `INSERT` policies for sending or tracking on `realtime.messages`.
Postgres Changes instead uses the source table's RLS.

Broadcast Replay is public alpha for database broadcasts on private channels.
Use Unix milliseconds for `since`, check `meta.replayed`, and set
`config.broadcast.replay.limit`; Realtime v2.176.0 raises the maximum to 200.
Refresh the channel JWT before expiry; reconnect or send a fresh `access_token`
message to pick up permission changes.

## Local configuration and deployment quick reference

CLI v3 resolves values from flags, shell environment, project env files, a matched
`[remotes.<name>]` block, base config, then defaults. From v3.4, `supabase init`
creates `config.jsonc`; project tooling should recognize TOML, JSON, and JSONC.
`supabase config validate --resolve-env` checks interpolated environment values.

For the experimental stack, remove fixed ports and set `[experimental].stack = true`.
`supabase start --runtime native` starts without a container engine. CLI v3.2
rejects `db.major_version = 13`; use 14, 15, or 17, with 17 the upgrade target.

Preview branches start without production data, apply pending migrations in
timestamp order, and seed once at creation. Recreating a preview discards its data.
Default production deployment applies new migrations and declared Edge Functions
and Storage buckets; deploy API settings, Auth settings, and seed data separately.

## Storage, embeddings, and integration quick reference

Use the public-alpha `storage.analytics` namespace for Iceberg-backed buckets and
`storage.vectors` for Vector buckets. Populate Analytics buckets with your own
ingestion pipeline following removal of managed replication into them.
Vector index dimension, distance metric, or data type changes require a replacement
index; batch vector writes in groups of 500.

For embedding updates, enqueue from `AFTER INSERT` and `AFTER UPDATE OF` triggers.
List every input column in `UPDATE OF` to leave the queue alone when the embedding
column changes. Scheduled SQL needs its own worker credential. Delete each queue
message only after writing its embedding. HTTP 200 can still contain failed jobs;
inspect `x-failed-jobs` and `net._http_response`.

Managed BigQuery Pipelines are public alpha on paid plans. Restart after publication
changes. Stopped pipelines retain changes in WAL, and restarts can replay an
interrupted transaction; consumers requiring exactly-once results need deduplication.

## MCP and operations quick reference

Scope hosted MCP with `project_ref`, `read_only=true`, and `features`. Storage tools
are opt-in. Read-only mode also removes mutating tools from discovery. Use
`apply_migration` for DDL and `execute_sql` for queries that leave the schema intact.
Project and branch creation require `get_cost` and `confirm_cost` acknowledgment.
The developer MCP server acts with the developer's permissions; application users
can connect through `@supabase/mcp-server-postgrest` and the app's REST API.

Database network restrictions cover direct and pooled Postgres, while HTTPS APIs
remain accessible. Enabling restrictions blocks direct database connections from
Edge Functions, which can use HTTPS instead. Remove read replicas before project
upgrades or restores and redeploy afterward. See the platform and self-hosting
references for backup scope, service configuration, and upgrade procedures.

Files in this skill

  • SKILL.md8 KB
  • references/api-postgrest.md3.4 KB
  • references/auth.md6.2 KB
  • references/breaking-changes.md5.2 KB
  • references/cli-and-deployment.md9.1 KB
  • references/database-and-queues.md7.4 KB
  • references/deployment.md4.3 KB
  • references/edge-functions.md3.2 KB
  • references/js-client.md3.7 KB
  • references/local-dev.md2.3 KB
  • references/mcp-server.md2.5 KB
  • references/queues-cron.md3.1 KB
  • references/realtime.md4 KB
  • references/self-hosting.md6 KB
  • references/storage.md3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.