Why not run n8n itself inside a Docker Sandbox? Ajeet Raina published a walkthrough showing how to package n8n, the workflow automation service, as a Docker Sandbox v3 workload kit so it runs inside a disposable microVM with a deny-by-default egress proxy instead of sharing the host network. The kit deliberately omits the sbx@1 agent capability and instead composes com.docker.sandbox/long-running@1 and com.docker.sandbox/lifecycle@1, launching n8n explicitly on every boot on port 5678 with workflows, credentials and the encryption key stored on a named persistent volume. The approach matters because n8n's core job is calling external APIs with credentials attached, and the sandbox forces each outbound host to be granted explicitly via commands such as sbx policy allow network api.github.com. Why not run n8n itself inside a Docker Sandbox? If a Docker Sandbox can safely isolate an AI agent running arbitrary code, why not run a long-lived service like n8n in one too? n8n's whole job is reaching out to the internet with secrets attached exactly what you'd want on a leash. Docker Sandboxes exist https://docs.docker.com/ai/sandboxes/?ref=ajeetraina.com to run AI coding agents https://docs.docker.com/ai/sandboxes/agents/?ref=ajeetraina.com Claude Code, Codex, Copilot, Gemini inside disposable microVMs with credential proxying https://www.ajeetraina.com/how-secrets-work-in-docker-sandboxes-local-vs-cloud/ and network-policy enforcement https://docs.docker.com/ai/sandboxes/security/defaults/?ref=ajeetraina.com . That's the headline use case. But a sandbox isn't an "agent runner"; it's a microVM with a declarative capability model. Once you see it that way, an obvious question falls out: If a sandbox can safely box in an AI agent that runs arbitrary code, why not run a long-lived service like n8n inside one too? n8n is workflow automation. Its whole job is to reach out to the internet HTTP Request nodes, API integrations, webhooks , often with credentials attached. That is exactly the kind of thing you'd like to keep on a leash. A Docker Sandbox gives it one: microVM isolation https://www.ajeetraina.com/where-is-the-human-in-the-loop-a-map-of-approval-points-across-dockers-ai-tools/ , a deny-by-default egress proxy, and ports/volumes you declare instead of improvise. This post walks through packaging n8n as a v3 workload kit , what the sandbox buys you, and the one sharp edge that will trip you up on day one if nobody warns you so: consider yourself warned . What a sandbox gives n8n Running docker run n8nio/n8n on your laptop gives n8n your whole network. A sandbox inverts that: - microVM isolation: n8n runs in its own kernel, not sharing yours. - Egress through a proxy, deny-by-default: the sandbox's only way out is an HTTP/HTTPS forward proxy with TLS interception. A workflow can't quietly phone home to a host you didn't allow. You grant hosts explicitly: sbx policy allow network api.github.com . - Declared ports: n8n's editor on 5678 is forwarded to an ephemeral localhost port, nothing more. - Declared, persistent storage: workflows, credentials and the encryption key live on a named volume that survives stop/recreate. For a tool whose job is "call lots of external systems with secrets," that's a very natural fit. The kit: a v3 workload , not an agent A sandbox kit is one descriptor file. The interesting decision is the very first one: n8n is a service, not an agent. An agent kit declares the sbx@1 capability, which tells the host "replace the image's entrypoint with an agent launcher and attach me a shell." n8n doesn't want that. It wants its own server to run. So the kit deliberately omits sbx@1 and instead composes a handful of plain capabilities: n8n.yaml excerpt schemaVersion: "3" kind: workload displayName: n8n capabilities: Keep the microVM alive after the launching client detaches. n8n is a server, not a session, so auto-stop would kill running workflows. - type: com.docker.sandbox/long-running@1 sbx runs a keepalive as PID 1 and does NOT auto-start the image entrypoint for a detached workload, so we launch n8n explicitly on every boot. - type: com.docker.sandbox/lifecycle@1 config: interactive: /bin/sh the n8n image is Alpine, no bash startup: - command: sh, -c, "chown node:node /home/node/.n8n" user: "0" background: false - command: - sh - -c - export N8N SECURE COOKIE=false N8N PORT=5678 N8N LISTEN ADDRESS=0.0.0.0; exec /usr/local/bin/n8n start /home/node/.n8n/n8n.log 2 &1 user: node the n8n image's uid-1000 user is node background: true Editor / REST / webhook endpoint. - type: com.docker.sandbox/port@1 config: { name: n8n-editor, container: 5678, transport: tcp } Persist workflows, credentials and the encryption key. - type: com.docker.sandbox/volume@1 config: { path: /home/node/.n8n, size: 2g, mode: "0755" } Runtime egress: the editor boots fully offline; workflow targets are granted at runtime with sbx policy allow network