# Daytona

> Secure, elastic sandboxes for running AI-generated code

- Category: Agents & Automation / Code Sandboxes & Isolation
- Language: TypeScript
- Licence: AGPL-3.0
- Repository: https://github.com/daytonaio/daytona
- Website: https://daytona.io
- Canonical page: https://ai-tldr.dev/tools/daytona/

## In short

Daytona is a secure and elastic infrastructure runtime for executing AI-generated code and running agent workflows. Its sandboxes are fully isolated, composable computers, each with its own kernel, filesystem, network stack, and allocated vCPU, RAM, and disk. It sits in the Code Sandboxes & Isolation category of the Agents & Automation tools and is open-source, written in TypeScript and licensed AGPL-3.0.

## Overview

Daytona is a secure and elastic infrastructure runtime for executing AI-generated code and running agent workflows. Its sandboxes are fully isolated, composable computers, each with its own kernel, filesystem, network stack, and allocated vCPU, RAM, and disk.

Sandboxes are the core of the platform. They start in under 90ms, run code in Python, TypeScript, and JavaScript, and are built on OCI/Docker compatibility for predictable environments. Stateful snapshots let agents keep their work across sessions, which makes Daytona a reliable foundation for long-running agent setups.

Agents and developers drive sandboxes programmatically through Daytona's SDKs, REST API, and CLI. You can manage the sandbox lifecycle, work with the filesystem, run processes and code, and configure the runtime with base images, packages, and tooling.

## What it does

- Isolated sandboxes that act as full composable computers, each with a dedicated kernel, filesystem, and network stack
- Fast startup, with sandboxes ready to run code in under 90ms
- Stateful snapshots that persist agent work and let operations continue across sessions
- Agent tools for process and code execution, file system operations, computer use, Git operations, and an MCP server
- Human-facing access through a dashboard, web terminal, SSH, VNC, and live preview URLs
- SDKs for Python, TypeScript, Ruby, Go, and Java, plus a REST API and a CLI

## Getting started

Create an account at app.daytona.io, generate an API key from the dashboard, then install an SDK and create your first sandbox. The Python example below runs a line of code inside a fresh sandbox.

1. Install the Python SDK

   Install the Daytona SDK with pip. SDKs are also available for TypeScript (npm install @daytona/sdk), Ruby, Go, and Java.

```bash
pip install daytona
```

2. Create a sandbox and run code

   Configure the client with your API key, create a sandbox, and run code inside it. The response contains the result of the executed code.

```python
from daytona import Daytona, DaytonaConfig

config = DaytonaConfig(api_key="YOUR_API_KEY")
daytona = Daytona(config)
sandbox = daytona.create()
response = sandbox.process.code_run('print("Hello World!")')
print(response.result)
```

3. Or use the CLI

   Prefer the command line? Create a sandbox directly with the Daytona CLI.

```bash
daytona create
```

## When to use it

- Running untrusted, AI-generated code from agents inside a fully isolated sandbox
- Giving autonomous agents a persistent workspace that keeps state across sessions via snapshots
- Building agent tooling that needs filesystem access, process execution, and computer use in a safe environment
- Self-hosting an open-source code execution stack with Docker Compose, or running it as a managed or hybrid service
