Skip to main content
DaytonaSandbox implements CloudSandbox; DaytonaSandboxToolkit exposes Agent tools. Import from @agentium/core/toolkits.

Run code

This example creates a real remote sandbox. Save as daytona.ts, then use npx tsx daytona.ts.
daytona.ts
Expect output containing 42. The adapter imports the SDK and creates its sandbox lazily. language is fixed at creation; use separate instances for Python and Node. baseURL maps to the SDK’s apiUrl. Optional workspace is a sandbox name, not an existing local directory.

Borrow a client, own the sandbox

You may supply a DaytonaSandboxClient through client. Your host retains responsibility for that client, while the adapter still owns and deletes sandboxes it creates. Without a supplied client, it manages the client it constructed. For a model-controlled workflow, use DaytonaSandboxToolkit.getTools() and close the toolkit after the Agent stops. A temporary remote session is not a durable workflow checkpoint.

Failure and cleanup

Close waits for bounded SDK work and deletes the owned sandbox once. A cancellation or timeout can leave remote execution uncertain, so reconcile effects before replaying. Nonzero exits and code errors remain failures; only file-not-found responses become null. See sandbox lifecycle and execution policy.