Safeguard
Developer Tools•

How do you lock down the JupyterLab extension manager? Steps

Steps to restrict JupyterLab extensions: read only manager, allowlists or blocklists, locking plugins, and building approved extensions into the image.

Safeguard Security Team
3 min read

Lock down the JupyterLab extension manager by launching it read only or turning it off, using an allowlist of vetted extensions, locking the plugins you want fixed, and installing approved extensions in the image. Users then cannot add code to a shared server from the UI.

Why lock it

The JupyterLab docs warn that an installed extension can run arbitrary code on the server, kernel and browser. In a shared data science environment, an open extension manager lets any user add code to a server that holds shared credentials. See what an extension can reach.

The controls

ControlWhat it does
Disclaimer gateUsers must acknowledge a warning before installing; acknowledgment persists
Read only managerShows installed extensions, allows enable or disable, but no install or uninstall
Admin disablementThe extension manager and plugin manager can be turned off by an administrator
BlocklistBlocked extensions disappear from search and cannot be installed; installed ones are highlighted in red
AllowlistOnly vetted extensions show in search; precedence over a blocklist if both are set
DisableStops plugins running, though code still loads
LockAdministrators lock a plugin or an extension so users cannot toggle it

Steps

  1. Start read only. The docs name a launch option that sets the extension manager to read only. Put it in your server start command.
jupyter lab --LabApp.extension_manager=readonly
  1. Choose a list mode. For shared servers, an allowlist is the stronger choice, since only vetted extensions can be found. Only one mode is active, and the allowlist wins.
  2. Lock what must stay on. The docs describe administrator commands to lock a plugin or a whole extension.
jupyter labextension lock my-extension
  1. Uninstall, do not just disable. Disabling leaves code loaded.
  2. Bake approved extensions into the image with pinned versions, and give users no way to install at run time.
  3. Review quarterly. Remove unused extensions.

Limits to remember

The docs say the extension manager does not check compatibility with the current JupyterLab version. They also say listings are not a replacement for isolating the server environment from user controlled kernels in multi user deployments. The recommendation is to run the server in an environment users cannot modify.

Verify

Open the server as a normal user and try to install an extension. Confirm it fails, and that a locked plugin cannot be toggled.

Quick check

Allowlist or blocklist?

For shared servers an allowlist is tighter. If both are configured the allowlist takes precedence, per the docs.

Does read only mode stop kernel code from installing packages?

No. It governs the extension manager. Run the server where users cannot modify the environment.

Safeguard policies and dependency scanning can review the image that bundles your approved extensions. Try a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.