|
| 1 | +<div align="center"> |
| 2 | +<a href="https://voltagent.dev/"> |
| 3 | +<img width="1500" height="276" alt="voltagent" src="https://github.com/user-attachments/assets/d9ad69bd-b905-42a3-81af-99a0581348c0" /> |
| 4 | +</a> |
| 5 | + |
| 6 | +<h3 align="center"> |
| 7 | +AI Agent Engineering Platform |
| 8 | +</h3> |
| 9 | + |
| 10 | +<div align="center"> |
| 11 | + <a href="https://voltagent.dev">Home Page</a> | |
| 12 | + <a href="https://voltagent.dev/docs/">Documentation</a> | |
| 13 | + <a href="https://github.com/voltagent/voltagent/tree/main/examples">Examples</a> |
| 14 | +</div> |
| 15 | +</div> |
| 16 | + |
| 17 | +<br/> |
| 18 | + |
| 19 | +<div align="center"> |
| 20 | + |
| 21 | +[](https://github.com/voltagent/voltagent/issues) |
| 22 | +[](https://github.com/voltagent/voltagent/pulls) |
| 23 | +[](https://opensource.org/licenses/MIT) |
| 24 | +[](https://www.npmjs.com/package/@voltagent/sandbox-daytona) |
| 25 | +[](https://www.npmjs.com/package/@voltagent/sandbox-daytona) |
| 26 | +[](https://s.voltagent.dev/discord) |
| 27 | + |
| 28 | +</div> |
| 29 | + |
| 30 | +## @voltagent/sandbox-daytona |
| 31 | + |
| 32 | +A [Daytona](https://www.daytona.io/) sandbox provider for VoltAgent's Workspace sandbox feature. `DaytonaSandbox` implements VoltAgent's `WorkspaceSandbox` contract, letting agents execute shell commands inside an isolated Daytona sandbox instead of the local machine. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Install |
| 37 | + |
| 38 | +```bash |
| 39 | +npm install @voltagent/sandbox-daytona |
| 40 | +# or |
| 41 | +yarn add @voltagent/sandbox-daytona |
| 42 | +# or |
| 43 | +pnpm add @voltagent/sandbox-daytona |
| 44 | +``` |
| 45 | + |
| 46 | +## Usage |
| 47 | + |
| 48 | +```typescript |
| 49 | +import { Agent, Workspace } from "@voltagent/core"; |
| 50 | +import { DaytonaSandbox } from "@voltagent/sandbox-daytona"; |
| 51 | +import { openai } from "@ai-sdk/openai"; |
| 52 | + |
| 53 | +const sandbox = new DaytonaSandbox({ |
| 54 | + apiKey: process.env.DAYTONA_API_KEY, |
| 55 | +}); |
| 56 | + |
| 57 | +const agent = new Agent({ |
| 58 | + name: "my-agent", |
| 59 | + instructions: "A helpful assistant with sandboxed shell access", |
| 60 | + model: openai("gpt-4o-mini"), |
| 61 | + workspace: new Workspace({ sandbox }), |
| 62 | +}); |
| 63 | +``` |
| 64 | + |
| 65 | +## Configuration |
| 66 | + |
| 67 | +`DaytonaSandboxOptions`: |
| 68 | + |
| 69 | +| Option | Type | Default | Description | |
| 70 | +| ---------------------- | ------------------------- | ------------------------- | ------------------------------------------------------------------------------------ | |
| 71 | +| `apiKey` | `string` | — | Daytona API key | |
| 72 | +| `apiUrl` | `string` | — | Daytona API URL (for self-hosted/custom deployments) | |
| 73 | +| `target` | `string` | — | Daytona target region/runner | |
| 74 | +| `clientOptions` | `Record<string, unknown>` | — | Extra options passed to the underlying `Daytona` SDK client constructor | |
| 75 | +| `createParams` | `Record<string, unknown>` | — | Params passed to the Daytona SDK's `client.create()` when provisioning a sandbox | |
| 76 | +| `createTimeoutSeconds` | `number` | — | Timeout (seconds) for sandbox creation | |
| 77 | +| `env` | `Record<string, string>` | — | Default environment variables merged into every `execute()` call | |
| 78 | +| `cwd` | `string` | — | Default working directory for `execute()`; per-call `cwd` overrides it | |
| 79 | +| `defaultTimeoutMs` | `number` | `60000` | Default command timeout; per-call `timeoutMs` overrides it | |
| 80 | +| `maxOutputBytes` | `number` | `5 * 1024 * 1024` (5 MiB) | Max stdout/stderr bytes kept per stream before truncation | |
| 81 | +| `sandbox` | `DaytonaSandboxInstance` | — | Pre-resolved Daytona SDK sandbox instance to reuse instead of provisioning a new one | |
| 82 | + |
| 83 | +Use `getSandbox()` to access the underlying Daytona SDK sandbox instance directly for Daytona-specific APIs beyond `execute()`. |
| 84 | + |
| 85 | +## Documentation |
| 86 | + |
| 87 | +- [VoltAgent Documentation](https://voltagent.dev/docs/) |
| 88 | +- [Daytona Documentation](https://www.daytona.io/docs/) |
| 89 | + |
| 90 | +## License |
| 91 | + |
| 92 | +Licensed under the MIT License, Copyright © 2026-present VoltAgent. |
0 commit comments