Skip to main content

Docker sandbox skill for haiku.skills

Project description

haiku-skills-sandbox

Docker sandbox skill for haiku.skills. Executes Python code in an isolated Docker container with pre-installed data science packages and filesystem access.

Prerequisites

Build the Docker image (once):

docker build -t haiku-skills-sandbox:latest skills/sandbox/haiku_skills_sandbox/

Usage

Via entry point discovery

HAIKU_SKILLS_SANDBOX_WORKSPACE=/path/to/data haiku-skills chat

Programmatic

from pathlib import Path
from haiku_skills_sandbox import create_skill

skill = create_skill(
    workspace=Path("/path/to/data"),  # mounted at /workspace in the container
    idle_timeout=1800,                # stop container after 30min idle (default: 1h)
    image="my-custom-image:latest",   # custom Docker image (default: haiku-skills-sandbox:latest)
)

Configuration

Parameter Env var Default Description
workspace HAIKU_SKILLS_SANDBOX_WORKSPACE None Host directory mounted at /workspace in the container
idle_timeout HAIKU_SKILLS_SANDBOX_IDLE_TIMEOUT 3600 Seconds of inactivity before the container is stopped
image HAIKU_SKILLS_SANDBOX_IMAGE haiku-skills-sandbox:latest Docker image to use for the container

Priority: create_skill() argument > environment variable > default.

Container lifecycle

  • Containers start lazily on the first tool call
  • Session binding via SandboxState.session_id — the same AG-UI thread reuses the same container
  • Idle containers are stopped automatically (checked on each tool call)
  • All containers are stopped on process exit via atexit
  • When workspace is mounted, files persist on the host — restarting a container loses nothing

Pre-installed packages

The haiku-skills-sandbox:latest image includes: pandas, numpy, scipy, matplotlib.

Security considerations

  • Network access: Containers have full network access (Docker bridge networking) by default.
  • Command execution: ConsoleToolset is configured with require_execute_approval=False — the LLM can run arbitrary commands inside the container without user confirmation. Docker provides the isolation boundary.
  • Workspace access: When a workspace is mounted, the container has full read/write access to that host directory. The LLM can read, modify, or delete any file in the mounted workspace.
  • Container user: The container runs as root. Docker container isolation is the security boundary, not OS-level user separation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haiku_skills_sandbox-0.15.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haiku_skills_sandbox-0.15.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file haiku_skills_sandbox-0.15.0.tar.gz.

File metadata

  • Download URL: haiku_skills_sandbox-0.15.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for haiku_skills_sandbox-0.15.0.tar.gz
Algorithm Hash digest
SHA256 1d8bc6ab6570579de3085e88691ebf0e0ab5e89698cdf8fa78f486e2b144f5ff
MD5 4022249160fcfdef803c875eb7927307
BLAKE2b-256 8c0258a68cac261cae4c04d03f82363d186a515f0f9cd40fcb5e9ae1c47f25e0

See more details on using hashes here.

File details

Details for the file haiku_skills_sandbox-0.15.0-py3-none-any.whl.

File metadata

File hashes

Hashes for haiku_skills_sandbox-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93a4de1640b35a6cabf445aea967bd600286527b30f6c4f291c5200188036f06
MD5 91c7211fba66ec00f8c90fa829e7391e
BLAKE2b-256 b73e1504453a56b1fb2ce4c4d1344d045cd8c22a5c638c22a63b74d2e407dc0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page