{"name":"Agent-Sandbox: Enterprise-Grade Sandbox for AI Agents on Kubernetes","description":"Agent-Sandbox provides an easy-to-use, enterprise-grade sandbox platform for AI Agents. It allows agents to securely run untrusted LLM-generated code, perform browser and computer use, and deploy websites with multi-session and multi-tenant isolation. This self-hosted solution wraps a robust Kubernetes foundation behind a simple RESTful API, making it accessible for developers.","github":"https://github.com/agent-sandbox/agent-sandbox","url":"https://osrepos.com/repo/agent-sandbox-agent-sandbox","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/agent-sandbox-agent-sandbox","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/agent-sandbox-agent-sandbox.md","json":"https://osrepos.com/repo/agent-sandbox-agent-sandbox.json","topics":["agent","ai-sandbox","kubernetes-native","code-executor","browser-use","e2b-compatible","Go","AI Infrastructure"],"keywords":["agent","ai-sandbox","kubernetes-native","code-executor","browser-use","e2b-compatible","Go","AI Infrastructure"],"stars":null,"summary":"Agent-Sandbox provides an easy-to-use, enterprise-grade sandbox platform for AI Agents. It allows agents to securely run untrusted LLM-generated code, perform browser and computer use, and deploy websites with multi-session and multi-tenant isolation. This self-hosted solution wraps a robust Kubernetes foundation behind a simple RESTful API, making it accessible for developers.","content":"## Introduction\n\nAgent-Sandbox is an easy-to-use, enterprise-grade sandbox platform specifically designed for AI Agents. It addresses the critical challenge of securely running untrusted, LLM-generated code and actions. With Agent-Sandbox, AI agents can safely perform tasks like code execution, browser use, computer use, and even deploy websites, all within isolated environments.\n\nThe platform ensures multi-session and multi-tenant isolation, preventing one agent's runaway task from affecting another. While built upon the robust Kubernetes foundation, similar to [kubernetes-sigs/agent-sandbox](https://github.com/kubernetes-sigs/agent-sandbox){:target=\"_blank\"}, Agent-Sandbox simplifies interaction by wrapping this complexity behind a user-friendly RESTful API and an MCP server. This design allows agents and developers to create, use, and delete sandboxes without direct Kubernetes interaction, drawing inspiration from platforms like [Blaxel Sandbox](https://docs.blaxel.ai/Sandboxes/Overview){:target=\"_blank\"} and [E2B](https://e2b.dev/){:target=\"_blank\"}, but offering an open-source, self-hosted solution.\n\n## Installation\n\nTo get started with Agent-Sandbox, you will need a Kubernetes cluster running version 1.28 or higher. The installation process is straightforward, involving a single command to apply the provided [install.yaml](https://github.com/agent-sandbox/agent-sandbox/blob/main/install.yaml){:target=\"_blank\"} file.\n\nFirst, create a dedicated namespace for Agent-Sandbox:\n\nbash\nkubectl create namespace agent-sandbox\n\n\nThen, apply the installation manifest:\n\nbash\nkubectl apply -nagent-sandbox -f https://github.com/agent-sandbox/agent-sandbox/blob/main/install.yaml\n\n\nAfter installation, you can expose the Agent-Sandbox API server using an Ingress. Here is an example configuration:\n\nyaml\napiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n  name: agent-sandbox\n  namespace: agent-sandbox\nspec:\n  ingressClassName: ingress-nginx\n  rules:\n  - host: agent-sandbox.your-host.com\n    http:\n      paths:\n      - backend:\n          service:\n            name: agent-sandbox\n            port:\n              number: 80\n        path: /\n\n\nOnce the Ingress is configured, the Agent-Sandbox API server will be accessible at `http://agent-sandbox.your-host.com`.\n\n## Examples\n\nAgent-Sandbox offers full E2B protocol and SDK compatibility, making it a drop-in replacement for existing E2B-based agents and tools. Here is an example of how to use it with the E2B Python SDK.\n\n**Requirements:**\nEnsure you have the following Python packages installed:\n\ne2b == 2.21.1\ne2b-code-interpreter == 2.4.1\n\n\n**Configure the E2B backend address:**\nSet the necessary environment variables to point to your Agent-Sandbox instance:\nbash\nexport E2B_API_KEY=testuser-aef134ef-7aa1-945e-9399-7df9a4ad0c3f\nexport E2B_DOMAIN=agent-sandbox.your-host.com\nexport E2B_API_URL=http://agent-sandbox.your-host/e2b/v1\n\n\n**Python example:**\nThis Python script demonstrates creating a sandbox, running a background command, creating a snapshot, and uploading a file.\n\npython\nfrom e2b_code_interpreter import Sandbox\n\nidleTimeout = 60*10\n\n# Create a sandbox instance from the \"sandbox-base-node\" template,\n# with an idle timeout of 10 minutes,\n# a lifecycle that pauses the sandbox and automatically resumes it when accessed again.\nsbx = Sandbox.create(\n    template=\"sandbox-base-node\",\n    timeout=-1,  # no hard lifetime; idle timeout owns reclamation\n    metadata={\"idleTimeout\": str(idleTimeout)}, \n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True}, \n)\n    \nprint(sbx.get_info())\n\n# Run a background command in the sandbox\nsbx.commands.run(\"npx serve -l 8008\", background=True, timeout=0)\n\n# Create processes snapshot for the sandbox, when the sandbox is resumed,\n# the background command can be restored automatically\nsbx.create_snapshot()\n\n# Upload file to sandbox\nwith open(\"README.md\", \"rb\") as file:\n    sbx.files.write(\"README.md\", file)\n\nf = sbx.files.list(\"/home\")\nprint(f)\n\n\nYou can also manage sandboxes via the built-in Web UI, accessible at `http://agent-sandbox.your-host.com/ui`, or continue to use the E2B SDK for programmatic control.\n\n## Why Use Agent-Sandbox?\n\nAgent-Sandbox stands out for its simplicity, comprehensive features, and extensibility, making it an ideal choice for AI agent development:\n\n*   **Lightweight, Easy to Run**: Deploy with a single command, `kubectl apply -f install.yaml`, in under a minute. It requires no external databases or message queues, leveraging native Kubernetes objects for state management. A built-in Web UI is included in the same image for easy management.\n*   **Feature-Complete for AI Sandbox Workloads**: It offers full E2B protocol and SDK compatibility, covering essential AI agent needs like code execution, browser use, computer/desktop use, and shell access. Production-grade features include multi-tenant isolation, a Sandbox Pool for low-latency allocation, Pause/Resume, Snapshot capabilities, scale-to-zero on idle, leader election for high availability, and comprehensive events and metrics.\n*   **Flexible, Built to Be Extended**: Agent-Sandbox provides two independent, live-editable layers, Blueprint and Template, allowing dynamic configuration of sandbox deployment and types without redeployment. It supports dynamic templates matched by regex and offers per-template resource limits, warmup commands, and pool sizing for diverse sandbox requirements.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/agent-sandbox/agent-sandbox](https://github.com/agent-sandbox/agent-sandbox){:target=\"_blank\"}\n*   **Official Documentation**: [https://agent-sandbox.github.io](https://agent-sandbox.github.io){:target=\"_blank\"}","metrics":{"detailViews":2,"githubClicks":0},"dates":{"published":null,"modified":"2026-08-28T19:50:34.000Z"}}