Skip to content

Security model

How agentic isolates a tool: each layer, what it stops, and what it doesn't. The threat is the agent itself: a bug, a bad decision, or a prompt injection in something it reads. The goal: it can only touch what you hand it.

The map

flowchart LR
    files[("workspace, tool home,<br/>mounts")]
    subgraph docker[Docker host - shared kernel]
        tool[Tool container]
        proxy["Egress proxy<br/>(--proxy)"]
        dind["DinD sidecar<br/>(--dind)"]
    end
    net((Internet))

    files --> tool
    tool --> dind
    tool --> proxy
    dind --> proxy
    proxy -- allowlisted hosts --> net
    tool -.-> net
    dind -.-> net
  • Files: the tool sees only the workspace, its own home and the mounts you add. The DinD sidecar sees only the workspace.
  • Docker: the tool talks to its own DinD sidecar over mTLS, never to the host's daemon.
  • Network: each run gets its own Docker network. With --proxy it's internal, so the tool and sidecar only get out through the proxy. Without it (dotted lines), both reach the internet directly.
  • Kernel: everything inside "Docker host" shares one Linux kernel, the boundary all layers rest on, unless the microsandbox runtime runs the tool in a VM with its own kernel.

Layers

[!WARNING] The core container hardening and mounts are the well-tested part. The egress proxy, credential injection and DinD sidecar are beta, and the microsandbox runtime is newer still: don't rely on them as your only safeguard yet.

Layer What it stops What it doesn't stop
Tool container: your locally built image only, read-only root, all capabilities dropped, no-new-privileges, your uid/gid, pid/cpu/memory limits A registry image run in place of a missing one; changing the system, becoming root, fork bombs and runaway memory Anything it can do with its mounts; a kernel bug
Mounts: only /workspace, the tool's home, read-only secrets, and your mounts (read-only unless :rw) Reading the rest of your files (~/.ssh, other repos, browser data); mount tricks Reading everything that is mounted, including its own credentials; editing the workspace
Run network: its own Docker network per run Reaching other agentic runs and other Docker networks Without --proxy: the internet, your LAN, the Docker host and its published ports
Egress proxy (--proxy): an internal network whose only way out is the proxy Hosts not on the allowlist; services on the Docker host; containers outside the run using the proxy. Every attempt is logged. Sending data to an allowed host
Credential injection: the proxy holds API keys, the tool gets a placeholder Reading or leaking a configured API key Using the key during the run; OAuth tokens in the tool home
DinD sidecar (--dind): rootless dockerd in its own container, sees only /workspace Access to the host's Docker socket (= root on your machine) More kernel surface for inner containers, and the rest of its limitations
Microsandbox runtime: a microVM with its own kernel A kernel exploit reaching the host A VM escape, which lands in msb's process as your user; the differences from Docker
Build: tool install scripts checksum-verified A tampered or swapped install script A malicious release of the tool itself

Leftover risk

What no layer covers today:

  • Shared kernel: a kernel exploit escapes every container. Only a VM boundary fixes this: the microsandbox runtime, Kata, gVisor or Docker Sandboxes. Keep the host kernel patched.
  • Credentials in reach: the agent can read its login token and any file you mount, and use them from any allowed host. Injected keys stay out of reach but can still be used.
  • Workspace tampering: the agent can edit git hooks, Makefile, package.json scripts and .agenticrc.toml, which run or apply on your machine later. Risky config keys need your approval. Review diffs.
  • Shared tool state: hooks or MCP servers the agent plants in its tool home also run in your other projects. Use a separate --home for untrusted ones.
  • Exfiltration: without --proxy the internet is open; with it, data can still go to any allowed host.
  • Forwarded ports: a page served on a forwarded port runs in your browser, on your network, past the allowlist. On Docker Engine before 28 with userland-proxy off, LAN hosts routing to the Docker host can reach ports bound to 127.0.0.1.
  • Domain fronting: the proxy checks each tunnel's TLS server name, but not the HTTP Host inside it, or the real name under Encrypted Client Hello. A CDN routing by that hidden name may serve another site through an allowed host.
  • DNS on other engines: Docker Engine before 26 leaks DNS from internal networks, so agentic refuses it. Other engines can't be checked, so with --proxy data may leak in names like <data>.example.test.
  • Killed agentic: a detached watchdog removes the run's containers and sidecars within seconds of agentic exiting, also after SIGKILL or a crash. If the watchdog is killed too, the next agentic run or agentic clean --all removes them once they're a few minutes old. To stop them sooner, use docker ps and docker rm --force <name>.

Check it yourself

Run these inside the tool container:

touch /etc/test                    # fails: Read-only file system
grep CapEff /proc/self/status      # 0000000000000000: no capabilities
grep NoNewPrivs /proc/self/status  # 1: can't gain privileges
ls ~/.ssh                          # fails: not mounted
curl -I https://example.com        # with --proxy and not allowlisted: CONNECT tunnel failed, response 403

Glossary

  • Capability: a slice of root's power (e.g. CHOWN, NET_ADMIN). Without them, even uid 0 can do little.
  • Namespace: the kernel giving a process its own view of processes, network, mounts or users. Containers are mostly namespaces.
  • User namespace: maps "root inside" to an unprivileged uid outside. Rootless Docker builds on it.
  • Rootless: dockerd runs as your user, so its "root" is fake.
  • seccomp: the syscalls a process may make; the kernel refuses the rest.
  • AppArmor: a kernel policy limiting which files and actions a program may use.
  • no-new-privileges: blocks gaining privileges through setuid binaries or file capabilities.
  • mTLS: both sides prove who they are with certificates, so only the tool can drive the sidecar's daemon.