Skip to content

Go-only types

Types of the Go SDK with no Python counterpart of the same name: mostly option objects and result records. The methods that take them are on the area pages.

APIError preserves the API’s structured error code and request identifier.

Field Type Description
Code string
Message string
RequestID string
Details any
Retryable *bool
RetryAfterSeconds *int RetryAfterSeconds is the server’s hint in the error body; RetryAfter is the Retry-After header, when there was one.
RetryAfterMS *int RetryAfterMS is the exact wait in milliseconds on a rate-limited create; a retry waits this long (plus jitter) rather than whole seconds.
RetryAfter time.Duration
Status int
Attempts int Attempts is how many times the request was sent before this error was returned.
Path string Path is the request path the error answers (without the query), which tells a missing sandbox from a missing volume or secret.
func (e *APIError) Error() string

Returns string

Source: sdk/go/client.go:109
func (e *APIError) Is(target error) bool

Is makes errors.Is(err, svm.ErrRateLimited) and its siblings work on an *APIError. A 404 on /v2/sandboxes/{id} (or one of the sandboxOnlyActions), /v2/volumes/{id} or /v2/secrets/{name} is also ErrSandboxNotFound, ErrVolumeNotFound or ErrSecretNotFound; HTTP 507 is ErrNotEnoughSpace and ErrQuotaExceeded; SANDBOX_NOT_RUNNING is ErrSandboxNotRunning and TEMPLATE_NOT_READY ErrTemplate (both also ErrPrecondition); SANDBOX_UNREACHABLE is ErrSandboxUnreachable and GUEST_UNRESPONSIVE ErrGuestUnresponsive (both also ErrUnavailable) and FILE_UPLOAD_FAILED is ErrFileUpload (also ErrTransfer and ErrInternal), each by its code alone, whatever the path.

Parameter Type Default
target error

Returns bool

Raises APIError, ErrFileUpload, ErrGuestUnresponsive, ErrInternal, ErrNotEnoughSpace, ErrPrecondition, ErrQuotaExceeded, ErrRateLimited, ErrSandboxNotFound, ErrSandboxNotRunning, ErrSandboxUnreachable, ErrSecretNotFound, ErrTemplate, ErrTransfer, ErrUnavailable, ErrVolumeNotFound

Source: sdk/go/retry.go:247
func (e *APIError) Limit() string

Limit and Max name the plan limit of a QUOTA_EXCEEDED error, when the server says.

Returns string

Source: sdk/go/retry.go:325
func (e *APIError) Max() string

Returns string

Source: sdk/go/retry.go:326 Source: sdk/go/client.go:89

AuditRecord is one gateway decision, written before the call ran.

Field Type Description
TS float64
Server string
Tool string
Decision string
Reason string
ArgNames []string
ArgsSHA256 string
Source: sdk/go/guest_mcp.go:26

Axes are the labels and units of a 2D chart’s axes (a label “Time (s)” is Label “Time”, Unit “s”).

Field Type Description
XLabel string
YLabel string
XUnit string
YUnit string
Source: sdk/go/charts.go:43

BackupListOptions is what ListBackups lists: a bucket, the Prefix the backups were created with (every object under it; the whole bucket when empty), and a page: PageToken is the previous page’s NextPageToken, PageSize 1 to 1000 (100 when zero).

Field Type Description
Provider string
Bucket string
SecretName string
Prefix string
PageToken string
PageSize int
Source: sdk/go/volume.go:342

BackupLocation is the bucket DeleteBackup deletes from: the team’s bucket (“s3”, “gcs” or “azure_blob”) and the team secret holding its credentials.

Field Type Description
Provider string
Bucket string
SecretName string
Source: sdk/go/volume.go:336

BackupObject is one backup object in a bucket; ObjectName is what RestoreBackup (as SandboxBackup.ObjectName) and DeleteBackup take.

Field Type Description
ObjectName string
SizeBytes int64
ModifiedAt string
Source: sdk/go/volume.go:349

BackupPage is one page of ListBackups; NextPageToken is empty on the last page.

Field Type Description
Items []BackupObject
NextPageToken string
Source: sdk/go/volume.go:356

BackupTarget is where Backup stores an archive: the team’s bucket (“s3”, “gcs” or “azure_blob”) and the team secret holding its credentials, which never enter the sandbox. Prefix is a folder of the bucket: the object is named <Prefix>/<backup_id>.tar.gz (the server puts the one “/” between them, so “nightly” and “nightly/” name the same object), or <backup_id>.tar.gz without a prefix. The SDK sends Prefix as given and adds no “/” of its own.

Field Type Description
Provider string
Bucket string
SecretName string
Prefix string
Source: sdk/go/volume.go:293

BrowserCallOptions are the per-call options: MaxChars caps the text returned (0: the browser’s default), TimeoutSeconds bounds the call.

Field Type Description
MaxChars int
TimeoutSeconds int
Source: sdk/go/guest_browser.go:82

BrowserOptions configure a Browser; zero values are the defaults.

Field Type Description
Server string
Port int
MaxChars int
Source: sdk/go/guest_browser.go:75

BrowserUseOptions choose the model browser-use drives: Provider “openai” (default, model gpt-4o) or “anthropic”. The provider’s API key is read from the sandbox’s environment (OPENAI_API_KEY, ANTHROPIC_API_KEY). TimeoutSeconds bounds Use (600 when zero).

Field Type Description
Model string
Provider string
TimeoutSeconds uint32
Source: sdk/go/guest_browser.go:417

BrowserWait says what WaitFor waits for: Text to appear, Gone to disappear, Seconds to pass. Give at least one.

Field Type Description
Text string
Gone string
Seconds float64
Source: sdk/go/guest_browser.go:373

BuildOptions control one build.

Field Type Description
Wait bool Wait follows the build to its end (or OnLog being set does).
OnLog func(line BuildLogLine) DefaultBuildLogger(nil) prints each line
Timeout time.Duration default 40 minutes
IdempotencyKey string
Tags []string up to 16, pointed at the build once it is ready
Source: sdk/go/template.go:206

CacheRecord is one outcome Record counts: a hit (SavedSeconds is the time it saved), a miss, an answer stored, or a call that could not be cached.

Field Type Description
Hit bool
Miss bool
Stored bool
Uncacheable bool
SavedSeconds float64
Source: sdk/go/tool_cache.go:341

ClientOptions configures the control-plane REST transport.

Field Type Description
Domain string
APIKey string
BearerToken string BearerToken authenticates with a session token instead of an API key; give one or the other.
HTTPClient *http.Client
Timeout time.Duration
AllowInsecureHTTP bool
Retry *RetryPolicy Retry controls how failed requests are repeated; nil means DefaultRetry.
Proxy string Proxy is an HTTP proxy (http://[user:password@]host:port) for every REST call and the sandbox data-plane connection, in place of any proxy the environment names. Not with HTTPClient: set the proxy on that client’s transport instead.
HTTPVersion string HTTPVersion is the HTTP version of every REST call (and of the SDK’s own downloads): “1.1” or “2”. Empty keeps the default, which is HTTP/1.1 with the SDK’s own transport. “2” never falls back: over TLS the server must pick h2 by ALPN and over http:// the connection is HTTP/2 with prior knowledge (h2c), so a server that does not speak it fails the call. Not with HTTPClient (set Protocols on that client’s transport instead), and “2” not with Proxy (the proxy tunnel is HTTP/1.1). The sandbox data plane is gRPC and always HTTP/2, so this option does not change it.
Headers map[string]string Headers are added to every REST call and sent as metadata on the data plane. They cannot replace the authentication headers.
Logger *slog.Logger Logger gets one Debug line per HTTP attempt: method, path, status and duration, never a header, query value, body or credential.
func (o ClientOptions) Format(state fmt.State, verb rune)
Parameter Type Default
state fmt.State
verb rune
Source: sdk/go/client.go:54
func (o ClientOptions) String() string

Returns string

Source: sdk/go/client.go:46 Source: sdk/go/client.go:21

ConfigError means the credentials could not be found or the config file cannot be trusted.

Field Type Description
Kind ConfigErrorKind
Message string
func (e *ConfigError) Error() string

Returns string

Source: sdk/go/config.go:36 Source: sdk/go/config.go:31

ConfigErrorKind says why credentials could not be found.

Source: sdk/go/config.go:19

ConnectSandboxOptions optionally extends the sandbox lifetime while connecting and says how a paused sandbox comes back.

Field Type Description
TimeoutSeconds int
OnResume string OnResume is OnResumeRestore (the default: memory and processes come back) or OnResumeReboot (only the disk is kept and the guest boots cold from it; a sandbox paused with PauseModeFilesystem always reboots). It is ignored for a running sandbox.
Wait *bool Wait is for ConnectSandbox and ConnectSandboxByName (Resume always waits). The API answers a connect once the resume is accepted; nil or true follows the sandbox until it has left resuming/starting, as Resume does, so commands and files work at once (a sandbox that was running is returned without another request). A pointer to false returns at once.
Source: sdk/go/sandbox.go:214

CopyItem is a file CopyItems puts in the image: Src in the build context (read from disk when Content is nil) to Dest.

Field Type Description
Src string
Dest string
Content []byte
Source: sdk/go/template_helpers.go:330

CreateSandboxOptions follows CreateSandboxRequest in the v2 OpenAPI contract.

Field Type Description
Template string
TimeoutSeconds int
Metadata map[string]string
Envs map[string]string
CPUCount int
MemoryMB int
DiskMB int
Network map[string]any
Secure *bool
AutoPause bool
Profile string
GPU string
VolumeMounts []map[string]any
BucketMounts []map[string]any
SnapshotID string
GitCredentials []map[string]string GitCredentials names the Git hosts the sandbox may reach through the scoped credential proxy (INT-009).
MCPServers []map[string]any MCPServers run behind the gateway from the first start, e.g. {“name”: “gh”, “catalog_id”: “github”} (GetMcpCatalog).
Name string Name is a name to find the sandbox by (SandboxByName), unique among the team’s live sandboxes.
Lifecycle *SandboxLifecycle Lifecycle sets timers and ephemeral or persistent. An auto-stop timer replaces TimeoutSeconds.
PrivateNetwork bool PrivateNetwork joins the team’s private network: a private address and the name <name>.sandbox.internal, reachable by the team’s other private-network sandboxes on the same host (VMM-031).
IdempotencyKey string
Wait bool Wait asks the API to answer once the sandbox is running (Prefer: wait=8); false returns as soon as the start is accepted.
Source: sdk/go/sandbox.go:181

DesktopHost is what the desktop client needs from a sandbox: run a command, read and remove a file, and mint a traffic URL.

ReadFile(ctx context.Context, path string, limit int64) ([]byte, error)
Parameter Type Default
ctx context.Context
path string
limit int64

Returns ([]byte, error)

Source: sdk/go/desktop.go:23
RemoveFile(ctx context.Context, path string) error
Parameter Type Default
ctx context.Context
path string

Returns error

Source: sdk/go/desktop.go:24
Run(ctx context.Context, command string, options RunOptions) (ProcessResult, error)
Parameter Type Default
ctx context.Context
command string
options RunOptions

Returns (ProcessResult, error)

Source: sdk/go/desktop.go:22
TrafficURL(ctx context.Context, port int, path string) (string, error)
Parameter Type Default
ctx context.Context
port int
path string

Returns (string, error)

Source: sdk/go/desktop.go:25 Source: sdk/go/desktop.go:21

DownloadOptions: ExpectedSHA256 is checked when set; Resume continues a partial “<path>.part” left by an earlier DownloadFile. User is the guest account the transfer runs as (“” is the sandbox default). Gzip asks for the data compressed over the wire; the bytes written, the size and the checksum are the plain ones.

Field Type Description
ExpectedSHA256 string
Resume bool
User string
Gzip bool
Source: sdk/go/transfer.go:71

EgressHeaderMatch matches a request header: any value when Equals is empty.

Field Type Description
Name string
Equals string
Source: sdk/go/sandbox_extras.go:68

EgressInject is the inject object of an EgressRule: SecretName or IdentityAudience (exactly one), the Headers to rewrite and an optional Placeholder (the default is what SecretFill or IamToken.Placeholder return).

Field Type Description
SecretName string
IdentityAudience string
Headers []string
Placeholder string
Source: sdk/go/secret_inject.go:24

EgressProxySettings is a customer egress proxy setting: Mode “proxy” with a URL, “none”, or “inherit” (the team’s).

Field Type Description
Mode string
URL string
Username string
Password string
IdentityAudience string
Source: sdk/go/sandbox_extras.go:229

EgressRule is one layer-7 egress rule: Action and one of Domain and CIDR, narrowed by Port, Methods, Path and Headers.

Field Type Description
Action string
Domain string
CIDR string
Port int
Methods []string
Path string
Headers []EgressHeaderMatch
Inject *EgressInject Inject, on an allow rule, swaps a placeholder for a team secret or an identity token in the HTTPS requests the rule allows (SecretInject, IamToken.Inject). It works only while the rules are enabled and needs a current server.
Source: sdk/go/sandbox_extras.go:54

FileOption changes one file call: the account it runs as, the metadata a write stores, gzip on the wire. An option a call has no use for (metadata on a read) is ignored.

Source: sdk/go/files.go:38

FileURL is a signed URL that uploads or downloads one file with a plain HTTP request until ExpiresAt.

Field Type Description
URL string
ExpiresAt string
Source: sdk/go/files.go:128

FileURLOptions are the optional parts of a signed URL: the guest user the transfer runs as, and how long the URL is valid (1..3600 seconds, 300 when zero).

Field Type Description
User string
ExpiresInSeconds int
Source: sdk/go/files.go:135

ForkOptions are the optional parts of a fork (Fork) or a start from a snapshot (SandboxesFromSnapshot): the children’s metadata and lifetime in seconds (the API’s default, 300, when 0).

Field Type Description
Metadata map[string]string
TimeoutSeconds int
IdempotencyKey string
Source: sdk/go/sandbox_extras.go:344

GitCloneOptions configures Clone.

Field Type Description
Branch string
Depth int
AllowedHosts map[string]bool
Source: sdk/go/git_client.go:134

GitCommitOptions configures Commit.

Field Type Description
AuthorName string
AuthorEmail string
AllowEmpty bool
Source: sdk/go/git_client.go:305

GitEgressSource is a runner that can read the sandbox’s layer-7 egress rules; a sandbox’s Git() client is one (Sandbox.Egress).

Egress(ctx context.Context) (map[string]any, error)
Parameter Type Default
ctx context.Context

Returns (map[string]any, error)

Source: sdk/go/git.go:23 Source: sdk/go/git.go:22

GitPullOptions configures Pull; with no Remote the branch’s upstream is used.

Field Type Description
Remote string
Branch string
Rebase bool
Source: sdk/go/git_client.go:454

GitPushOptions configures Push; Remote defaults to origin and Branch to the current one. Force uses –force-with-lease.

Field Type Description
Remote string
Branch string
SetUpstream bool
Force bool
Source: sdk/go/git_client.go:422

GitRunner is the part of a sandbox’s process client Git uses.

Run(ctx context.Context, command string, options RunOptions) (ProcessResult, error)
Parameter Type Default
ctx context.Context
command string
options RunOptions

Returns (ProcessResult, error)

Source: sdk/go/git.go:18 Source: sdk/go/git.go:17

GitStatusInfo is a parsed git status; Branch is empty when HEAD is detached.

Field Type Description
Branch string
Upstream string
Ahead int
Behind int
Files []GitFileStatus
func (s GitStatusInfo) Clean() bool

Clean reports no changed or untracked files.

Returns bool

Source: sdk/go/git_status.go:56 Source: sdk/go/git_status.go:49

GuestSandbox is what the guest helpers (sessions, terminals, language servers, MCP approvals) need from a sandbox: run a command and write a file. *Sandbox satisfies it through GuestTools.

Run(ctx context.Context, command string, options RunOptions) (ProcessResult, error)
Parameter Type Default
ctx context.Context
command string
options RunOptions

Returns (ProcessResult, error)

Source: sdk/go/guest_tools.go:14
WriteFile(ctx context.Context, path string, content []byte, mode uint32) error
Parameter Type Default
ctx context.Context
path string
content []byte
mode uint32

Returns error

Source: sdk/go/guest_tools.go:15 Source: sdk/go/guest_tools.go:13

LSPAnswer is the server’s answer to one op. Complete is false on a diagnostics answer when the server published nothing for the file within the wait (nil for the other ops).

Field Type Description
Op string
Result json.RawMessage
Complete *bool
Source: sdk/go/guest_lsp.go:85

LSPOp is one question: completion, hover, definition, references, symbols or diagnostics. Lines and characters are zero-based.

Field Type Description
Op string
Line int
Character int
Wait int
Source: sdk/go/guest_lsp.go:54

LSPServer says how to start the language server for a language.

Field Type Description
Command []string
LanguageID string
InitOptions map[string]any
Source: sdk/go/guest_lsp.go:18

LifecycleTimers are a sandbox’s lifecycle timers in seconds; nil is off. Stopping a sandbox pauses it.

Field Type Description
AutoStopSeconds *int AutoStopSeconds is the deadline, renewed on every resume; reaching it stops the sandbox (deletes an ephemeral one).
AutoArchiveSeconds *int AutoArchiveSeconds is how long a stopped sandbox stays on its host before it is archived to the object store.
AutoDeleteSeconds *int AutoDeleteSeconds is how long a stopped sandbox is kept before it is deleted; 0 deletes it as soon as it stops.
OnTimeout string OnTimeout is what reaching the deadline does: OnTimeoutPause keeps the sandbox (the same as AutoPause), OnTimeoutKill deletes it. Empty means pause when AutoPause, an auto-stop timer or Persistent is set, otherwise kill. SetLifecycle leaves it as it is when empty.
AutoResume *bool AutoResume is whether a request to the paused sandbox’s public URL wakes it: nil is on, as before, except for a sandbox paused with PauseModeFilesystem, which only Connect or Resume wakes (it cannot be true for one paused that way). SetLifecycle leaves it as it is when nil; use Bool to set it.
Source: sdk/go/sandbox.go:96

ListSandboxOptions filters and paginates sandbox records.

Field Type Description
State []SandboxState
Metadata map[string]string
Template string
PageSize int
PageToken string
Source: sdk/go/sandbox.go:235

ListSecretsOptions pick a page of Secrets.List.

Field Type Description
PageSize int the server’s default when 0
PageToken string
Source: sdk/go/secret.go:43

ListTemplatesOptions pick a page of Templates.List.

Field Type Description
PageSize int the server’s default when 0
PageToken string
Visibility string Visibility narrows the list to “private” (the team’s own), “public”, “system” (the platform catalog every team can launch) or “all”; empty is “all”.
Source: sdk/go/template.go:257

MCPApprovals writes decisions as root into a root-owned directory, so the agent inside the sandbox cannot approve itself (INT-010).

func (a *MCPApprovals) Audit(ctx context.Context, limit int) ([]AuditRecord, error)

Audit returns the newest records, oldest first.

Parameter Type Default
ctx context.Context
limit int

Returns ([]AuditRecord, error)

Source: sdk/go/guest_mcp.go:88
func (a *MCPApprovals) Decide(ctx context.Context, id string, allow bool) error

Decide allows or denies one waiting call.

Parameter Type Default
ctx context.Context
id string
allow bool

Returns error

Source: sdk/go/guest_mcp.go:75
func (a *MCPApprovals) Pending(ctx context.Context) ([]PendingApproval, error)

Pending lists the calls waiting for a decision.

Parameter Type Default
ctx context.Context

Returns ([]PendingApproval, error)

Source: sdk/go/guest_mcp.go:66 Source: sdk/go/guest_mcp.go:37

McpServerOptions describe one MCP server of a template (AddMcpServer): a catalog server (CatalogID) or a custom one (Command, with Args), exactly one. The rest are as the contract’s McpServerConfig has them.

Field Type Description
CatalogID string
Command string
Args []string
EnvSecretNames []string
Secrets map[string]string
Env map[string]string
ToolRules map[string]any
Source: sdk/go/template_helpers.go:456

OtelExportOptions is a sandbox’s OpenTelemetry export. Nil Headers keeps the headers already set; Disabled turns export off for the sandbox.

Field Type Description
Endpoint string
Headers map[string]string
ServiceName string
Disabled bool
Source: sdk/go/sandbox_extras.go:121

PTYOptions configure an interactive terminal.

Field Type Description
Command string
Args []string
CWD string
Envs map[string]string
User string
SandboxProfile string SandboxProfile is as for RunOptions.
Cols uint32
Rows uint32
Source: sdk/go/pty.go:44

PauseSandboxOptions says how a sandbox is paused.

Field Type Description
Wait bool Wait asks for a response after the pause is durable.
Mode string Mode is PauseModeMemory (the default: memory and disk are kept) or PauseModeFilesystem (only the disk is kept, in the object store; the sandbox reboots when it resumes, and a request to its URL does not wake it).
Source: sdk/go/sandbox.go:226

PendingApproval is a tool call the MCP gateway holds for a decision (never the argument values).

Field Type Description
ID string
Server string
Tool string
ArgNames []string
Requested float64
Source: sdk/go/guest_mcp.go:17

PrivateAddress is where a sandbox is on its team’s private network: Hostname is <name>.sandbox.internal.

Field Type Description
Hostname string
Address string
Source: sdk/go/sandbox.go:90

RetryPolicy says how a failed request is repeated. MaxAttempts counts the first try (1 means never retry). The wait before attempt n+1 is BaseDelay*2^(n-1) capped at MaxDelay, scaled by Jitter() (a number in [0.5, 1] so concurrent clients do not retry in step); the server’s own Retry-After replaces it, and one longer than MaxRetryAfter ends the retries at once instead of hanging the caller. A POST is repeated only because the client attaches an idempotency key that every attempt reuses.

Field Type Description
MaxAttempts int
BaseDelay time.Duration
MaxDelay time.Duration
MaxRetryAfter time.Duration
Jitter func() float64 Jitter returns a factor in [0.5, 1]; nil means random.
Sleep func(ctx context.Context, d time.Duration) error Sleep waits for d or until ctx ends; nil means a timer.
Source: sdk/go/retry.go:21

RolloutInfo is a rollout as the API reports it.

Field Type Description
RolloutID string
SandboxID string
State string
Count int
Keep *RolloutKeep
Verifier string
Metadata map[string]string
Failure string
CreatedAt string
CompletedAt string
Summary RolloutSummary
Branches []RolloutBranch
func (r RolloutInfo) Done() bool

Done reports a rollout that is no longer running.

Returns bool

Source: sdk/go/rollouts.go:144 Source: sdk/go/rollouts.go:128

RolloutKeep picks the branches that stay running.

Field Type Description
Policy string
K int
MinReward *float64
Source: sdk/go/rollouts.go:60

RolloutOptions is what each branch runs. Exactly one of Command and Script is set; Command is an argument vector whose argv[0] is an absolute path (/usr/bin/python3, not python3): it is not looked up on PATH.

Field Type Description
Command []string
Script string
Verifier *RolloutVerifier
Keep *RolloutKeep
Env map[string]string
WorkingDirectory string
User string
TimeoutSeconds int
SandboxTimeoutSeconds int
Metadata map[string]string
IdempotencyKey string
NoWait bool NoWait returns as soon as the branches exist, with the rollout running; otherwise the call reads it every Poll (1 s) until every branch is scored, for as long as ctx allows.
Poll time.Duration
Source: sdk/go/rollouts.go:80

RolloutSummary is what the branches add up to.

Field Type Description
Finished int
Kept int
Released int
MeanReward *float64
MaxReward *float64
BestSandboxID string
Source: sdk/go/rollouts.go:118

RolloutVerifier scores a branch once its command ends.

Field Type Description
Type string
Pattern string
Command []string
Script string
TimeoutSeconds int
Source: sdk/go/rollouts.go:22

Rollouts creates and reads rollouts (Client.Rollouts). The generated Client.CreateRollout and GetRollout are the same calls returning raw records.

func (rs *Rollouts) Create(ctx context.Context, baseID string, n int, opts RolloutOptions) (*Rollout, error)

Create fans the sandbox baseID out into n branches and runs opts in each; see Sandbox.Rollout.

Parameter Type Default
ctx context.Context
baseID string
n int
opts RolloutOptions

Returns (*Rollout, error)

Source: sdk/go/rollouts.go:176
func (rs *Rollouts) Get(ctx context.Context, rolloutID string) (*Rollout, error)

Get reads one rollout with its branches.

Parameter Type Default
ctx context.Context
rolloutID string

Returns (*Rollout, error)

Source: sdk/go/rollouts.go:215 Source: sdk/go/rollouts.go:170

RunCodeOptions are the optional parts of RunCode. Language (“python” by default) and Context (a context ID) are exclusive: without Context the cell runs in the sandbox’s default context for Language, which keeps its variables between calls; Envs runs it in a scratch context with those variables instead, removed afterwards. Timeout bounds the cell (60 s by default). OnStdout and OnStderr see each line while the cell runs, as it arrives; OnResult and OnError see each result and the error once the cell has finished, before RunCode returns.

Field Type Description
Language string
Context string
Envs map[string]string
Timeout time.Duration
OnStdout func(OutputMessage)
OnStderr func(OutputMessage)
OnResult func(Result)
OnError func(ExecutionError)
Source: sdk/go/interpreter.go:408

RunOptions configures a shell command inside a sandbox.

Field Type Description
Background bool
CWD string
Envs map[string]string
User string
SandboxProfile string SandboxProfile confines the command and its children with Landlock inside the microVM: “read-only”, “workspace-only” (read-write in CWD, read-only system paths) or “workspace-offline” (that, and no TCP connect or listen). A kernel that cannot enforce it refuses the command; it never runs unconfined.
TimeoutSeconds uint32
Tag string
Stdin []byte Stdin, when non-nil, is sent to a command once it starts. A foreground command then gets EOF; a background one keeps its stdin open (an empty non-nil slice just opens it).
OnStdout func([]byte)
OnStderr func([]byte)
Source: sdk/go/process.go:127

SandboxBackup is a backup as Backup returns it; RestoreBackup takes it back.

Field Type Description
BackupID string
SandboxID string
Directory string
Provider string
Bucket string
ObjectName string
SecretName string
SizeBytes int64
SHA256 string
CreatedAt string
Source: sdk/go/volume.go:298

SandboxFailure is why a sandbox failed, or why the host refused its last resume, in words a tenant may read.

Field Type Description
Code string
Message string
Source: sdk/go/sandbox.go:57

SandboxLifecycle is a sandbox’s lifecycle policy: its timers and the flags fixed at create.

Field Type Description
Ephemeral *bool Ephemeral sandboxes are deleted when they stop, leaving no snapshot.
Persistent *bool Persistent sandboxes snapshot memory and filesystem to the object store on every stop and release the host.
StoppedAt string StoppedAt and ArchivedAt are read only.
ArchivedAt string
Source: sdk/go/sandbox.go:135

SandboxState is the lifecycle state returned by the control plane.

Source: sdk/go/sandbox.go:16

SearchOptions configures Search.

Field Type Description
Path string
Glob []string
FixedStrings bool
Case string
Context int
MaxMatches int
MaxPerFile int
Source: sdk/go/agent_tools.go:260

SecretOptions are what Create and Update say about a secret besides its value: a description and up to 16 metadata pairs.

Field Type Description
Description string
Metadata map[string]string
Source: sdk/go/secret.go:31

SecretPage is one page of secrets; NextPageToken is empty on the last one.

Field Type Description
Items []SecretInfo
NextPageToken string
Source: sdk/go/secret.go:37

StreamEventsOptions filters the lifecycle event stream; LastEventID resumes after an event the caller already has.

Field Type Description
SandboxID string
Type string
LastEventID string
Source: sdk/go/rest_stream.go:24

TemplateOptions are a template’s identity and default size.

Field Type Description
Visibility string private (default) or public
CPUCount int
MemoryMB int
DiskMB int
Source: sdk/go/template.go:26

TemplatePage is one page of templates; NextPageToken is empty on the last one.

Field Type Description
Items []TemplateInfo
NextPageToken string
Source: sdk/go/template.go:251

Templates lists and deletes the team’s templates and manages their tags (Client.Templates). The generated Client.ListTemplates, GetTemplate, AssignTemplateTag, RemoveTemplateTag and DeleteTemplate are the same calls returning raw maps.

func (ts *Templates) AssignTags(ctx context.Context, nameOrID string, tags []string, buildID string) ([]string, error)

AssignTags points tags at buildID (the latest ready build when empty) and returns the template’s tags afterwards.

Parameter Type Default
ctx context.Context
nameOrID string
tags []string
buildID string

Returns ([]string, error)

Source: sdk/go/template.go:338
func (ts *Templates) Delete(ctx context.Context, templateID string) error

Delete deletes the template with this id.

Parameter Type Default
ctx context.Context
templateID string

Returns error

Source: sdk/go/template.go:371
func (ts *Templates) Exists(ctx context.Context, nameOrID string) (bool, error)

Exists reports whether a template of this name or id is visible to the caller.

Parameter Type Default
ctx context.Context
nameOrID string

Returns (bool, error)

Source: sdk/go/template.go:320
func (ts *Templates) GetTags(ctx context.Context, nameOrID string) ([]string, error)

GetTags returns the tags of a template (by name or id).

Parameter Type Default
ctx context.Context
nameOrID string

Returns ([]string, error)

Source: sdk/go/template.go:329
func (ts *Templates) List(ctx context.Context, options ListTemplatesOptions) (TemplatePage, error)

List returns one page of the caller’s templates (GET /v2/templates); pass its NextPageToken as PageToken for the next page.

Parameter Type Default
ctx context.Context
options ListTemplatesOptions

Returns (TemplatePage, error)

Source: sdk/go/template.go:291
func (ts *Templates) RemoveTags(ctx context.Context, nameOrID string, tags []string) error

RemoveTags removes tags from a template; the builds stay.

Parameter Type Default
ctx context.Context
nameOrID string
tags []string

Returns error

Source: sdk/go/template.go:358 Source: sdk/go/template.go:285

ToolCacheOptions configures NewToolCache; zero values mean the defaults.

Field Type Description
Tools []string
MaxEntries int
Directory string Directory lets processes share the answers; empty keeps them in memory.
Root string Root is the tree digested, relative to the call’s working directory (default “.”).
Exclude []string
Source: sdk/go/tool_cache.go:46

ToolCall configures Run; zero values mean the defaults. Cache nil follows the cache’s own tool list.

Field Type Description
Budget int
Cwd string
TimeoutSeconds int
Cache *bool
Source: sdk/go/agent_tools.go:107

ToolCallReport is an agent tool call to export as a GenAI execute_tool span. Nil numbers are not reported.

Field Type Description
Name string
StartedAt time.Time
Duration time.Duration
RunID string
CallID string
Failed bool
ErrorType string
Model string
Type string function (default), extension or datastore
InputTokens *int64
OutputTokens *int64
CostUSD *float64
EffectIDs []string
Attributes map[string]string
Source: sdk/go/sandbox_extras.go:145

UnknownChart is a chart of a type this SDK does not know; Elements are as they came.

Field Type Description
Type ChartType
Title string
Elements []any
func (c UnknownChart) ChartType() ChartType

Returns ChartType

Source: sdk/go/charts.go:150 Source: sdk/go/charts.go:144

UploadOptions: Mode is the file’s permission bits (default 0644); VerifyChecksum reads the file back to compare its SHA-256.

Field Type Description
Mode uint32
Owner string Owner and Group (names or numbers) are applied to the new file; empty keeps the sandbox user’s.
Group string Owner and Group (names or numbers) are applied to the new file; empty keeps the sandbox user’s.
VerifyChecksum bool
User string User is the guest account the transfer runs as (“” is the sandbox default). Metadata (at most 16 pairs, keys 1..64 characters, values at most 256, no NUL) is stored with the file and replaces any earlier pairs. Gzip sends the data compressed; Size and SHA256 count the plain bytes.
Metadata map[string]string
Gzip bool
Source: sdk/go/transfer.go:79

VolumeEntry is one file or directory on a volume.

Field Type Description
Name string
Kind string Kind is the API’s value: “file”, “dir”, “symlink” or “other”.
Size int64
Mode uint32
ModifiedUnixMS int64
Owner string Owner and Group name the owning account when the guest reports it.
Group string
Source: sdk/go/volume.go:109

VolumeInfo is a volume as the API reports it.

Field Type Description
VolumeID string
Name string
SizeGB int
AttachedSandboxID string
CreatedAt string
Source: sdk/go/volume.go:25

VolumeMetadataUpdate is what Volume.UpdateMetadata changes: Mode (the permission bits, setuid, setgid and sticky included, as in os.FileMode’s low bits: 0o644) when not nil, Owner and Group (names or numeric ids) when not empty. At least one is required.

Field Type Description
Mode *uint32
Owner string
Group string
Source: sdk/go/volume.go:123

Volumes creates, finds and deletes the team’s volumes (Client.Volumes). The generated Client.CreateVolume, GetVolume, ListVolumes and DeleteVolume are the same calls returning raw records.

func (vs *Volumes) Create(ctx context.Context, name string, sizeGB int, idempotencyKey string) (*Volume, error)

Create makes a volume of sizeGB gigabytes.

Parameter Type Default
ctx context.Context
name string
sizeGB int
idempotencyKey string

Returns (*Volume, error)

Source: sdk/go/volume.go:56
func (vs *Volumes) Delete(ctx context.Context, id string) error

Delete deletes the volume with this id.

Parameter Type Default
ctx context.Context
id string

Returns error

Source: sdk/go/volume.go:101
func (vs *Volumes) Get(ctx context.Context, id string) (*Volume, error)

Get fetches one volume.

Parameter Type Default
ctx context.Context
id string

Returns (*Volume, error)

Source: sdk/go/volume.go:65
func (vs *Volumes) Handle(id string) *Volume

Handle is the volume with this id without fetching it (its Name and Info are empty but the id).

Parameter Type Default
id string

Returns *Volume

Source: sdk/go/volume.go:74
func (vs *Volumes) List(ctx context.Context) ([]*Volume, error)

List returns every live volume of the team, following pages.

Parameter Type Default
ctx context.Context

Returns ([]*Volume, error)

Source: sdk/go/volume.go:79 Source: sdk/go/volume.go:50

WatchOption changes how WatchDir reads events.

Source: sdk/go/files.go:380

WebhookSecrets is one hex secret, or several during a rotation.

Source: sdk/go/webhook_signature.go:30

WebhookVerifyOptions are the optional parts of VerifyWebhookSignature: Tolerance (WebhookToleranceSeconds when zero) and Now (the current time when zero).

Field Type Description
Tolerance time.Duration
Now time.Time
Source: sdk/go/webhook_signature.go:24

WindowsDesktop controls a Windows sandbox’s interactive session. Sandbox.Desktop uses it on a Windows sandbox.

func (d *WindowsDesktop) ApplicationWindows(ctx context.Context, application string) ([]string, error)

ApplicationWindows lists the windows of an application.

Parameter Type Default
ctx context.Context
application string

Returns ([]string, error)

Source: sdk/go/desktop_win.go:209
func (d *WindowsDesktop) CurrentWindowID(ctx context.Context) (string, error)

CurrentWindowID returns the active window’s id.

Parameter Type Default
ctx context.Context

Returns (string, error)

Source: sdk/go/desktop_win.go:202
func (d *WindowsDesktop) CursorPosition(ctx context.Context) (int, int, error)

CursorPosition returns the pointer’s position.

Parameter Type Default
ctx context.Context

Returns (int, int, error)

Source: sdk/go/desktop_win.go:188
func (d *WindowsDesktop) DoubleClick(ctx context.Context, at ...int) error
Parameter Type Default
ctx context.Context
at ...int optional

Returns error

Source: sdk/go/desktop_win.go:112
func (d *WindowsDesktop) Drag(ctx context.Context, start, end [2]int) error

Drag presses at start, moves to end and releases.

Parameter Type Default
ctx context.Context
start [2]int
end [2]int

Returns error

Source: sdk/go/desktop_win.go:126
func (d *WindowsDesktop) HasApp(ctx context.Context, application string) (bool, error)

HasApp says whether the Windows image has a program named application on PATH or a Start-menu shortcut of that name. Launch returns before the app runs, so check with this first when the image is not known.

Parameter Type Default
ctx context.Context
application string

Returns (bool, error)

Source: sdk/go/desktop_win.go:264
func (d *WindowsDesktop) Launch(ctx context.Context, application, uri string) error

Launch starts an application; uri may be empty.

Parameter Type Default
ctx context.Context
application string
uri string

Returns error

Source: sdk/go/desktop_win.go:164
func (d *WindowsDesktop) LeftClick(ctx context.Context, at ...int) error

LeftClick, RightClick, MiddleClick and DoubleClick click at x, y (pass both) or where the pointer is (pass none).

Parameter Type Default
ctx context.Context
at ...int optional

Returns error

Source: sdk/go/desktop_win.go:103
func (d *WindowsDesktop) MiddleClick(ctx context.Context, at ...int) error
Parameter Type Default
ctx context.Context
at ...int optional

Returns error

Source: sdk/go/desktop_win.go:109
func (d *WindowsDesktop) MousePress(ctx context.Context, button string) error

MousePress and MouseRelease hold and release left, middle or right.

Parameter Type Default
ctx context.Context
button string

Returns error

Source: sdk/go/desktop_win.go:117
func (d *WindowsDesktop) MouseRelease(ctx context.Context, button string) error
Parameter Type Default
ctx context.Context
button string

Returns error

Source: sdk/go/desktop_win.go:121
func (d *WindowsDesktop) MoveMouse(ctx context.Context, x, y int) error

MoveMouse moves the pointer.

Parameter Type Default
ctx context.Context
x int
y int

Returns error

Source: sdk/go/desktop_win.go:87
func (d *WindowsDesktop) Open(ctx context.Context, fileOrURL string) error

Open opens a file or URL with the default application.

Parameter Type Default
ctx context.Context
fileOrURL string

Returns error

Source: sdk/go/desktop_win.go:173
func (d *WindowsDesktop) Press(ctx context.Context, key string) error

Press presses a key or combination.

Parameter Type Default
ctx context.Context
key string

Returns error

Source: sdk/go/desktop_win.go:159
func (d *WindowsDesktop) RightClick(ctx context.Context, at ...int) error
Parameter Type Default
ctx context.Context
at ...int optional

Returns error

Source: sdk/go/desktop_win.go:106
func (d *WindowsDesktop) ScreenSize(ctx context.Context) (int, int, error)

ScreenSize returns the screen’s width and height.

Parameter Type Default
ctx context.Context

Returns (int, int, error)

Source: sdk/go/desktop_win.go:195
func (d *WindowsDesktop) Screenshot(ctx context.Context) ([]byte, error)

Screenshot returns one PNG of the screen. Until the session draws it can be one flat colour; WaitUntilReady waits for a painted frame.

Parameter Type Default
ctx context.Context

Returns ([]byte, error)

Source: sdk/go/desktop_win.go:229
func (d *WindowsDesktop) Scroll(ctx context.Context, amount int) error

Scroll scrolls by amount clicks.

Parameter Type Default
ctx context.Context
amount int

Returns error

Source: sdk/go/desktop_win.go:141
func (d *WindowsDesktop) StreamURL(ctx context.Context) (string, error)

StreamURL mints a one-time noVNC browser entry URL; the helper answers once the stream is up.

Parameter Type Default
ctx context.Context

Returns (string, error)

Source: sdk/go/desktop_win.go:248
func (d *WindowsDesktop) WaitUntilReady(ctx context.Context, timeout time.Duration) (time.Duration, error)

WaitUntilReady waits until the helper in the interactive session answers (the session is drawn once it does) and returns how long it took. timeout 0 is 60 seconds; running out of it is an error.

Parameter Type Default
ctx context.Context
timeout time.Duration

Returns (time.Duration, error)

Source: sdk/go/desktop_win.go:281
func (d *WindowsDesktop) WindowTitle(ctx context.Context, windowID string) (string, error)

WindowTitle returns a window’s title.

Parameter Type Default
ctx context.Context
windowID string

Returns (string, error)

Source: sdk/go/desktop_win.go:222
func (d *WindowsDesktop) Write(ctx context.Context, text string) error

Write types text (75 ms between keystrokes).

Parameter Type Default
ctx context.Context
text string

Returns error

Source: sdk/go/desktop_win.go:146
func (d *WindowsDesktop) WriteWith(ctx context.Context, text string, chunkSize, delayMs int) error

WriteWith is Write with the chunk size (1 to 256) and the delay between keystrokes given exactly.

Parameter Type Default
ctx context.Context
text string
chunkSize int
delayMs int

Returns error

Source: sdk/go/desktop_win.go:151 Source: sdk/go/desktop_win.go:24