Overview
Kortix agents execute code in isolated Daytona sandbox environments. Each project gets its own dedicated sandbox with a full Linux environment, enabling agents to run scripts, process data, interact with APIs, and build applications safely. The sandbox provides a complete development environment with pre-installed tools, persistent storage in/workspace, and automatic resource management.
Sandbox Architecture
From the source code (sandbox.py:1-145):
Sandbox Lifecycle
Sandboxes are created from snapshots with pre-configured services:State Management
Fromsandbox.py:34-66:
Sandbox Tool Base
All tools inherit fromSandboxToolsBase (tool_base.py:13-84):
Code Execution Methods
Command Execution
Agents can run shell commands using the Bash tool:Working Directory
All code executes with/workspace as the persistent working directory:
Session Management
Long-running services use supervisord:Real-World Examples
Example 1: Python Data Processing
Example 2: API Integration
Example 3: Build Process
Example 4: Multi-Language Processing
Pre-installed Tools
Sandboxes come with common development tools:- Languages: Python 3.11+, Node.js, Bash
- Package Managers: pip, npm, apt
- Version Control: git
- Utilities: curl, wget, jq, zip/unzip
- Process Management: supervisord
- Browser: Chromium (for browser automation)
File System Access
Fromtool_base.py:56-84:
Network Access
Sandboxes have full internet access:Resource Limits
Sandboxes have resource constraints:Auto-Stop and Archiving
Fromsandbox.py:115-117:
- Auto-Stop: Sandbox stops after 15 minutes of no activity to save resources
- Auto-Archive: Stopped sandboxes archive after 30 minutes
- Resume: Archived sandboxes automatically restart when accessed
Security Features
Isolation
- Each project gets dedicated sandbox
- No cross-project access
- Isolated network namespace
- Separate file systems
Environment Variables
Secure credential handling:Cleanup
Best Practices
1. Use Workspace Path
2. Handle Timeouts
3. Check Exit Codes
4. Install Dependencies Once
Port Exposure
Sandboxes can expose services:Monitoring and Debugging
Configuration
Sandbox execution requires:Limitations
- Command timeout: Default 120 seconds (configurable)
- No root access (runs as unprivileged user)
- No systemd (use supervisord instead)
- Limited GPU access
- Auto-stops after inactivity