Skip to main content

Docker sandbox tools for Axio

Project description

axio-tools-docker

PyPI Python License: MIT

Docker sandbox tools for axio.

Run agent-generated code and commands inside isolated Docker containers. The agent gets sandbox_exec, sandbox_write, and sandbox_read tools that operate entirely within the sandbox — the host filesystem stays untouched.

Features

  • Isolated execution — code runs inside a Docker container, not on the host
  • Configurable image — use any Docker image as the sandbox environment
  • Three sandboxed tools — execute commands, write files, read files — all inside the container
  • Persistent sandbox — container is reused across tool calls within a session for faster execution
  • TUI integration — configure image, memory limits, and CPU from the axio-tui settings screen

Requirements

Docker must be installed and running:

docker info   # should succeed

Installation

pip install axio-tools-docker

Usage

from axio import Agent
from axio.context import MemoryContextStore
from axio_transport_openai import OpenAITransport
from axio_tools_docker.plugin import DockerPlugin

async def main() -> None:
    plugin = DockerPlugin()
    await plugin.init()   # uses default config (python:3.12-slim)

    agent = Agent(
        system=(
            "You are a coding assistant. Use sandbox_exec to run code safely. "
            "Never attempt to access the host filesystem directly."
        ),
        tools=plugin.all_tools,
        transport=OpenAITransport(api_key="sk-...", model="gpt-4o"),
    )

    ctx = MemoryContextStore()
    result = await agent.run(
        "Write a Python script that computes the first 20 Fibonacci numbers and run it.",
        ctx,
    )
    print(result)

Sandbox tools

Tool Description
sandbox_exec Run a shell command inside the container; returns stdout + stderr
sandbox_write Write a file into the container's filesystem
sandbox_read Read a file from the container's filesystem

Configuration

from axio_tools_docker.config import SandboxConfig

config = SandboxConfig(
    image="python:3.12-slim",
    memory_limit="512m",
    cpu_quota=100000,    # 1 CPU
    work_dir="/workspace",
)

Plugin registration

[project.entry-points."axio.tools.settings"]
docker = "axio_tools_docker.plugin:DockerPlugin"

Part of the axio ecosystem

axio · axio-tools-local · axio-tools-mcp · axio-tui

License

MIT

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

axio_tools_docker-0.3.4.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

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

axio_tools_docker-0.3.4-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file axio_tools_docker-0.3.4.tar.gz.

File metadata

  • Download URL: axio_tools_docker-0.3.4.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axio_tools_docker-0.3.4.tar.gz
Algorithm Hash digest
SHA256 ea3de12ae8f327b70bc78a89dd4dd92d4f56c06922fc9980b26691c3366a3010
MD5 faa4c0da4d53657054498700daf9e373
BLAKE2b-256 b9d0c9dae21fa29ed5a622d0f3a90454c8ba589a3ba2ee331d4d650a583c5b87

See more details on using hashes here.

Provenance

The following attestation bundles were made for axio_tools_docker-0.3.4.tar.gz:

Publisher: publish.yml on axio-agent/monorepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axio_tools_docker-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for axio_tools_docker-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dc6b0310bae9f2592e7998019e73f4f3ffd4e68600484a604997c244d6fe9852
MD5 78329a16b5189c65da1c77ed2030c753
BLAKE2b-256 d4f9df08a3cf9fe43413e4447908ba96602e8dced4e5b1d3a2597320239005ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for axio_tools_docker-0.3.4-py3-none-any.whl:

Publisher: publish.yml on axio-agent/monorepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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