Skip to main content
Every sandbox runs tilde sandbox connect, part of the regular tilde CLI. It connects the VM to Tilde, runs the agent’s sandbox operations, and gives processes in the VM access to the blueprint’s tools. In Tilde Cloud and Tilde Enterprise, it also wires the VM for GitHub egress.

tilde sandbox connect

Tilde starts this process when it launches or wakes a sandbox. You do not run it yourself, and your template needs no start command. On E2B, it logs to ~/.tilde/sandbox.log. The process:
  • Dials out to the gateway, so the VM needs no inbound ports.
  • Writes the blueprint’s environment variables to ~/.tilde/sandbox.env, which every shell sources. It refreshes them each time it connects.
  • In Cloud and Enterprise, sets the egress variables and points git at the gateway. It writes /etc/gitconfig for this, so it must run as root or be able to write that file.
  • Runs the agent’s sandbox operations, such as commands and file edits.
  • Serves the local API for the blueprint’s tools.
Commands start, and relative paths resolve, in the process’s working directory.

Local API

The process serves a JSON API on 127.0.0.1:4790, inside the VM only. Each call goes through the gateway to the tool’s source.
The path is /v1/tools/<slug>.<tool>. On failure, the response body is {"error": "<message>"}. Bypass any HTTP proxy for this address. Forward TILDE_SANDBOX_OPERATION as shown, so the call’s span nests under the sandbox.exec that ran it in the agent’s trace. A call made outside any command, for example from a background process, appears as its own span.
The API refuses requests from web pages. A browser open inside the sandbox cannot call your tools, even through DNS rebinding.

CLI commands

The same calls are available from the CLI, for scripts that would rather not use HTTP.
tilde sandbox call prints the tool’s output JSON, and forwards TILDE_SANDBOX_OPERATION itself. When the call fails, it prints the error to stderr and exits with status 1.

tilde sandbox credential CLOUDENTERPRISE

Git’s credential helper for the gateway’s egress route. tilde sandbox connect configures git to use it for the gateway’s URL only, so you never run it yourself. It answers git with the sandbox’s egress token, and answers nothing for any other host.

Limits

  • A tool call from the VM can send at most 64 KiB of input, and receive at most 1 MiB of output.
  • A tool call can take as long as the tool needs. From CLI 5.2.0, tilde sandbox call receives a heartbeat every few seconds while the tool runs, so a proxy’s idle timeout does not cut long calls. Use a Tilde sandbox image of 5.2.0 or later, or install that CLI in your own.
  • For command limits, see Sandbox tools.