Skip to main content
A sandbox can be reached in two ways: through the SDK, which runs commands and reads or writes files, and through the sandbox URLs https://{port}-{sandboxId}.{domain}, which expose the services you start inside it. Each way has its own option and its own token. When secure is false, SDK operations accept requests without a token. Anyone who knows the sandbox ID can run commands and read or write files in the sandbox, and upload or download URLs are no longer signed, so anyone who obtains one can use it. When allowPublicTraffic is true, anyone who knows the sandbox ID can open the services running in it. Starting with SDK version v2.0.0, secure is turned on automatically whenever a sandbox is created. Sandbox URLs stay public unless you set allowPublicTraffic to false.

Private sandbox URLs

Set network.allowPublicTraffic to false to require a traffic access token on every request to the sandbox URLs. The API issues the token when the sandbox is created and the SDK exposes it on the sandbox object.
Clients send the token in the Sandbox-Traffic-Access-Token header. Requests without it, or with a wrong token, are rejected.
The traffic access token is a credential for the services in the sandbox. Hand it only to the clients that should reach them, such as a browser session or a backend that proxies requests, and keep it out of logs and public pages.
trafficAccessToken is undefined in JavaScript and traffic_access_token is None in Python when the sandbox URLs are public.

Switch an existing sandbox to secured access

secure and allowPublicTraffic are fixed while a sandbox is running. Starting with novita-sandbox 2.1.2, you can move an existing sandbox to secured access in two ways: pause the sandbox and pass the new values to connect(), or call reset() on a running sandbox. Both apply the new values when the sandbox starts again.
Switching to secured access with connect() is one-way. Once secure is true, connect() cannot set it back to false. Once allowPublicTraffic is false, connect() cannot set it back to true. If you need a sandbox without these protections, create a new one.

Pause and connect

connect() applies secure and allowPublicTraffic only when it resumes a paused sandbox. Pause the sandbox first. On a running sandbox, connect() keeps the current settings and the new values have no effect.
Pause the sandbox, then pass the new values to connect(). They take effect when the sandbox resumes.
On create(), allowPublicTraffic is nested under network. On connect() and reset(), it is a top-level option.

Reset

reset() clears the sandbox memory, applies the new values, and by default starts the sandbox again right away. Processes you started are gone, so restart any service after the reset. Pass resume: false to leave the sandbox paused instead.

Disable secured access

Disabling secure lets anyone who knows the sandbox ID run commands and read or write files in the sandbox. It is not recommended.
Last modified on November 11, 2026