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.2.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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: haiku_skills_sandbox-0.17.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f47641c868dee3c9f9b59a074e2b45bdb7911eb75a1aaa94d9cc8367f2c3dc7e
MD5 87717f2266f98468bfa4d45c1373bb7c
BLAKE2b-256 795047f285beda4a679d23c0f6846a8318eb56d267be26684f011c3aa30277f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for haiku_skills_sandbox-0.17.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08bbd11144527d45448f4a873b0c3e749ce91106574cf63c92964bd5f8d20e4f
MD5 f33c68b0be1580d2ba52ef84c85c6ee5
BLAKE2b-256 ec5c3825b90c9ac74bb4fb8cbe1efe3fe3df342a6574880c796422446dc3d0fc

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