Threat Modeling Agent Execution & gVisor Kernel Sandbox Setup
Giving an autonomous agent access to eval() or an unconfined shell is an immediate critical severity vulnerability. Standard Docker containers share the host Linux kernel; a kernel privilege escalation can break out to the host. We configure gVisor (runsc), Google's user-space virtualization kernel that intercepts and virtualizes all syscalls.
sudo apt-get update && sudo apt-get install -y runsc
sudo runsc install
sudo systemctl reload docker
pip install docker pydantic
Verify that Docker recognizes the runsc security runtime:
import docker
client = docker.from_env()
info = client.info()
runtimes = info.get("Runtimes", {})
assert "runsc" in runtimes, "gVisor runsc runtime is not registered in Docker!"
print(f"gVisor runsc operational. Ready to isolate agent tool execution.")