Safeguard
Security Guides•

Does Voila hide your notebook code when you share a dashboard?

Voila hides code cells by default, but it still runs the notebook on a live kernel for each visitor. Hidden code is not the same as a safe app.

Safeguard Security Team
3 min read

Voila hides code cells by default, so visitors see outputs and widgets. That is presentation, not protection. It still runs the notebook on a real Jupyter kernel for each visitor, and widgets can reach that kernel. Treat a Voila dashboard as a live application with your account's access.

How Voila works

The Voila documentation describes the steps. Voila runs the code in the notebook and collects the outputs. It converts the notebook and outputs to HTML, with code cells hidden by default. It serves the page as a Tornado application or through the Jupyter server. When users load the page, the widgets on it have access to the underlying Jupyter kernel.

It can run as a standalone application or as a server extension. When it serves a directory, the documentation says a new kernel is created for each notebook you click.

What hidden code does and does not mean

ClaimReality
Visitors cannot read the sourceHidden in the page by default, but treat it as visible, since the notebook files are what you deployed
Visitors cannot run codeThey interact with widgets, which talk to a kernel, so the notebook's own logic decides what they can trigger
The dashboard is read onlyOnly if you wrote it that way
A directory listing is harmlessServing a directory lists every notebook in it

Risks to design out

  1. Serving a whole folder exposes notebooks you did not mean to publish, including scratch work.
  2. Credentials in cells or in the environment are available to the kernel the notebook runs in.
  3. Input widgets that feed text into file paths, shell commands or SQL turn visitors into authors of those operations.
  4. One kernel per visit means resource use grows with traffic, which can become a denial of service issue.
  5. Dependencies in the dashboard environment are exposed to the internet, so their vulnerabilities matter more than for a private notebook.

A pre-publish routine

  1. Copy only the notebooks you intend to share into a clean directory.
  2. Remove or rotate any credentials, and give the app a minimal account.
  3. Review every widget that takes free text and validate its use.
  4. Build the environment from a pinned lock file and scan it.
  5. Put the app behind authentication if the data is not public, and monitor kernel counts.

For a related look at another sharing tool see /resources/blog/what-does-gradio-share-true-expose-from-your-notebook.

Try it yourself

Click through it at your own pace, or open it full screen. Look at the list of packages a dashboard environment would carry, since each one is exposed once the app is public.

Safeguard's SBOM and dependency scanning can inventory that environment. Run the free scan at gold.safeguard.sh/scan.

Quick check

Does Voila run my notebook once or per visitor?

The documentation says a new kernel is created for each notebook you click when serving a directory, and widgets use the underlying kernel.

Are hidden code cells a security control?

No. They change what is shown, not what runs or who can reach the kernel.

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.