Skip to content

TypeScript-only types

Types of the TypeScript 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.

Field Type Description
arg_names string[]
args_sha256 string
decision string
reason string
server string
tool string
ts number
Source: sdk/typescript/src/mcp-approvals.ts:12

What Sandbox.listBackups lists: a bucket, the prefix the backups were created with (the whole bucket without one), and a page.

Field Type Description
bucket string
pageSize number Objects per page, 1 to 1000 (100 by default).
pageToken string next_page_token of the previous page.
prefix string
provider "s3" | "gcs" | "azure_blob"
secretName string
Source: sdk/typescript/src/sandbox-extras.ts:45

The bucket Sandbox.deleteBackup deletes from: the team’s bucket and the team secret holding its credentials.

Field Type Description
bucket string
provider "s3" | "gcs" | "azure_blob"
secretName string
Source: sdk/typescript/src/sandbox-extras.ts:38

One backup object in a bucket; object_name is what restoreBackup and deleteBackup take.

Field Type Description
modified_at string
object_name string
size_bytes number
Source: sdk/typescript/src/sandbox-extras.ts:54

One page of Sandbox.listBackups; next_page_token is absent on the last page.

Field Type Description
items BackupObject[]
next_page_token string
Source: sdk/typescript/src/sandbox-extras.ts:61

Where backup stores an archive: the team’s bucket and the team secret holding its credentials (never sent to the guest).

Field Type Description
bucket string
prefix string Key prefix; the object is named <prefix><backup_id>.tar.gz.
provider "s3" | "gcs" | "azure_blob"
secretName string
Source: sdk/typescript/src/sandbox-extras.ts:9
Field Type Description
concurrency number
gzip boolean
user string
Source: sdk/typescript/src/files-node.ts:23
Field Type Description
maxChars number
port number
server string
Source: sdk/typescript/src/browser.ts:53

Where a download’s bytes go: a path (written through <path>.part) or an object that takes chunks.

write(chunk: Uint8Array): void | Promise<void>
async
Parameter Type Default
chunk Uint8Array

Returns void \| Promise<void>

Source: sdk/typescript/src/transfer-node.ts:19 Source: sdk/typescript/src/transfer-node.ts:19
Field Type Description
answer Record<string, unknown>
seconds number
Source: sdk/typescript/src/tool-cache.ts:18 Source: sdk/typescript/src/charts.ts:49
Field Type Description
allowInsecureHttp boolean Required for the development lab’s HTTP LAN address; never needed for HTTPS.
apiKey string
bearerToken string
domain string
fetch typeof fetch
headers Record<string, string> Headers added to every REST call and sent as metadata on the data plane. They cannot replace the authentication headers.
httpVersion "1.1" | "2" The HTTP version of every REST call (and of the SDK’s own downloads): "1.1" or "2". Without it Node’s fetch decides (HTTP/1.1 unless the server negotiates more) and a browser negotiates as it always does. "2" fails a call to a server that does not speak HTTP/2 (h2 by ALPN, or h2c on http://); it is never sent as HTTP/1.1. Node only; not with fetch, 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.
logger Logger Gets one debug line per HTTP attempt: method, path, status and duration, never a header, query value, body or credential.
proxy string An HTTP proxy (http://[user:password@]host:port) for every REST call and the sandbox data-plane channel, in place of any proxy the environment names. Node only; not with fetch.
retry Partial<RetryPolicy> Retries and backoff for failed requests; see RetryPolicy.
timeoutMs number
Source: sdk/typescript/src/types.ts:162

pure declares that the output depends only on the files under the cache root, the command and env (no network, clock or randomness).

Field Type Description
budget number
cwd string
env Record<string, string>
pure boolean
timeoutSeconds number
Source: sdk/typescript/src/agent-tools.ts:45
Field Type Description
kind ConfigErrorKind
constructor(readonly kind: ConfigErrorKind, message: string)
Parameter Type Default
kind ConfigErrorKind
message string
Source: sdk/typescript/src/config.ts:16 Source: sdk/typescript/src/config.ts:15 Source: sdk/typescript/src/config.ts:13

A number, an ISO time on a datetime axis or a name on a categorical one.

Source: sdk/typescript/src/charts.ts:30

A file copyItems puts in the image: src in the build context (read from disk unless content is given) to dest.

Field Type Description
content string | Uint8Array
dest string
src string
Source: sdk/typescript/src/template.ts:49
Field Type Description
client SandboxClient
command string[]
env Record<string, string>
idempotencyKey string
keep RolloutKeep
metadata Record<string, string>
pollMs number
sandboxTimeoutSeconds number
script string
timeoutSeconds number
user string
verifier RolloutVerifier
wait boolean Wait for every branch to be scored (default true), at most waitTimeoutMs (30 min).
waitTimeoutMs number
workingDirectory string
Source: sdk/typescript/src/rollouts.ts:64
Field Type Description
autoPause boolean
bucketMounts Array<Record<string, unknown>>
cpuCount number
diskMb number
envs Record<string, string>
gitCredentials Array<{ host: string; secret_name: string; username?: string }> Git hosts the sandbox may use through the scoped credential proxy (INT-009).
gpu string
idempotencyKey string
lifecycle SandboxLifecycle Auto-stop, auto-archive and auto-delete timers, ephemeral or persistent. An auto-stop timer replaces timeoutSeconds.
mcpServers Array<Record<string, unknown>> MCP servers behind the gateway from the first start, e.g. { name: "gh", catalog_id: "github" } (getMcpCatalog).
memoryMb number
metadata Record<string, string>
name string A name to find the sandbox by (getByName); unique among the team’s live sandboxes.
network Record<string, unknown>
preferWaitSeconds number Ask the API to answer once the sandbox runs, for at most this many seconds, without the client waiting afterwards.
privateNetwork boolean Join 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).
profile string
secure boolean
snapshotId string
template string
timeoutSeconds number
volumeMounts Array<Record<string, unknown>>
wait boolean Resolve only once the sandbox is running and its envd answers.
Source: sdk/typescript/src/types.ts:121
Field Type Description
budget number
cache boolean
cwd string
language string
timeout number
Source: sdk/typescript/src/agent-tools.ts:56
Field Type Description
expectedSha256 string
gzip boolean Ask for the data gzipped over the wire; the bytes written are the plain ones.
resume boolean
user string The account the call runs as (the sandbox’s default user when omitted).
Source: sdk/typescript/src/transfer-node.ts:22

{path, old, new} replaces text that occurs once (all: true for every occurrence); {path, content} creates a file; {path, delete: true} removes one.

Field Type Description
all boolean
content string
delete boolean
new string
old string
overwrite boolean
path string
Source: sdk/typescript/src/agent-tools.ts:53

The inject object of an egress rule (updateEgress): replace a placeholder in headers of the HTTPS requests the rule allows with a team secret (secret_name) or a fresh identity token of the sandbox (identity_audience). Wire names, as the rest of a rule.

Field Type Description
headers string[]
identity_audience string
placeholder string
secret_name string
Source: sdk/typescript/src/secret.ts:40
Field Type Description
type string
value unknown
Source: sdk/typescript/src/errors.ts:30

A file or directory in a sandbox does not exist: a data-plane failure with envd’s ERROR_CODE_PATH_NOT_FOUND (the reference vendor’s FileNotFoundError). A NotFoundError; the same failure is a ProcessError.

Field Type Description
code string
details ErrorDetail[] | Record<string, string>
requestId string | undefined
retryAfterSeconds number | undefined
retryable boolean | undefined
statusCode number
Source: sdk/typescript/src/errors.ts:95

Every file call runs as user when named (an account of the sandbox, with its permissions); none means the sandbox’s default user.

Field Type Description
user string
Source: sdk/typescript/src/files-node.ts:17

What sandbox.fork gives each child (the API’s ForkSandboxRequest).

Field Type Description
idempotencyKey string
metadata Record<string, string> The children’s metadata; the parent’s unless given ({} for none).
timeoutSeconds number Each child’s lifetime in seconds (the API’s default is 300).
Source: sdk/typescript/src/sandbox-extras.ts:29

What Sandbox.fromSnapshot gives each sandbox it starts (the API’s ForkSnapshotRequest).

Field Type Description
client SandboxClient
count number How many sandboxes to start (1..1000); 1 by default.
metadata Record<string, string> Metadata (tags) of every started sandbox, so a cleanup that selects by metadata finds them.
timeoutSeconds number Each started sandbox’s lifetime in seconds (the API’s default is 300).
Source: sdk/typescript/src/sandbox-extras.ts:18 Source: sdk/typescript/src/git-client.ts:18 Source: sdk/typescript/src/errors.ts:28

Lifecycle timers in seconds (absent: off) and the flags fixed at create (API-018). Stopping pauses the sandbox.

Field Type Description
autoArchiveSeconds number How long a stopped sandbox stays on its host before it is archived to the object store.
autoDeleteSeconds number How long a stopped sandbox is kept before it is deleted; 0 deletes it as soon as it stops.
autoResume boolean Whether a request to the paused sandbox’s public URL wakes it. Absent means on, as before, except for a sandbox paused with mode filesystem, which only a connect or resume wakes; it cannot be true for one paused that way. In setLifecycle, the timers are replaced and onTimeout and autoResume are left as they are when absent.
autoStopSeconds number The deadline, renewed on every resume; reaching it stops the sandbox (deletes an ephemeral one).
onTimeout OnTimeout What reaching the deadline does. Absent means pause when autoPause, an auto-stop timer or persistent is set, otherwise kill.
Source: sdk/typescript/src/types.ts:56
Field Type Description
metadata Record<string, string>
pageSize number
pageToken string
state SandboxState | SandboxState[]
template string
Source: sdk/typescript/src/types.ts:154

Where the client logs one line per HTTP attempt (method, path, status, time); console is one.

debug(message: string): void
Parameter Type Default
message string
Source: sdk/typescript/src/client-options.ts:5 Source: sdk/typescript/src/client-options.ts:4
Field Type Description
character number
line number
op "completion" | "hover" | "definition" | "references" | "symbols" | "diagnostics"
wait number
Source: sdk/typescript/src/lsp.ts:33

An in-memory store, least recently used first out.

clear(): void
Source: sdk/typescript/src/tool-cache.ts:58
constructor(private readonly maxEntries = 4096)
Parameter Type Default
maxEntries number 4096
Source: sdk/typescript/src/tool-cache.ts:47
get(key: string, digest: string): CachedEntry | undefined
Parameter Type Default
key string
digest string

Returns CachedEntry \| undefined

Source: sdk/typescript/src/tool-cache.ts:51
known(key: string): string[]
Parameter Type Default
key string

Returns string[]

Source: sdk/typescript/src/tool-cache.ts:49
put(key: string, digest: string, entry: CachedEntry): void
Parameter Type Default
key string
digest string
entry CachedEntry
Source: sdk/typescript/src/tool-cache.ts:63 Source: sdk/typescript/src/tool-cache.ts:44

How a paused sandbox comes back: restore brings back its memory and processes, reboot boots cold from its disk.

Source: sdk/typescript/src/types.ts:53

What reaching the deadline does: pause keeps the sandbox (the same as autoPause), kill deletes it.

Source: sdk/typescript/src/types.ts:47

A sandbox’s OpenTelemetry export. headers undefined keeps the headers already set; enabled: false turns export off.

Field Type Description
enabled boolean
endpoint string
headers Record<string, string>
serviceName string
Source: sdk/typescript/src/sandbox-extras.ts:254

verify: a test or build command run after the patch applies; its failures are appended and data.verify holds its exit code.

Field Type Description
budget number
cache boolean
cwd string
diagnostics boolean
dryRun boolean
edits Edit[]
verify string
Source: sdk/typescript/src/agent-tools.ts:55

What a pause keeps: memory keeps memory and disk, filesystem only the disk (the sandbox reboots when it resumes).

Source: sdk/typescript/src/types.ts:50
Field Type Description
arg_names string[]
id string
requested number
server string
tool string
Source: sdk/typescript/src/mcp-approvals.ts:11

One event of a process’s stream: its start, a chunk of output, or its end.

Field Type Description
data { stdout?: Uint8Array; stderr?: Uint8Array; pty?: Uint8Array }
end { exitCode: number; signal: string; error?: string }
start { pid: number }
Source: sdk/typescript/src/process-node.ts:37
Field Type Description
args string[]
cols number
command string
cwd string
envs Record<string, string>
onData (chunk: string) => void
rows number
sandboxProfile "read-only" | "workspace-only" | "workspace-offline"
user string
Source: sdk/typescript/src/process-node.ts:166

read: gzip asks for the data compressed over the wire; the bytes returned are the plain ones.

Field Type Description
gzip boolean
user string
Source: sdk/typescript/src/files-node.ts:19
Field Type Description
budget number
cache boolean
cwd string
focus string[]
maxFiles number
mentions string[]
path string
Source: sdk/typescript/src/agent-tools.ts:51

How a failed request is repeated. maxAttempts counts the first try (1 means never retry). The wait before attempt n+1 is baseDelayMs * 2^(n-1) capped at maxDelayMs, 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 maxRetryAfterMs ends the retries at once rather than hanging the caller. A POST is repeated only because the client attaches an idempotency key that every attempt reuses.

Field Type Description
baseDelayMs number
jitter () => number
maxAttempts number
maxDelayMs number
maxRetryAfterMs number
sleep (ms: number) => Promise<void>
Source: sdk/typescript/src/retry.ts:14
Field Type Description
branches RolloutBranch[]
completed_at string
count number
created_at string
failure string
keep RolloutKeep
metadata Record<string, string>
rollout_id string
sandbox_id string
state "running" | "completed" | "failed" | "cancelled"
summary RolloutSummary
verifier string
Source: sdk/typescript/src/rollouts.ts:49
Field Type Description
k number
min_reward number
policy "passed" | "top_k" | "all" | "none"
Source: sdk/typescript/src/rollouts.ts:25

The rollout’s totals once branches are scored.

Field Type Description
best_sandbox_id string
finished number
kept number
max_reward number | null
mean_reward number | null
released number
Source: sdk/typescript/src/rollouts.ts:47
Field Type Description
command string[]
pattern string
script string
timeout_seconds number
type "exit_code" | "output_match" | "command" | "script"
Source: sdk/typescript/src/rollouts.ts:24 Source: sdk/typescript/src/code-interpreter.ts:18
Field Type Description
context Context | string
envs Record<string, string>
language RunCodeLanguage
onError (error: ExecutionError) => unknown
onResult (result: Result) => unknown
onStderr (message: OutputMessage) => unknown
onStdout (message: OutputMessage) => unknown
requestTimeoutMs number
signal AbortSignal
timeoutMs number
Source: sdk/typescript/src/code-interpreter.ts:98
Field Type Description
background boolean
cwd string
envs Record<string, string>
onStderr (chunk: string) => void
onStdout (chunk: string) => void
sandboxProfile "read-only" | "workspace-only" | "workspace-offline" Confine 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.
stdin string | Uint8Array Sent to a command once it starts. A foreground command then gets EOF; a background one keeps its stdin open ("" just opens it).
tag string
timeoutSeconds number
user string
Source: sdk/typescript/src/process-node.ts:150

A backup as backup returns it; restoreBackup takes it back.

Field Type Description
backup_id string
bucket string
created_at string
directory string
object_name string
provider "s3" | "gcs" | "azure_blob"
sandbox_id string
secret_name string
sha256 string
size_bytes number
Source: sdk/typescript/src/sandbox-extras.ts:67
Field Type Description
archivedAt string Read only.
autoArchiveSeconds number How long a stopped sandbox stays on its host before it is archived to the object store.
autoDeleteSeconds number How long a stopped sandbox is kept before it is deleted; 0 deletes it as soon as it stops.
autoResume boolean Whether a request to the paused sandbox’s public URL wakes it. Absent means on, as before, except for a sandbox paused with mode filesystem, which only a connect or resume wakes; it cannot be true for one paused that way. In setLifecycle, the timers are replaced and onTimeout and autoResume are left as they are when absent.
autoStopSeconds number The deadline, renewed on every resume; reaching it stops the sandbox (deletes an ephemeral one).
ephemeral boolean Deleted when it stops, leaving no snapshot.
onTimeout OnTimeout What reaching the deadline does. Absent means pause when autoPause, an auto-stop timer or persistent is set, otherwise kill.
persistent boolean Every stop snapshots memory and filesystem to the object store and releases the host.
stoppedAt string Read only.
Source: sdk/typescript/src/types.ts:73

Public lifecycle shapes from contracts/v2/openapi/components/sandbox.yaml.

Source: sdk/typescript/src/types.ts:5
Field Type Description
budget number
cache boolean
case "smart" | "sensitive" | "insensitive"
context number
cwd string
fixedStrings boolean
glob string | string[]
maxMatches number
maxPerFile number
path string
Source: sdk/typescript/src/agent-tools.ts:47

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 Record<string, string>
Source: sdk/typescript/src/secret.ts:29
Field Type Description
maxChars number
Source: sdk/typescript/src/browser.ts:54
Field Type Description
cpuCount number
diskMb number
memoryMb number
visibility "private" | "public"
Source: sdk/typescript/src/template.ts:78
Field Type Description
exclude string[] Directory names (at any depth) left out of the digest.
maxEntries number
root string The tree digested, relative to the call’s working directory.
store ToolCacheStore
tools readonly string[] The agent tools cached when a call does not say; a call passes cache: true or false itself.
Source: sdk/typescript/src/tool-cache.ts:32

Where answers live. The default keeps them in memory; a store backed by a file or a shared service lets processes share them.

clear(): Promise<void> | void
async

Drop every answer.

Returns Promise<void> \| void

Source: sdk/typescript/src/tool-cache.ts:26
get(key: string, digest: string): Promise<CachedEntry | undefined> | CachedEntry | undefined
async
Parameter Type Default
key string
digest string

Returns Promise<CachedEntry \| undefined> \| CachedEntry \| undefined

Source: sdk/typescript/src/tool-cache.ts:23
known(key: string): Promise<string[]> | string[]
async
Parameter Type Default
key string

Returns Promise<string[]> \| string[]

Source: sdk/typescript/src/tool-cache.ts:22
put(key: string, digest: string, entry: CachedEntry): Promise<void> | void
async
Parameter Type Default
key string
digest string
entry CachedEntry

Returns Promise<void> \| void

Source: sdk/typescript/src/tool-cache.ts:24 Source: sdk/typescript/src/tool-cache.ts:21

An agent tool call to export as a GenAI execute_tool span, with its run, tokens, cost and effects-ledger ids.

Field Type Description
attributes Record<string, string>
callId string
costUsd number
durationMs number
effectIds string[]
errorType string
inputTokens number
model string
name string
outputTokens number
runId string
startedAt Date | string
status "ok" | "error"
type "function" | "extension" | "datastore"
Source: sdk/typescript/src/sandbox-extras.ts:262

cache overrides whether the tools’ cache (see withCache) answers this call.

Field Type Description
budget number
cache boolean
cwd string
Source: sdk/typescript/src/agent-tools.ts:43
Field Type Description
group string
gzip boolean
metadata Record<string, string>
mode number
owner string
user string
verifyChecksum boolean
Source: sdk/typescript/src/files-node.ts:22

What an upload sends: bytes, a file path, or a function that gives the bytes again for each attempt.

Source: sdk/typescript/src/transfer-node.ts:21
Field Type Description
now number Seconds since the epoch. Default: the current time.
toleranceSeconds number How far the signed timestamp may be from now, in seconds. Default 300.
Source: sdk/typescript/src/webhook-signature.ts:6
Field Type Description
budget number
cache boolean
cwd string
lineChars number
lines number
start number
Source: sdk/typescript/src/agent-tools.ts:46

One entry of a volume directory.

Field Type Description
group string
kind "file" | "dir" | "symlink" | "other" The API’s kind of entry: “dir” for a directory (never “directory”).
mode number
modified_unix_ms number
name string
owner string The owning user and group, when the guest names them.
size number
Source: sdk/typescript/src/volume.ts:24

What the API says about a volume.

Field Type Description
attached_sandbox_id string
created_at string
name string
size_gb number
volume_id string
Source: sdk/typescript/src/volume.ts:15

A volumeMounts entry for Sandbox.create.

Field Type Description
path string
read_only boolean
subpath string
volume_id string
Source: sdk/typescript/src/volume.ts:37

write: metadata (at most 16 string pairs, keys 1..64 characters, values at most 256, no NUL) is stored on the file and replaces earlier pairs; gzip sends the data compressed.

Field Type Description
gzip boolean
metadata Record<string, string>
user string
Source: sdk/typescript/src/files-node.ts:21