Documentation Index
Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sandbox is the central type. Every instance exposes .Commands, .Files, and .PTY sub-objects for interacting with the sandbox.
Package-level functions
declaw.Create()
Create a new sandbox and return a connected *Sandbox.
Template ID or alias to boot. Defaults to
"base" (Ubuntu 22.04).Sandbox lifetime in seconds. The sandbox is killed automatically when the
timeout expires unless
WithLifecycle sets OnTimeout to "pause".Arbitrary key-value pairs attached to the sandbox.
Environment variables injected into the sandbox at boot time.
Whether to enable the security proxy. When not specified, the server applies
its default. Set to
false only for trusted workloads where TLS interception
overhead is unacceptable.Fine-grained network configuration. See SandboxNetworkOpts below.
Full security policy including PII detection, injection defense,
transformations, audit, and env masking. See
SecurityPolicy.
Controls sandbox behaviour on timeout. See SandboxLifecycle.
(*Sandbox, error)
declaw.Connect()
Connect to an existing sandbox by ID without creating a new one.
The ID of the sandbox to connect to.
(*Sandbox, error)
declaw.ListSandboxes()
List sandboxes with optional filtering and pagination.
Filter by state (
StateLive, StatePaused, StateKilled).Maximum number of results to return.
Offset for pagination.
API key override for this call.
API URL override for this call.
(*SandboxPage, error)
declaw.KillSandbox()
Kill a sandbox by ID.
declaw.KillManySandboxes()
Kill multiple sandboxes in a single call.
([]KillResult, error)
declaw.Restore()
Restore a sandbox from a snapshot.
The sandbox to restore.
Specific snapshot to restore from. If omitted, the most recent snapshot is
used.
API key override for this call.
API URL override for this call.
(*Sandbox, error)
Instance methods
sbx.Kill()
Kill and destroy the sandbox.
error
sbx.IsRunning()
Check whether the sandbox is currently live.
(bool, error)
sbx.SetTimeout()
Update the sandbox timeout in seconds.
error
sbx.GetInfo()
Fetch current metadata and state.
(*SandboxInfo, error)
sbx.GetMetrics()
Retrieve CPU, memory, and disk usage metrics.
(*SandboxMetrics, error)
sbx.Pause()
Pause the sandbox, taking a snapshot of its state.
sbx.Resume()
Resume a previously paused sandbox.
sbx.CreateSnapshot()
Create a snapshot of the sandbox’s current state.
(*SnapshotInfo, error)
sbx.ListSnapshots()
List all snapshots for this sandbox.
([]SnapshotInfo, error)
sbx.DeleteSnapshot()
Delete a snapshot by ID.
sbx.GetHost()
Return the URL that reverse-proxies HTTP traffic to the given port inside the sandbox. Requires AllowPublicTraffic to be enabled in the sandbox’s network config (the default).
port int
Returns: string
sbx.GetMcpURL()
Return the URL for an MCP server listening on port 50005 inside the sandbox. Equivalent to sbx.GetHost(50005) + "/mcp".
string
Properties
| Property | Type | Description |
|---|---|---|
sbx.ID | string | Unique sandbox identifier |
sbx.Commands | *Commands | Commands sub-object |
sbx.Files | *Filesystem | Filesystem sub-object |
sbx.PTY | *PTY | PTY sub-object |
Data models
SandboxInfo
SandboxState
SandboxMetrics
SandboxLifecycle
SnapshotInfo
SandboxNetworkOpts
Lower-level network config used directly inCreate(WithNetwork(...)). For security-policy-level
network rules, see NetworkPolicy.