Best model for proactive agents? Explore our benchmark
Get started

Deepnote identity

Give SQL blocks the email and user groups of the person running them, so your queries can filter what each app viewer sees.

The Deepnote identity integration gives SQL blocks the email and user groups of the person running them. Use it to filter an app by who is viewing it: you share one app with many people, and the conditions in your queries decide which rows each viewer gets, including viewers who don't have an account in your warehouse.

Connecting Deepnote identity

Deepnote identity is available on the Team and Enterprise plans, including the Team trial. Workspace admins create the integration. Project admins and editors can then connect it to a project:

  1. Open the Settings panel from the top-right of your project. Under Integrations, click +.
  2. Select Deepnote identity under Connect existing integration. If your workspace doesn't have it yet, a workspace admin selects it under Add new integration and creates it.
  3. In the Keep outputs private? dialog, click Connect and keep outputs private.

Connecting Deepnote identity turns on private outputs, so everyone, app viewers included, runs the project on their own machine and sees only their own results. The page reloads after you connect it.

Deepnote identity connects only to a project with private outputs, and not while the project's data app is public.

Filtering rows by viewer

With Deepnote identity connected, SQL blocks can use two functions:

FunctionReturns
deepnote_logged_in_user()The email of the person running the block
deepnote_user_groups()The names of their user groups in this workspace

Add a condition to your query. To show each manager only their own team:

SELECT *
FROM team_metrics
WHERE manager_email = {{ deepnote_logged_in_user() }}

To filter by group, pass the list with inclause:

SELECT *
FROM sales
WHERE region IN {{ deepnote_user_groups() | inclause }}

To combine both, for example to let an HR group see every row:

SELECT *
FROM team_metrics
WHERE manager_email = {{ deepnote_logged_in_user() }}
   OR 'HR-All' IN {{ deepnote_user_groups() | inclause }}

Deepnote reads both values from the person's signed-in session on every run, and passes them to the query as parameters.

  • Who a run belongs to. In the notebook, the values are yours, so you see your own rows while you build the app. An app run uses the viewer's, a scheduled run the schedule owner's, and a run through the Deepnote API or Deepnote MCP the caller's.
  • No groups. A person without groups gets no rows from a group condition, and the query doesn't fail.
  • User groups are available on the Enterprise plan. Groups that directory sync creates from your identity provider count too.
  • Matching your data. The condition matches on email or group name. If your data identifies people another way, such as employee IDs, map those to emails in your data.

Sharing the app

Apps in a project with Deepnote identity open only for signed-in people. Signed-out visitors are asked to sign in.

  • Data apps open only for people with access to the project, and can't be shared publicly while Deepnote identity is connected.
  • Legacy block apps keep their sharing setting, but signed-out people can't open them.

To give people the app and nothing else:

  1. Click Share and add the viewers, or their groups, with App user access. App users can use the app, but can't open the notebook.
  2. Set the project's workspace access to No access. Otherwise every workspace member can open the project, including new members who join through domain invites.
  3. For a legacy block app, set Sharing in App settings to Same as this project. With Anyone with a link or Public, any signed-in person with the link can open it. Its viewers can also read every block in the notebook, hidden blocks included, so keep data they shouldn't see out of it. See App sharing settings.

Anyone with Edit access to the project can change the conditions and run their own queries, so they can read every row the data integration can reach. Give Edit access only to the app's authors.

Disconnecting Deepnote identity

Disconnect the integration in the project's Integrations section and confirm. SQL blocks that use deepnote_logged_in_user() or deepnote_user_groups() stop working, and a legacy block app shared publicly or by link opens for signed-out people again. Private outputs stay on.

Limitations

  • Only Python kernels get the functions. In a project with an R kernel, SQL blocks that use them fail.