Skip to content

seznam/jailoc

Repository files navigation

jailoc

jailoc

CI Release

Manage sandboxed Docker Compose environments for headless OpenCode coding agents.

πŸ“– Full documentation

What is this?

jailoc wraps OpenCode agents in isolated Docker containers so they can run autonomously without touching your host system. Each workspace gets its own sandboxed environment with network isolation that blocks private networks by default, letting you control exactly which internal services the agent can reach. You configure which directories to mount as workspaces, which hosts to allowlist, and the agent runs inside with your OpenCode config available read-only.

Why jailoc

  • πŸ“ File isolation β€” the agent only sees directories you explicitly mount. SSH keys, browser profiles, and other projects are invisible. It runs as UID 1000 with all Linux capabilities dropped and no_new_privs set.
  • 🌐 Network isolation β€” private networks (RFC 1918, link-local, CGNAT) are blocked by default via iptables. You allowlist only what the agent needs. No pivoting to internal infrastructure.
  • 🐳 Sandboxed Docker β€” each workspace gets its own Docker daemon via a DinD sidecar. No host socket mounting, no sandbox escape through container breakout.
  • ⚑ Zero config to start β€” jailoc up handles image resolution, compose generation, firewall setup, and privilege dropping automatically.

Installation

Prerequisites: Docker Engine must be running. No docker compose CLI plugin needed β€” jailoc embeds the Compose SDK.

go install

go install github.com/seznam/jailoc/cmd/jailoc@latest

Make sure $GOPATH/bin (default $HOME/go/bin) is on your PATH.

Pre-built binaries

Download the archive for your platform from GitHub Releases (Linux/macOS Γ— amd64/arm64), extract, and place the jailoc binary on your PATH.

πŸ› οΈ Development

# Build from source
go build ./cmd/jailoc

# Run unit tests
go test ./...

# Run integration tests (requires Docker)
go test -tags=integration ./...

πŸ“¦ What's in the default container

The default base image (Ubuntu 24.04) ships with:

Category Tools
Runtimes Go, Node.js, Bun, Python 3 + uv
Package managers npm, Yarn (via corepack), Homebrew
Language servers gopls, typescript-language-server, pyright, yaml-language-server, bash-language-server, jsonnet-language-server, helm-ls
CLI tools Docker CLI, ripgrep, fd, fzf, jq, vim, git, openssh-client
Agent stack OpenCode, oh-my-openagent

Exact versions are pinned in the embedded Dockerfile and tracked by Renovate.

About

πŸ”’ Jail your AI agents β€” sandboxed Docker environments with network isolation for Opencode agents

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors