Skip to main content

Requirements

You also need a Declaw API key. Sign up at declaw.ai to use Declaw Cloud, or see the Deployment overview for enterprise on-prem options.

Install

This installs both the synchronous (Sandbox) and asynchronous (AsyncSandbox) clients, along with all security policy types and model classes.To install a specific version:
To add it to a pyproject.toml project:

Configuration

The SDK connects to a Declaw API server. You configure the connection either through environment variables (recommended) or programmatically via ConnectionConfig.

Environment variables

When these variables are set, you can call Sandbox.create() without any arguments:

Explicit ConnectionConfig

Pass a ConnectionConfig directly when you need multiple connections, non-standard ports, or explicit control over credentials:

Timeout

The timeout parameter on Sandbox.create() sets the maximum lifetime of the sandbox in seconds. If the sandbox is not killed before the timeout, the server destroys it automatically. The default is 300 seconds (5 minutes).
Always call sbx.kill() in a finally block. If your process crashes before calling kill(), the sandbox lives until its timeout expires and continues consuming server resources.

Verify your setup

After installing the SDK and setting your environment variables, run a quick smoke test:
If you see a Linux kernel string in the output, your SDK is connected and sandboxes are booting correctly.

Common errors


Next steps