Show HN: AgentNest, self-hosted sandboxes for AI agents AgentNest, an open-source runtime for secure AI agent execution, provides self-hosted sandboxes with disposable, policy-controlled environments for Python, shell commands, files, packages, browsers, GPUs, and Git work. The tool features secure defaults including non-root execution, read-only root filesystem, denied networking, and egress allowlisting, and supports stateful Python sessions, forkable state, async operations, and audit events. The open-source runtime for secure AI agent execution. AgentNest gives AI agents disposable, policy-controlled environments for Python, shell commands, files, packages, browsers, GPUs, and Git work. It is self-hosted, Python-first, and deliberately not another cloud or cluster orchestrator. python from agentnest import Sandbox with Sandbox "python:3.12-slim", timeout=60 as sandbox: sandbox.write file "main.py", "print 'Hello from isolation' " result = sandbox.exec shell "python main.py" print result.stdout Secure defaults: non-root, read-only root, no capabilities, denied networking, limits, cleanup Egress allowlisting: let code reach pypi.org and nothing else, with every connection logged Agent-native: stateful Python sessions, forkable state, async, streaming, secrets, approvals, audit events Non-destructive timeouts: a slow command is killed on its own; the sandbox and its state survive Crash-safe: every resource is labelled with a deadline, so agentnest prune reaps orphans Proven, not promised: a suite of escape attempts /mihirahuja1/agentnestOSS/blob/main/tests/escapes runs on every commit Self-hosted & extensible: your Docker or Kubernetes; third-party backends via entry points Try it in one command needs Docker : pip install agentnest agentnest demo Warning Containers share the host kernel. Choose an isolation boundary appropriate for your threat model. Read the security model /mihirahuja1/agentnestOSS/blob/main/docs/security.md before running hostile multi-tenant workloads. pip install agentnest agentnest doctor Optional extras: pip install 'agentnest kubernetes ' pip install 'agentnest server ' pip install 'agentnest mcp ' pip install 'agentnest all ' python from agentnest import NetworkPolicy, Sandbox, Secret, SecurityPolicy policy = SecurityPolicy network=NetworkPolicy.denied , max output bytes=2 000 000, require image digest=True, with Sandbox "python@sha256: