Three of the eight security controls behind n8n's Assistant sandbox are fully intact on my NAS. One has moved to a different layer, and four are gone. Two of the intact three looked lost until I measured them, and the thing that told me they were lost was the software itself.

The box is a Synology NAS that runs n8n, the automation behind my own products, and everything that automation touches: one Postgres with every service's database, a search engine, a headless browser, and the credentials n8n holds for all of it. n8n executes three kinds of code there. Code nodes run JavaScript and Python I wrote and scheduled. The Assistant writes code on request and runs it in a sandbox. The services around them run whatever their images ship. This note is about what each kind of code can reach, and what I would require before letting generated code near data I was accountable for. The commands and full rule dumps behind every figure are in the repo's SECURITY.md; getting the sandbox to run at all on DSM is the first note.

Measured on

Item Value
DSM 7, kernel 4.4
n8n and task runners 2.x
Sandbox service (api, runner, sandbox image) 1.4.0
Inner Docker daemon 29.3.1
Postgres 18
Measured 20 and 28 September 2026

The boundaries that do not depend on the kernel

flowchart TD
    N8N["n8n"]
    subgraph SVC["svc: services, by name"]
        PG[("Postgres, one role each")]
        SX["SearXNG"]
        BL["Browserless"]
    end
    subgraph RN["runner-net: no gateway"]
        TR["task runners: my Code nodes"]
    end
    subgraph SN["sandbox-net: internet only"]
        RUN["runner, privileged"]
        SB["sandbox: generated code"]
        RUN --- SB
    end
    N8N --- SVC
    N8N --- RN
    N8N --- SN
    SB -. "escape = root" .-> HOST[("NAS host: every DB, every credential")]

Each kind of code gets its own network, and the split follows trust. The services reach each other by name and publish ports only to the LAN address. My own Code nodes run in external task runners on an internal network with no gateway, read-only, every capability dropped, memory-capped, with environment access blocked so an expression cannot read the encryption key. The Assistant's sandbox needs a gateway, because the runner pulls images and the Assistant installs packages, so the sandbox service's own rules decide what that code can reach: the public internet, and nothing on the LAN.

Two more boundaries sit in configuration. Each service's database is owned by its own login role with PUBLIC access revoked, so one credential opens one database. The two sandbox containers receive only the variables listed in their environment block, never an env_file, so the encryption key and the database password never reach them; they authenticate each other with mutual TLS from certificates generated on first start, and nothing in the stack mounts the Docker socket.

What survived the five workarounds

The sandbox service is designed with eight controls. On a stock kernel all eight apply. On this one:

Control On this kernel Established by
Egress filtering intact TCP probes and the rule dump
Isolation between sandboxes intact TCP connect between two containers
Ingress to each sandbox's own daemon intact rule dump
Per-sandbox memory limit moved to the runner docker stats during an allocation
Per-sandbox CPU limit gone container create is rejected
Per-sandbox process limit gone pids cgroup controller absent
seccomp gone daemon warning at every sandbox start
iptables raw rules gone, deliberately disabled so the daemon can start

Every network result comes from the same probe: a TCP connect with a four-second timeout from a container on the sandbox bridge. The return code is the finding. An instant error means there was no route; a timeout means a rule dropped the packet. That difference is what separates "blocked" from "unreachable", and the two warnings below turned on it.

Two warnings I believed

I expected egress filtering to be the weak control. The sandbox network has a gateway, nothing in the NAT path obviously stops a sandbox reaching 192.168.0.0/16, and the API logged "egress":"public" on every sandbox it created. The probes said otherwise: the public internet connected, and Postgres, the router and the NAS's own address all timed out. The sandbox service writes its own drop rules for every private, link-local, loopback and reserved range, plus a chain that drops traffic to the host, and it writes them in the filter table, one of the three this kernel has. I had read the platform's limits and stopped there. Ingress to each sandbox's daemon follows the same pattern: accept from the runner, drop the rest.

The second warning came from the inner Docker daemon. It said it could not restrict communication between containers, because it could not read the bridge netfilter sysctl from inside its namespace. The reasoning seemed solid, and it went into my first draft of the security write-up. Then I tested it: one container served HTTP on the bridge, a second tried to connect, and the connection timed out on a drop rule that was sitting in the chain the whole time. On kernel 4.4 that sysctl is not per namespace, so the host's value applied everywhere. The daemon warned about a setting it could not see, and the setting was in force.

I had taken a warning as a finding. It was accurate about what the daemon could not verify and said nothing about what was happening. On an ordinary kernel those amount to the same thing; here they did not, and only the behaviour showed which was which. A security claim, in either direction, is worth exactly the test behind it. That conclusion also belongs to this kernel: on hosts with namespaced sysctls the same flag costs real isolation.

What is gone

Turning off cgroups for the CPU quota gap removes the per-sandbox memory limit with it. The runner's own mem_limit of 2 GB now covers every sandbox nested inside it, and I confirmed the nesting is charged there: a 400 MB allocation in a sandbox moved the runner from 221 MiB to 627 MiB and back. When the ceiling is hit, the OOM killer takes the largest process in the runner, which is normally the sandbox workload and is not guaranteed to be.

CPU has no limit at any layer, because the kernel is built without CFS bandwidth control, so one busy sandbox can take the whole box. Process count has no limit either; a fork bomb stops at the memory ceiling and nowhere earlier. seccomp is absent, so sandboxes run with no syscall filter; namespaces, dropped capabilities, no-new-privileges and the unprivileged user still apply. And the raw table rules are skipped on purpose with DOCKER_INSECURE_NO_IPTABLES_RAW, whose pull request warns that other hosts on the local network can then reach published ports directly; here sandboxes publish no ports, and the rules that matter live in filter.

The privileged runner above every control

The runner itself is privileged: true, n8n's fallback for hosts without Sysbox, and DSM has none. Docker's reference lists what that grants: every kernel capability, no default seccomp or AppArmor profile, access to every host device. The controls in the table keep code inside its sandbox. Code that gets out lands in the privileged runner, which can take root on the NAS, and none of those controls applies there. Root on the NAS is every database in that Postgres, every credential n8n holds, and the encryption key.

For its bundled sandbox, n8n's Assistant setup guide reaches the same conclusion. It describes the privileged runner as weak isolation, scopes the setup to development and testing, and asks for a dedicated host or VM with nothing else running on it, never exposed to the internet.

Hosting options for the privileged runner

The runner can stay where it is, move to another kernel, or leave my hardware. What a sandbox escape reaches changes with each:

Option What an escape reaches Cost
The bundled sandbox on the NAS, as today Root on the NAS, with n8n, its database and every stored credential Nothing extra
n8n's sandbox service with Sysbox runners, in a Debian VM under Synology's Virtual Machine Manager The VM, and the runner needs no privileged: true RAM and CPU on the same NAS
The same on a separate Linux machine on the LAN That machine Another machine to run and patch
Daytona, n8n's managed option Daytona's infrastructure Workflow data goes to a third party

n8n recommends its sandbox service with Sysbox runners for self-hosted production, ideally on Kubernetes, and calls Daytona a valid production choice where sending workflow data to a third party is acceptable. A stock Debian kernel has all five features DSM lacks, so in the VM the sandbox runs on n8n's own setup, with none of the DSM settings from the first note. n8n stays on the NAS and points its sandbox API URL at the VM.

The decision, and what would change it

It runs bundled on the NAS today. When I got it working, I did not have the time to build the VM. That puts it on the host n8n's guide warns against, since the NAS also runs my own automation, its database and every credential n8n stores.

As the only user, on a private network, driving the Assistant with my own prompts, I accept that. For a shared or internet-facing instance I would not. The question also comes back whenever an update breaks one of the workarounds from the first note.

In an estate I was accountable for, the same question has four answers before anything runs. Generated code gets a kernel boundary of its own, Sysbox or a VM, and never a privileged container on a host that holds data. The people who can prompt it are named, and so is the data that shares its host, which should be none. One owner re-runs the checks below after every upgrade, because every control in this note held or failed on a version, and versions move.

What to check Monday

  • Confirm every published port shows the LAN address and that the database and the headless browser publish none.
  • Confirm neither sandbox container holds an n8n secret: inspect their environment for the encryption key and the database password, and expect nothing.
  • Re-run the repo's verify.sh whenever DSM, the sandbox service or the inner Docker daemon changes version. It repeats the probes, the egress chain check, the bridge-nf check and the memory test.

Every command, rule dump and figure above is in SECURITY.md in w0rldart/n8n-assistant-synology, next to the compose file and verify.sh; the stack around it is in w0rldart/n8n-stack-synology. If you are deciding where generated code should run in your own estate, tell me what you are working on.