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

Uploaded Python 3

File details

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

File metadata

  • Download URL: haiku_skills_sandbox-0.17.0.tar.gz
  • Upload date:
  • Size: 3.9 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.17.0.tar.gz
Algorithm Hash digest
SHA256 33c7dc48f56f614d6195f2cf9ad0761133489ef6f7c96771f8f293c821205ab1
MD5 263a290c355efd204d1be5be9c45f64c
BLAKE2b-256 e7b05fe17d5d9f1d401b77c7bb613c8b584a160111c8d95c9726345e03542bb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for haiku_skills_sandbox-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3255c301749977fe16da01d7d976cb857f5f4269325669108e2026b500af3880
MD5 cdb391dd71c1f5f9149d0638ee13c274
BLAKE2b-256 be4cced3418b6526078f61fc32b6e883e3c5df292a339a6cc6bf313077b5e933

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