Self-hosted AI Agent Execution with SandrPod, E2B SDK, Docker
Introduction

Quickstart Guide: Enabling AI Agent Execution
Begin by deploying SandrPod’s control plane and worker infrastructure using Docker. This process requires minimal setup:
- Install Docker Compose on your local machine or cloud server.
- Download the configuration
curl -O https://raw.githubusercontent.com/sandrpod/sandrpod/main/docker/docker-compose.yml. - Launch the stack with
docker compose up -d. This command pulls pre-built images (ghcr.io/sandrpod/server,poder, andtoolbox), initializing the control plane onlocalhost:8080.
Verify deployment by checking the health endpoint: curl localhost:8080/health. Once the control plane is active, install the CLI tool using pipx install sandrpod-cli. Create a sandbox and execute code with:
sandrpod-cli --api-url http://localhost:8080 create demo --provider local sandrpod-cli execute demo "echo hello from SandrPod; python3 -c 'print(6*7)'"
This sequence establishes a secure, isolated environment for AI agents to run Python or other scripts, demonstrating core functionality in under a minute.
Understanding SandrPod’s Architecture
SandrPod operates as a distributed orchestration system with three core components:
- Control Plane: Manages sandbox lifecycle, authentication, and re
- Poder Workers: Execute code in isolated containers or VMs, communicating
- Toolbox Runtime: Handles sandboxing, security policies, and environment setup for AI agents.
Infrastructure Flexibility for AI Agents
The platform’s versatility lies in its ability to integrate with diverse infrastructure:
Cloud Compatibility
- AWS, GCP, Azure: Utilize managed APIs like AWS SSM or Azure Run Command for secure execution.
- China-Region Support: Native integration with Aliyun and Tencent Cloud enables data-residency compliance.
- Global Reach: Deployments on DigitalOcean, Hetzner, and Oracle Cloud cater to varied geographic needs.
Local and Remote Execution
Seamless SDK Integration
SandrPod prioritizes interoperability:
- Native REST API: Direct HTTP requests enable custom integrations with AI workflows.
- LangChain/deepagents Support: Built-in backend compatibility streamlines adoption for existing projects.
- E2B Compatibility: Unmodified E2B SDKs work with minimal configuration, facilitating migration from hosted platforms.
This flexibility ensures AI developers can retain familiar toolchains while leveraging SandrPod’s infrastructure control. For example, developers using Fiverr or Upwork services can provide clients with dynamic code execution without exposing proprietary infrastructure.
Security and Control Through Sandboxing
Security is embedded in every layer:
- Reverse-Tunnel Workers: Workers initiate connections to the control plane, eliminating inbound firewall rules.
- Isolated Environments: Each sandbox runs in a Docker container or VM, with re
- Permission Gates: Configurable policies allow or restrict actions (e.g., file access, network requests) during execution.
Real-World Applications
Businesses can leverage SandrPod for:
- Automated Testing: Dynamic environments for CI/CD pipelines, reducing reliance on external services.
- E-Commerce AI: Custom code execution for product recommendations or inventory management, integrated with platforms like Gumroad.
- Content Creation: AI agents generating unique multimedia assets using local compute re
For freelancers, offering AI-powered services on Upwork or YouTube becomes more efficient when execution environments are locally managed, reducing costs and latency associated with third-party sandbox providers.
Conclusion
self-hosted AI agent infrastructure empowers developers to build automated revenue streams while maintaining full control over models and data.