Skip to main content
Managed Agents run on cloud infrastructure, automatically provisioning compute resources and managing execution environments.

Quick Start

1

Basic Usage

2

With Configuration


How It Works

Security Model

Managed agents enforce sandbox-first security by default. Package installation requires a compute provider or explicit opt-out to prevent host system security risks.
  • Compute-bridged tools: execute_command, read_file, write_file, list_files automatically execute in sandbox when compute provider is attached
  • ManagedSandboxRequired: Exception raised when packages are specified without proper sandboxing (see Local Provider security details)

Compute Providers

Managed Agents support multiple compute providers for different use cases:

Local Provider

Run on local infrastructure with cloud management

Docker Compute

Containerized execution environments

E2B Cloud

Instant cloud sandboxes for code execution

Modal Compute

Serverless compute for scalable workloads

Daytona Workspaces

Development environments with persistent storage

Configuration Options

ManagedConfig API Reference

Complete configuration options for managed agents

Key Configuration Fields

Custom Backend Development

Build a custom managed backend by implementing the protocol:

Common Patterns

Environment with Packages

Session Persistence

Custom Tools


Best Practices

  • Local: Development and testing with existing infrastructure
  • Docker: Isolated, reproducible environments
  • E2B: Quick prototyping and sandboxed execution
  • Modal: High-performance, scalable workloads
  • Daytona: Development environments with persistence
Save session IDs for resuming conversations across process restarts. Use save_ids() and restore_ids() to maintain context between runs.
Use networking: {"type": "limited"} for untrusted code execution. Enable only required packages to minimize attack surface. The new host_packages_ok flag and ManagedSandboxRequired exception provide additional security controls - see Local Provider security details.
Track token usage with retrieve_session() — returns a unified schema (id, status, title, usage) on all backends. See the SessionInfo Schema page for details.

Agents

Core agent concepts and configuration

Tools

Available tools and custom tool creation