All guidesSupabase RLS and keys
On this page

Supabase change

Supabase personal access token scopes: how do I give an agent or CI a token for one project with only the permissions it needs?

By Ohad Krispin, founder of VibeRaven · LinkedIn

Short answer

Create a new token on the Dashboard's access tokens page: since scoping became generally available on September 28, 2026, every new personal access token is scoped to the organizations or projects you pick, with Read or Read-write for each permission and an expiry up to one year out. For an agent that only reads one project, scope it to that project, start from the No access preset and turn on Database Read; the Read-only preset includes API key secrets. Scope cannot be edited after creation, a token never has more access than your own role, and old full-access tokens keep working with a Legacy badge. The browser flow of supabase login still creates a full-access token, so give the CLI and CI a scoped one with supabase login --token or SUPABASE_ACCESS_TOKEN.

Build a token for one agent

On the access tokens page, choose the resources (the Dashboard recommends a project-level scope), the permissions and the expiry. The review screen expands each permission into the Management API endpoints and MCP tools it covers, and shows a Low, Medium or High risk banner for the mix of reach and write access. Copy the value before you close the page: it is shown once.

A 403 with missing_permissions

When a Management API request lacks a permission, the 403 names it in a missing_permissions field. Check that your own role has that permission, then create a replacement token that includes it: scope and permissions are fixed at creation. A request for a project outside the token's scope gets a plain 403 with no field.

Code
export SUPABASE_ACCESS_TOKEN="sbp_fc..."

# Database Read covers this endpoint
curl "https://api.supabase.com/v1/projects/your-project-ref/types/typescript" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"

# needs Project Settings Read: HTTP 403 without it
curl -i "https://api.supabase.com/v1/projects/your-project-ref" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"

Scoped tokens with the Supabase CLI and in CI

Create the token in the Dashboard and pass it with supabase login --token, or set SUPABASE_ACCESS_TOKEN, which overrides any saved token and is the one to use in CI.

Terminal
supabase login --token sbp_fc...

# CI
export SUPABASE_ACCESS_TOKEN="sbp_fc..."
supabase link --project-ref your-project-ref

A token follows your own role

Every request checks both the token's scope and your current role. If you leave an organization or lose a permission, the token loses it too, and gets it back if your access returns; the token's detail view marks resources you can no longer reach. The Dashboard lets you add a permission your role lacks, but the token cannot use it until your role has it.

Find tokens committed to the repo

Personal access tokens start with sbp_, and scoped ones with sbp_fc. Search the repo and its history for both; a token found there should be deleted in the Dashboard and replaced with a scoped one.

On a public GitHub repo, also look at its secret scanning alerts. GitHub's list of supported secret scanning patterns, read on October 22, 2026, includes two kinds of Supabase personal access token, and push protection covers one of them. Which Supabase keys that list covers.

Terminal
grep -rn "sbp_" --exclude-dir=node_modules --exclude-dir=.git .
git log -p --all -S "sbp_" --oneline

Replace a full-access token

  1. 1
    List the tools that hold a Supabase token: coding agents, MCP configs, CI secrets, deploy scripts.
  2. 2
    For each one, create a token scoped to its project, with only the permissions its job needs and an expiry that matches it.
  3. 3
    Start an agent from the No access preset and add Database Read; add Migrations Read-write only if it applies migrations.
  4. 4
    Swap the new value into the tool or CI secret, run its usual job once, and read any missing_permissions in a 403.
  5. 5
    Delete the old token in the Dashboard once nothing uses it.

Which permissions each job needs

Built from the permission table in Supabase's Personal Access Tokens docs and its post of October 26, 2026, both checked on 2026-10-28. Pick the job first, then add only what it lists.

Permissions by job

Scope and permissions for a Supabase personal access token, by what the tool holding it does
JobScopePermissions
Coding agent that reads one project through the Supabase MCP serverThat projectNo access preset, then Database Read
Agent that also applies migrationsThat projectDatabase Read, Migrations Read-write
Agent that reads logs and advisor warningsThat projectLogs Read, Advisors Read
supabase link, locally or in CIThat projectProject Settings, API Keys and API Key Secrets, all Read
supabase db push in CIThat projectNot limited by the token: it connects with SUPABASE_DB_PASSWORD, so the database password is the limit

Which permission each Supabase MCP tool needs

Each tool checks before it runs and returns a tool error when the permission is missing. With Database Read, a SQL write through execute_sql returns a Postgres permission error rather than a 403.

Supabase MCP server tools and the token permission each one needs, from the Personal Access Tokens docs
MCP toolPermission
execute_sql, list_tables, list_extensions, generate_typescript_typesDatabase (Read)
list_migrationsMigrations (Read)
apply_migrationMigrations (Read-write)
get_logs, query_logsLogs (Read)
get_advisorsAdvisors (Read)
list_edge_functions, get_edge_functionEdge Functions (Read)
deploy_edge_functionEdge Functions (Read-write)
get_project, get_project_urlProject Settings (Read)
get_publishable_keysAPI Keys (Read)
list_projectsProjects (account-wide) (Read)
create_branch, merge_branchDevelopment or Production Branches (Read-write)
search_docsAlways available

Official docs behind this checklist

FAQ for builders before launch

Do my existing Supabase access tokens stop working?

No. Existing tokens keep working until they expire or you delete them; full-access ones show a Legacy badge, and Create legacy token is still there.

Can I change the scope of a token later?

No. Scope and permissions are fixed at creation, so create a replacement token and swap it in.

Why not use the Read-only preset for an agent?

Because Read-only includes secrets such as API keys. Supabase suggests starting from No access and turning on Database Read.