class DaytonaSandboxDaytona Sandbox backend for deepagents.
Extends BaseSandbox to provide command execution, file operations, and
sandbox lifecycle management using Daytona's SDK.
import { DaytonaSandbox } from "@langchain/daytona";
// Create and initialize a sandbox
const sandbox = await DaytonaSandbox.create({
language: "typescript",
timeout: 300,
});
try {
// Execute commands
const result = await sandbox.execute("node --version");
console.log(result.output);
} finally {
// Always cleanup
await sandbox.close();
}
import { createDeepAgent } from "deepagents";
import { DaytonaSandbox } from "@langchain/daytona";
const sandbox = await DaytonaSandbox.create();
const agent = createDeepAgent({
model: new ChatAnthropic({ model: "claude-sonnet-4-20250514" }),
systemPrompt: "You are a coding assistant with sandbox access.",
backend: sandbox,
});