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.13.0.tar.gz (3.8 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.13.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for haiku_skills_sandbox-0.13.0.tar.gz
Algorithm Hash digest
SHA256 d935998d6a1bc81dbd7176503e9997d4bad6870439269c0a2a433110a6ccf247
MD5 5f95f1fb20ab69b6a47af886a51c0184
BLAKE2b-256 b93c63c1aeb60e6443adbe1dcb3d8f21b66d690bdb17728481e33da1c75b5a27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for haiku_skills_sandbox-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 359da82e12cff59cefe4892436b99a3f17d420fb7c07b2c4837c8a8ccec2de3f
MD5 dc460f46ba34cb7ac9906c6eaf25edc3
BLAKE2b-256 0e46cabbaccac6dd4da62df454c2f9bc4f25e26cb6a40d38720fc71c0ef3e7e4

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