# Sandbox questions Use a sandbox when an agent needs a real Linux environment to change code, run a test suite or inspect a development server. Use a private app when people need a stable service they can open again tomorrow. ## What is installed and how much capacity do I have? Run `smolcloud sandbox templates` under the identity that will do the work. Read `available`, `enabled`, `templates` and `limits`. An available runtime still needs space on a registered worker to start the machine. Pick a template with your language and tools. The owner can build a [custom template](sandbox-custom-templates.md) with dependencies installed in advance. For a realistic timing, run your project’s own install and test on the intended template. Measure the wait for `ready` separately from command execution. Run the same workload at your expected concurrency. The default environment allows one session, so two agents working on independent forks need a higher allowance and enough worker CPU, memory and disk. Worker capacity and the remaining worker lease both affect what can start. [Session limits](sandbox-sessions.md#limits). ## Can an agent install packages or open a dev server? New environments start with outbound access blocked. For npm or PyPI, ask the owner to select the package-registry profile, then start a new session under that policy. For private data, grant access to the particular app resource. Broad internet access does not grant database access. [Network choices](sandbox-environments.md#choose-internet-access) · [Database and bucket grants](sandbox-resources.md). Start an HTTP server listening on `0.0.0.0` inside the guest. Query its port through the authenticated session API. You can stream HTTP or forward WebSockets. Raw TCP tunnels, public per-port URLs, graphical desktops and VS Code Remote SSH are outside the current interface. For a human terminal, use the workspace’s **Terminal** or the Mac/Linux OpenSSH bridge. For a private URL people can bookmark, deploy the reviewed source as an app. [Preview a server](sandbox-workbench.md#reach-a-private-port) · [Build a team app](agent-to-app.md). ## What happens when I close my terminal? Disconnecting a command stream can leave the process running. To reconnect, inspect the current session and reconnect to its process before starting another copy. Your own shell’s working directory and variables belong to that shell. Files written to the guest are available to later commands in the session. A session can request a pause after 15 minutes without an active stream or an authorized file, process or port request. An agent busy inside the guest can still look idle to Smolcloud. If the pause succeeds, the agent’s process resumes when you resume the session. [Pause and resume](sandbox-sessions.md#pause-and-resume). ## How do I give an agent more time? A new sandbox has a five-minute limit by default. Before starting a longer session, ask the owner to allow the duration in the workspace sandbox limits and in the sandbox’s **Settings**. Then request it when you start the session. For one hour in an existing sandbox, use: ```sh smolcloud sandbox start ENV_ID --lifetime 3600 ``` Replace `ENV_ID` with the ID from `smolcloud sandbox list`. The released CLI requests five minutes when you omit `--lifetime`. Check the returned `deadlineAt` for the actual end time. The maximum is 12 hours, subject to worker availability and its remaining lease. Smolcloud also requests a pause shortly before the deadline. If the save fails, the session still ends at its deadline. Save important work as you go. The eight-model-step limit applies to an [app-backed agent job](sandbox-agent.md). A coding agent you run in a sandbox session uses its own model and tool settings. ## Which files survive? | What you do | What to expect | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Disconnect a terminal | The running guest retains its filesystem until its next lifecycle change. Reconnect before the deadline or check for a saved pause. | | Pause and resume | A successful pause keeps memory, processes and files on the same worker for up to 30 days. Existing network connections close. Get fresh resource and agent grants after resuming. | | Snapshot or fork | An ordinary snapshot is kept for seven days. A fork starts an independent session and keeps its source snapshot for one day. Changes to one guest’s local files do not propagate to the other. | | Stop the session | Its guest files are deleted. Download your patch or export the required output first. | | Lose the worker’s disk | Worker-local pauses and snapshots can be lost together. Keep important source and results on another machine or in independently backed-up storage. | Sharing a bucket or database connection between sessions means they can modify the same external records. A fork’s independent guest filesystem does not copy the app’s database or bucket. Reconnecting a resource requires a new explicit grant. [Where your work lives](workspace-architecture.md#recover-work). ## Why did my command, upload or session fail? | Symptom | What to check next | | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | No session starts | Run `smolcloud sandbox templates` and check the unavailable reason, workspace policy and worker allowance. If a start timed out, list sessions in that environment before issuing another start. | | The terminal disconnected during a command | Look up the running session, then list and reconnect to its process via the session RPC. Repeating a write or starting a second process may run it twice. | | A file transfer is too large | A file or request body is limited to 4 MiB. Total transfer is limited to 64 MiB per session. Use the app’s bucket interface for larger durable objects. The temporary sandbox resource broker has its own 256 KiB limit per object. | | A port does not return the app | Verify the process is running and listening on the requested guest port, then check the method, path and caller’s session access. There is no public preview URL to poll. | | A grant stopped working after a restore | Check the session is running and that its network policy allows the workspace HTTPS hostname. Reconnect the app resource. Pausing or taking a snapshot revoked its old grant. | | A pause or fork failed | Check the returned state, available worker disk and session slots. Download important files while the original is still running. A requested save is only usable once it succeeds. | For a support request, include the workspace address, environment or app ID, session or job ID, time and the last reported state. Include the operation and its error message. Remove tokens, request bodies containing secrets and the contents of guest credential files.