Skip to main content

OpenSandbox execution backend for Hermes Agent - secure sandboxed code execution

Project description

hermes-open-sandbox

OpenSandbox execution backend for Hermes Agent.

Run Hermes terminal and file tools inside secure, isolated OpenSandbox containers instead of your local machine.

Architecture

hermes-open-sandbox (pip package)         Hermes Agent (after setup)
┌──────────────────────────────┐        ┌─────────────────────────────────┐
│ SandboxConfig                │        │ tools/environments/opensandbox  │
│ OpenSandboxSession           │──delegates──│  - BaseEnvironment subclass    │
│  - pure SDK wrapper          │        │  - auto-generated by CLI        │
│  - zero Hermes deps          │        │                                 │
└──────────────────────────────┘        └─────────────────────────────────┘

The package itself has no dependency on Hermes Agent internals. The thin adapter that bridges Hermes's BaseEnvironment interface is auto-generated into the Hermes installation directory by hermes-open-sandbox-setup.

Quick Start

# 1. Install the package
pip install hermes-open-sandbox opensandbox

# 2. Patch Hermes to register the backend (idempotent)
hermes-open-sandbox-setup

# 3. Configure
hermes config set terminal.backend opensandbox
export OPENSANDBOX_DOMAIN=your-server:8080
export OPENSANDBOX_API_KEY=sk-xxx

# 4. Restart Hermes and use it
hermes

Standalone Usage

You can also use the package directly without Hermes:

from hermes_opensandbox import OpenSandboxSession, SandboxConfig

config = SandboxConfig.from_env(
    domain="your-server:8080",
    api_key="sk-xxx",
)
with OpenSandboxSession(config) as session:
    session.create()
    output, exit_code = session.execute("echo hello")
    print(f"Output: {output}, Exit: {exit_code}")
    session.kill()

Supported Images

Any Docker image that includes bash:

  • python:3.11
  • nikolaik/python-nodejs:python3.11-nodejs20 (default, includes Node.js)
  • ubuntu:22.04
  • Custom images from your registry

Environment Variables

Variable Default Description
OPENSANDBOX_DOMAIN localhost:8080 OpenSandbox server address
OPENSANDBOX_API_KEY (none) Authentication key
OPENSANDBOX_IMAGE nikolaik/python-nodejs:python3.11-nodejs20 Container image
OPENSANDBOX_CWD /workspace Working directory
OPENSANDBOX_CPU 1.0 CPU cores
OPENSANDBOX_MEMORY 5120 Memory in MiB
OPENSANDBOX_DISK 51200 Disk in MiB

Hermes Config Keys

These can be set via hermes config set and take precedence over env vars:

Key Description
terminal.opensandbox_domain Server address
terminal.opensandbox_api_key API key
terminal.opensandbox_image Container image

Manual Uninstall

# Remove the wrapper
rm ~/.hermes/hermes-agent/tools/environments/opensandbox.py

# Restore backups
mv ~/.hermes/hermes-agent/tools/terminal_tool.py.bak ~/.hermes/hermes-agent/tools/terminal_tool.py
mv ~/.hermes/hermes-agent/agent/prompt_builder.py.bak ~/.hermes/hermes-agent/agent/prompt_builder.py

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

hermes_open_sandbox-0.1.3.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

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

hermes_open_sandbox-0.1.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file hermes_open_sandbox-0.1.3.tar.gz.

File metadata

  • Download URL: hermes_open_sandbox-0.1.3.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hermes_open_sandbox-0.1.3.tar.gz
Algorithm Hash digest
SHA256 434b7ab2425e50c670b407c3391a1b0d45590fcfa0fade50f717bcbcd4eda860
MD5 987be379c1ef365a3ae91bef9e6d05e0
BLAKE2b-256 9c0a6eb78648bb1df8de8dc2bec2818146ba9c27ae6d66d003f5c403afd2e323

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_open_sandbox-0.1.3.tar.gz:

Publisher: workflow.yml on lordqyxz/hermes-open-sandbox

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

File details

Details for the file hermes_open_sandbox-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_open_sandbox-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 93d296ae0693679c3574493fc1f535c57bbf3ad3961de1da5294b5fba7a70934
MD5 315d05bb44489f86cfe2d04b467c17a7
BLAKE2b-256 d20b178b8bfff649afe7ec17a4be6dd18c5c95c9380b731c81d24e2f1461d16b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_open_sandbox-0.1.3-py3-none-any.whl:

Publisher: workflow.yml on lordqyxz/hermes-open-sandbox

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