Skip to content
Next:[01] Missing grant

Scroll, or click the windowScroll, or tap the window

See why a row came back, or why it didn't.

Pick a scenario, choose who is asking, and read the grant and the policy that decided it.

Open the lab

Five labs

Each one is a real seeded query. Open it, switch who is asking, and read the trace.

What it runs on

Supabase PostgresThe database the lab runs against
Row level security and grantsThe two checks before a row comes back
Next.js on VercelThe site that calls the Data API

What the empty array will not tell you

The Data API can look quiet when a grant or a policy is the thing that stopped the row.

Grant

42501

A missing GRANT stops the query before any policy runs.

Policy

No rows

A missing SELECT policy returns an empty result and no error.

Rollback

Nothing sticks

Every run is a transaction that rolls back. The sandbox does not keep the edit.

The walkthrough for each scenario is in the tutorial.

Questions people ask

Still unsure? Read the tutorial or open an issue on GitHub.

It runs the scenario query as the role you pick, with JWT claims set, inside a transaction that always rolls back. The SQL you edit is parsed first. Only policy and grant statements on lab_sandbox are accepted.

A missing SELECT policy, with the grant in place and row level security on, returns no rows and no error. A missing GRANT returns sqlstate 42501 before any policy runs.

No. The list_tasks call uses Alice's client, so Postgres sees Alice's JWT. Her policies are the boundary. There is no separate agent role.

A run rolls back, so the sandbox does not keep it. A share link stores a snapshot of the scenario and the policy SQL. There is no account.

The publishable key only. The page never asks for the secret key. service_role on the switch is a role inside the sandbox, and the warning stays on screen.

Developers, and the agents they run, who need to see whether a row was stopped by a grant or filtered by a policy.

Open a scenario and run it.

Switch who is asking, edit the policy, and read the trace.

Open the lab