Skip to main content

Python SDK for running coding agents in sandbox backends

Project description

sbx-agents

Build with Codex, OpenCode, Claude Code, or your favorite AI coding agent from Python.

sbx-agents runs coding agents in isolated sandboxes and gives your app structured access to output, logs, diffs, files, and events.

Install

With uv:

uv add sbx-agents

With pip:

pip install sbx-agents

Install the sbxa CLI as a standalone uv tool:

uv tool install sbx-agents
sbxa --help

For local development:

uv tool install -e .
sbxa --help

Basic Example

from pathlib import Path

from sbx_agents import Agent, Runner
from sbx_agents.backends import Codex
from sbx_agents.sandboxes import DockerSbxSandbox

agent = Agent(
    name="fix-tests",
    backend=Codex(model="gpt-5-codex"),
    instructions="Fix failing tests with the smallest safe diff.",
)

result = Runner.run_sync(
    agent,
    sandbox=DockerSbxSandbox(
        workspace=Path("."),
        branch="agent/fix-tests",
    ),
    prompt="Fix the failing pytest suite.",
)

print(result.output)
print(result.diff)

Define a reusable runner and launch it later with sbxa:

runner = Runner(
    agent,
    sandbox=DockerSbxSandbox(workspace=Path("."), branch="agent/fix-tests"),
    default_prompt="Fix the failing pytest suite.",
)
sbxa run main:runner

Backends

Agent backends:

  • Codex
  • OpenCode
  • Shell
  • custom backends

Sandbox backends:

  • DockerSbxSandbox
  • DockerSandbox
  • custom backends

Docs

Full docs, examples, API reference:

https://blairhudson.com/sbx-agents/

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

sbx_agents-0.1.0.tar.gz (112.6 kB view details)

Uploaded Source

Built Distribution

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

sbx_agents-0.1.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file sbx_agents-0.1.0.tar.gz.

File metadata

  • Download URL: sbx_agents-0.1.0.tar.gz
  • Upload date:
  • Size: 112.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbx_agents-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39ddf0946f61b9ee90887ca6daa20ab1f0c2db1485fd3b63326c04a6fe9dc643
MD5 0cf1af844e758e36e338da81956db1c7
BLAKE2b-256 2a01d9a605b2f77f6708021da979513d1be237357e0169db52483cac63bc7ded

See more details on using hashes here.

File details

Details for the file sbx_agents-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sbx_agents-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbx_agents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd07e30432ee30ee52427601f60f263ea8c79af7c9808ddd4451544883241db9
MD5 897d800b117591d8f340a1c393c840cc
BLAKE2b-256 59da62eba96175a130dfd9e6a282f7a403349a7f6e4fe11fbc59be0447d85329

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