Jupyter

Notebook security: why there is no Trust button

Why CoCalc notebooks have no Trust button: notebook output never runs in the CoCalc page, so there is nothing for a trust decision to protect.

Short answer

Classic Jupyter asks whether you trust a notebook because it renders a notebook's active output (HTML, JavaScript, widgets) inside the same web page that holds your login. Trusting a notebook lets its code use your login: it can read and change your files and projects, and do anything else you can do in the app.

CoCalc takes a different approach: no notebook content runs as code in the CoCalc page. Content that is only text and formatting (sanitized HTML, Markdown, LaTeX) is shown in the page as inert markup. Anything that runs (JavaScript, widgets, HTML that sanitizing would change) runs in a sandboxed frame that cannot reach your session, your files or other notebooks. With nothing left for a trust decision to protect, CoCalc has no Trust button. Leaving it out is a security decision, not the absence of one.

Why a trust switch is the wrong tool in a collaborative notebook

A trust switch asks a person to judge whether a notebook's outputs are safe. In CoCalc that judgment is rarely possible:

So instead of asking you, CoCalc isolates the content.

What CoCalc does instead

All of this is automatic:

Files and web apps

The same principle covers HTML files and web apps you run in a project, such as JupyterLab or your own web server:

What isolation does not do

A sandboxed output or widget is still code that runs in your browser:

As with any shared document, think twice before entering secrets into a form that appears inside a notebook output.

Questions

Can I turn the Trust button back on? There's nothing to turn on. Outputs render the same for every notebook, and the isolation doesn't depend on a choice.

What happens to the trust flag in my .ipynb files? It is kept in the file, so other Jupyter tools still see it, but CoCalc ignores it. cocalc project jupyter trust only edits that metadata.

Why does notebook JavaScript run without asking me first? Asking would not make you safer. Every script from a notebook, whether in a JavaScript output, inside HTML output (such as a Plotly figure) or in a widget, runs in its own sandboxed frame that cannot reach your session, files or the CoCalc page, no matter who wrote the notebook. A prompt would only add clicks.