Overview
MeepaGateway can run each agent inside a Docker container, isolating the entire agent loop — LLM calls, tool execution, shell commands — from the host. A fresh container is spawned per message and destroyed after the response is sent. Container mode is disabled by default. Enable it for agents that run untrusted code, execute shell commands, or need a controlled environment with specific packages installed.Isolation Models
MeepaGateway supports three isolation levels, from strongest to weakest:Container
The agent’s full loop runs inside an isolated Docker container. The agent workspace is bind-mounted in; everything else on the host is inaccessible. File access rules do not apply — the container boundary is the enforcement mechanism. Enable withcontainer_mode.enabled: true on the agent.
Seatbelt / Landlock
The agent runs on the host with kernel-level file access enforcement. This is the default mode when container mode is not enabled andfile_access.unrestricted is not set.
Rules are evaluated in priority order: deny always wins, then allow_read_write, then allow_read. Writes are blocked by default unless explicitly permitted.
- macOS: enforced via
sandbox-exec(seatbelt) - Linux: enforced via Landlock LSM
Unrestricted
No file access restrictions. Enable withfile_access.unrestricted: true in config or the --unrestricted CLI flag.
How It Works
- A message arrives from a connector (MeepaChat, Discord, Slack)
- The host spawns a Docker container running
meepagateway agent-run - Message content, provider secrets, and config are passed via stdin JSON
- The agent workspace is bind-mounted at
/workspace(read-write) - The agent runs its full loop inside the container — including all tool calls
- The response is written to stdout as JSON
- The host reads the response, sends it through the connector, and the container exits
Container Filesystem
| Path | Type | Writable | Persists | Purpose |
|---|---|---|---|---|
/workspace | Bind mount | Yes | Yes | Agent files (SOUL.md, MEMORY.md, memory.db, skills/) |
/tmp | tmpfs (256MB) | Yes | No | Temp files (SQLite journals, downloads) |
| Everything else | Image rootfs | No | N/A | Read-only (OS, packages, meepagateway binary) |
HOME=/workspace— so~/SOUL.mdresolves to the agent’s persistent filesTMPDIR=/tmp— temp files go to the writable tmpfsWORKDIR=/workspace
~/.meepagateway/agents/{id}/ directory. Any file the agent writes to /workspace persists across container runs.
Container Image
The container image defines what packages are available inside the container. Configure it in the Captain Dashboard under Settings > Container Mode or inconfig.yaml:
meepagateway container build), MeepaGateway generates a Dockerfile from your package list, builds it, and tags the result as meepa-sandbox:<content-hash>. The tag changes automatically when you modify the package list.
Isolation Image
When container mode is enabled, MeepaGateway builds an isolation image that layers themeepagateway binary on top of the container image. This gives the container both:
- All your configured packages (python3, nodejs, chromium, etc.)
- The
meepagateway agent-runbinary that drives the agent loop
ghcr.io/bogpad/meepagateway-sandbox:latest image is used.
The image is tagged as meepagateway-isolated:{version}-{base} and cached locally. Changing container packages produces a new isolation image automatically.
Configuration
Container Mode (per-agent)
Enable container mode inconfig.yaml under each agent:
File Access (Seatbelt / Landlock mode)
When not using container mode, configure host-level file access restrictions:Configuration Fields
Run this agent’s entire loop inside a Docker container.
Docker image for the container. Leave empty to auto-build from
image_config (recommended).Maximum seconds before the container is killed.
Docker memory limit (e.g.
"512m", "1g").Container network mode.
"bridge" allows outbound connections (needed for LLM API calls from inside the container). "none" blocks all network access.Disable all file access restrictions. Equivalent to the
--unrestricted CLI flag.Paths the agent may read (but not write).
Paths the agent may read and write.
Paths always denied, regardless of other rules.
Allow read access to dotfiles in the home directory.
Allow outbound network access.
Security
Isolation containers run with hardened defaults:- Read-only rootfs — the image filesystem is immutable at runtime
- All capabilities dropped —
--cap-drop=ALL - No privilege escalation —
--security-opt=no-new-privileges - Memory capped — containers exceeding
memory_limitare OOM-killed - Ephemeral — each container is destroyed after the response
/workspace) and the /tmp tmpfs. Provider API keys are passed via stdin JSON and never written to disk.
Managing Images
Captain Dashboard
Go to Settings > Container Mode to:- Configure base image and packages
- Preview the generated Dockerfile
- Build, rebuild, or delete container images
- Monitor build progress
CLI
Docker
Troubleshooting
”exec format error”
The isolation image contains a binary built for the wrong architecture. Delete the image and let it rebuild:Packages not available in container
If the agent can’t find python3, nodejs, etc., the isolation image was built without the container base. Ensure the container image is built first, then delete the isolation image so it rebuilds:SQLite disk I/O errors
Usually caused by a stale isolation image without properHOME/TMPDIR settings. Delete and rebuild:
