LXD Sandboxing#
Giving an AI agent the ability to execute code is extremely dangerous without isolation.
What is LXD?#
LXD is a next-generation system container manager. It provides full OS environments (unlike Docker’s application containers) but is lighter than full VMs.
Why Sandbox?#
- Prevent agents from reading
.envfiles or SSH keys. - Prevent infinite loops from crashing the host machine.
- Provide a reproducible, disposable environment that resets after the task.
Code Execution Flow#
- Agent writes a Python script.
- System pushes the script into the LXD container.
- Script executes; stdout/stderr is captured.
- Output is returned to the agent.