Supabase
Connect
Connect Supabase from the terminal. Pass --help for the flags Supabase accepts, plus --no-browser for headless environments.
polylane cloud connect --provider supabaseOAuth authorization, or a personal access token from your Supabase account settings.
Connect one Supabase organization through OAuth, or with a personal access token. Polylane encrypts the tokens before it stores them, and the agent never sees them.
- Click Connect with Supabase in Polylane.
- Sign in to Supabase, approve the access, and select the organization to connect.
- Supabase sends you back to Polylane, and the first sync starts.
Each connection covers one Supabase organization. To connect without a browser, use a personal access token as described under Personal access token.
Connect Supabase from a CI job or any other environment without a browser.
Connecting Supabase needs no browser: the same endpoint the console calls fits in a CI job. One authenticated POST creates the connection and starts the first sync.
Prerequisites
- A Polylane API key with the
cloud_accounts:writeandcloud_accounts:readscopes. See API keys and OAuth. - Your workspace ID, which starts with
ws_. Read it fromGET /v1/workspaceswith the same key. - A Supabase personal access token (starts with
sbp_) from Account → Access Tokens. The console's OAuth flow needs a browser; access tokens do not.
Create the connection
curl -X POST https://api.polylane.com/v1/cloud_accounts \
-H "x-api-key: $POLYLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "supabase",
"workspaceId": "ws_0abc123",
"token": "sbp_...",
"organization": "my-org-slug"
}'
One call connects one Supabase organization.
organizationmay be omitted only when the token reaches exactly one organization; otherwise the call fails with a400that lists the reachable organization slugs.
The response lists what was connected, with the first sync already running. Trimmed to the two fields the rest of the flow reads:
{
"success": true,
"result": {
"provider": "supabase",
"accounts": [{ "id": "acc_34gky74ibc92h8t2efn8csrh", "status": "syncing" }],
"failures": []
}
}
An account that is already connected lands in failures instead of accounts, so repeating the call never duplicates a connection.
Wait for the first sync
Poll each returned account by its id until status reaches ready (new on registration, syncing while resources stream in):
until [ "$(curl -s "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY" | jq -r '.result.status')" = "ready" ]; do
sleep 15
done
Give the loop a deadline so a failed connect fails the job instead of hanging it. Once the account is ready, its resources are in the topology and Polylane has started its first check.
Disconnect from the API
Deleting the connection stops every sync and check and deletes the credentials Polylane held. The call needs the cloud_accounts:delete scope:
curl -X DELETE "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY"
Then revoke the Supabase credential, as described under Disconnecting.
How it works
Resources in the context graph
Polylane maps each project of the organization, with its databases and read replicas, connection pooler, Auth, Storage, Realtime and REST services, edge functions, database branches, storage buckets, custom domains, secrets and network restrictions. For a secret, Polylane stores the name only. Polylane syncs every 15 minutes, and refreshes the OAuth token when it expires.
Anomaly detection
Each project, database, edge function and bundled service gets its own monitor. Polylane reads the service logs through the Supabase Management API and makes series from them: Postgres errors and log volume, edge function invocations, errors and execution time, Auth errors, REST 5xx errors and API gateway 5xx errors. Polylane compares each series with its usual level, and opens an issue when a change is a real problem.
What agents can do
During an investigation, agents read the service logs of a project: API gateway, edge functions, Postgres, Auth, Storage and Realtime. They read the live health of the database, REST, Auth, Storage and Realtime services, and the security and performance advisor findings of a project.
Agents never query your database. Polylane blocks the Management API endpoints that run SQL, return API keys, secret values or Auth settings, or create database credentials.
Agents can request other changes through the Management API, such as a change to an edge function or a branch. The account is read-only by default, and each change needs safety review and approval before it runs.
Personal access token
To connect with a long-lived token instead of OAuth:
- In Supabase, go to Account → Access Tokens.
- Click Generate new token and copy the token. It starts with
sbp_. - Paste the token into Polylane. If your account can open more than one organization, also give the slug of the organization to connect.
- Polylane checks the token and starts the first sync.
Troubleshooting
"Invalid access token" error
- Check that the token is not revoked in the Supabase account settings.
- A personal access token has the permissions of your account. Make sure your account can open the organization.
"Multiple Supabase organizations are reachable" error
- The credentials can open more than one organization, so name the organization to connect.
- With OAuth in the console, select the organization when Polylane asks after authorization.
- With the API, set the
organizationfield to the slug of the organization.
Missing resources
- The first sync can take a few minutes.
- Polylane lists paused projects, but syncs their edge functions, branches and buckets only while the project is active.
- Click Sync in the account header to sync again.
Disconnecting
Disconnecting does not change Supabase. Revoke the OAuth grant or the personal access token in your Supabase account settings.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Supabase's API lets it remove. The following stays until you remove it yourself:
- OAuth grant
polylane cloud disconnect <id>Tools
4Operations agents can perform in threads.
Supported resources
13Resource types that show up in your infrastructure graph.