
Sandbox the code your agent writes, and prove every limit actually applied
OWASP names running model-generated code through exec or eval as its own vulnerability, tells you to treat the model as untrusted — and says nothing about how to contain it. So we built the containment: no network, 256 MB, 64 processes, read-only disk, no capabilities. Every one of those held. The CPU limit was refused outright, and eight busy loops took 605% of the host. The cause is one line of systemd configuration nobody mentions, and the fix needed no reboot despite the documentation insisting otherwise.

Move the Docker daemon off root so a container escape lands on an ordinary user
If you can run docker without sudo, you can already read every file on the machine. Not through a bug — that is how Docker is built. One command proves it. For a host running agents that execute generated code, that is the whole attack, and Part 2's non-root containers do not touch it. This moves the daemon itself to an unprivileged account, with the UID arithmetic you can check, four places the install walks you into a wall on Ubuntu, and what stops working afterwards.

Firewall an agent container so it can reach one API and nothing else
Every part of this series so far has controlled what an agent may call. None of it controls where an agent may go. OWASP's mitigations for Excessive Agency are three rules about tools and say nothing about the network. This puts a default-deny egress policy in front of one container, allows exactly one API, and proves the boundary with a lookup that succeeds and a packet that dies. Includes the conntrack rule everyone tells you to add and this one doesn't need, and a measurement that was wrong by three orders of magnitude.

One endpoint, many models: deploy an LLM gateway on a WEC Instance
Every app on a box holding the same API key is a problem waiting to happen. A gateway fixes that — one endpoint, scoped keys per app, per-key budgets, and a log of who spent what. Deployed for real on a host already running five other stacks, including the parts that surprised us.

Root by default: hardening container privilege on a self-hosted AI stack
Two of the six containers behind a live Langfuse deployment were running as root, for no reason anyone chose. Fixing it took one line each — and broke a service that had nothing to do with the fix. A real conversion, a real coordination failure, and how to catch both.

Your firewall is lying to you: hardening Docker networks for multi-agent systems
A box running five agent stacks, a firewall set to deny everything, and services still answering from the public internet. We probe a real deployment, find a database with no password, prove why UFW never sees Docker traffic, and fix it four ways — every command and result from a live run.

Build a WhatsApp AI assistant from scratch with Evolution and the WEC API
Self-host a programmable WhatsApp gateway (Evolution API) and write the ~50-line bridge that turns it into an AI assistant — webhook in, LLM out, reply back. Every gotcha is real: the image that moved publishers, the Baileys version loop, the loop guard, group spam, WhatsApp's LID addressing, and the delivery wall nobody warns you about.

Regression-test your RAG service with DeepEval — and settle a model debate with data
Wrap the RAG assistant from part 5 in a containerized DeepEval suite judged by gemma4 on the WEC Inference API — no OpenAI key anywhere. Then use it to answer a real question: should we swap our generation model? Same quality, 5.5× the tokens: the eval says no. Every command, number, and error is real.

The capstone: build, evaluate, and observe a RAG docs assistant on the WEC API
Build a production-shaped RAG service in Docker: scrape a real docs site, embed locally, generate on the WEC Inference API — then catch a real hallucination, root-cause it to your own scraper, fix it, and pin it with a regression test. Every command, number, and error is real.

Secure OpenClaw with a Caddy reverse proxy + HTTPS
Put Caddy in front of OpenClaw for real HTTPS and device-paired auth, then close the gateway's ports so the proxy is the only way in — gotchas and all.

Deploy OpenClaw on a WEC Instance via Docker Compose
From a fresh WEC Instance to a self-hosted OpenClaw agent that actually answers — Docker Compose, your own model key, and every real error and fix from a live deploy.