https://3000-{sandbox-id}.sandbox.superserve.ai to a process listening inside
your sandbox. Use an explicit preview policy and publish only the ports you
intend to expose.
Access policies
The sandbox’spreviewAccess / preview_access selects strict publication and
sets the default access for each newly published port:
Every published port stores its own
public or private access mode. Changing
the sandbox default does not rewrite existing ports, so public and private ports
can coexist in one sandbox.
legacy_public exists only for sandboxes created before the publication
migration. New sandboxes default to strict public when the field is omitted.
The compatibility mode cannot be selected through create or update APIs.
Choose the sandbox default
public when new ports should be internet-accessible by default. Use
private when new ports should require a credential by default. You can change
the default later with update; already-published ports keep their own mode:
Publish a port
Start the service, then publish its port. Omit the access option to use the sandbox default for a new port. An omitted option preserves the mode of an already-published port; pass an explicit mode to override just that port.getPreviewUrl / get_preview_url only constructs the hostname. It does not
publish the port or add credentials. Ports must be integers from 1024 through
65535; port 49983 is reserved for sandbox control traffic and cannot be
published.
List the current server-side publication state with listPreviewPorts() /
list_preview_ports(). The result includes the sandbox default and every
published port’s access, but never includes tokens.
Authenticate a private port
Private preview credentials are scoped to one published port. A token for port3000 cannot open port 8080 on the same sandbox.
Machine clients and reverse proxies
Mint a token and send it using the header name returned by the API:expiresInSeconds /
expires_in_seconds from 1 to 604800 seconds.
Browsers, iframes, and WebSockets
Browsers cannot attach a custom header to a navigation. Request a signed URL instead:Treat signed URLs as secrets until the initial redirect removes their query
token. Avoid logging them or placing them in analytics and referrer data.
Revoke access
Rotate a port to invalidate all of its existing header tokens, signed links, and browser cookies without affecting other ports:404 for an unpublished port before revealing sandbox status or checking a
credential.
MCP and console
The console’s Preview panel uses the same server-backed published-port list. It mints a signed browser URL for each private port without displaying the credential; public sibling ports keep clean URLs. The MCPsandbox_preview_url tool publishes the requested port. It returns a
clean URL when that port is public and a one-hour signed URL by default when it
is private. Re-publishing without an access override preserves an existing
port’s mode. Set expires_in_seconds to choose another private-link lifetime.