Skip to main content

A lightweight sandbox daemon for secure agent execution in isolated environments.

Project description

SandD

Sandbox Daemon for Agent Command Execution

Rust Python License: MIT

Rust-powered WebSocket server with Python API for remote command execution and interactive sessions.


Features

  • Command Execution - Run shell commands on remote machines with timeout control
  • Interactive Sessions - Full PTY sessions with bash for manual work
  • File Transfer - Upload/download files between controller and workers
  • High Performance - Rust async runtime handles high-concurrency workloads
  • Auto Reconnection - Workers reconnect automatically on network failures
  • Cross-Platform - Linux, macOS, Windows support

Architecture

┌──────────────────────────────────────────┐
│  Python Agent Application                │
│  ┌────────────────────────────────────┐  │
│  │  from sandd import Server          │  │
│  │                                    │  │
│  │  server = Server("0.0.0.0", 8765)  │  │
│  │  result = server.exec(             │  │
│  │      "daemon-1", "ls -la"          │  │
│  │  )                                 │  │
│  └────────────────────────────────────┘  │
│          ▲                               │
│          │ Python bindings (PyO3)        │
│          ▼                               │
│  ┌────────────────────────────────────┐  │
│  │  Rust WebSocket Server (tokio)     │  │
│  │  • Command routing                 │  │
│  │  • Session management              │  │
│  └────────────────────────────────────┘  │
└──────────────────────────────────────────┘
                     ▲
                     │ WebSocket (WSS)
                     │ (Daemon initiates connection)
                     │
           ┌─────────┼─────────┐
           │         │         │
       ┌───▼───┐ ┌───▼───┐ ┌───▼───┐
       │Daemon │ │Daemon │ │Daemon │
       │  #1   │ │  #2   │ │  #n   │
       └───────┘ └───────┘ └───────┘

Key Design: Daemons connect TO the agent (not the other way around), so no ports need to be exposed on the execution plane.

Quick Start

# Build
make install          # Python package
make daemon-release   # Worker binary

Start controller:

from sandd import Server

server = Server("0.0.0.0", 8765)
server.wait_for_daemon("worker-1", timeout=30)

result = server.exec("worker-1", "hostname")
print(result.stdout)

Start worker:

./target/release/sandd \
    --server-url ws://controller:8765/ws \
    --daemon-id worker-1

Documentation

Security

⚠️ Add security layers for production use:

  • Use wss:// (TLS) instead of plain ws://
  • Add authentication (tokens, mTLS)
  • Run workers in containers
  • Validate commands before execution
  • Audit log all commands

Roadmap

  • Authentication - Token-based auth for daemon connections
  • TLS Support - Built-in WSS with certificate management
  • Audit Logging - Track all commands, sessions, and file transfers
  • Metrics - Prometheus-compatible metrics for monitoring
  • Resource Limits - CPU/memory/timeout controls per daemon
  • Multi-tenancy - Isolated workspaces with access control
  • Rate Limiting - Prevent abuse and resource exhaustion
  • Command Allowlist - Restrict allowed commands per daemon

Contributing

We welcome any kind of contributions, feedback, and suggestions! See DEVELOP.md for development setup and guidelines.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sandd-0.0.0-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sandd-0.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

sandd-0.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

File details

Details for the file sandd-0.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sandd-0.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e10f8f4b15b18a247b5c9dd7555170be052517848e1232e52ed4546650bd623
MD5 0386430350ac24c2218a09ea3ccabe0e
BLAKE2b-256 2ddce08e7f07f927d8c8f24394f60088879ef5887eca1d955df3aea089c77f68

See more details on using hashes here.

File details

Details for the file sandd-0.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sandd-0.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a765e8471674bc857108e8b813fde25171ed067dd4989e754b530d5fda80a516
MD5 c3721754431819b0f15e69255729441e
BLAKE2b-256 6a751d04ccca63d8cb2afc75020aa90c01d6908ac5c33dd05ec74dce4bb0ec18

See more details on using hashes here.

File details

Details for the file sandd-0.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sandd-0.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 335e4edfe08433cc752138699f6306300e6bb8c2eb757c9140ee701e870e8b16
MD5 3b52f4f606d65e259c598989833e7bea
BLAKE2b-256 7d5ca02e34a2b1303e1eb43748dd8eeb0b5242ceea1e2200f5b3d06b2b0f0a14

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