Agents that want the socket
Some agent platforms start a sandbox container for each task, and to do that their Compose file mounts the Docker socket. OpenHands is the best known; its local setup runs:
docker run -it --rm --pull=always \ -e AGENT_SERVER_IMAGE_REPOSITORY=ghcr.io/openhands/agent-server \ -e AGENT_SERVER_IMAGE_TAG=1.26.0-python \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ~/.openhands:/.openhands \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.openhands.dev/openhands/openhands:1.8Their documentation marks that local GUI as deprecated in favour of a newer installer; the line that matters here is the same in many tools.
What the socket hands over
Section titled “What the socket hands over”-v /var/run/docker.sock:/var/run/docker.sock is not access to “Docker”. It is
the daemon’s full API, and the daemon runs as root: whoever can write to that
socket can start a container that mounts / from the host, with every
capability, and that is root on the machine. A sandbox the agent starts through
it is only as contained as the agent decides it is.
For an agent, the agent deciding is the problem. It picks its next action from text it was given: a web page, an issue, a file in the repository it was asked to fix. Any of those can carry instructions, and with the socket in reach the worst instruction is no longer limited to the container.
What Kaio checks, and what it does not
Section titled “What Kaio checks, and what it does not”Kaio reads every Compose file it deploys for what makes a container root on
the host: a bind mount of the Docker, Podman or containerd socket, a bind
mount of /, privileged: true, a host namespace, or the ALL, SYS_ADMIN
or SYS_MODULE capability. The OpenHands line above is the first of these.
- Every way in refuses it first. A deploy, an apply, a rollback, a copy,
or a restart or
upthat has to bring the stack up, whose file hands the host to a service is refused with the risks named, codehost_access(for a copy, when nothing else stops it), until the caller says it accepts them. An import writes the stack without starting it, so the question comes when it is first brought up. Nothing is deployed in between. - From the web UI, the deploy dialog stops on a list of them and the button becomes Deploy anyway; Apply changes and a rollback ask the same question in a confirmation before going ahead.
- From the CLI,
stack deploy,stack apply,stack rollback,stack copy, and astack restartthat has to bring the stack up, stop and name the risks, until run again with--accept-risks; the TUI asks in a confirmation and goes ahead ony. - Through MCP,
kaio_stack_deploy,kaio_stack_apply,kaio_stack_rollbackandkaio_stack_copyrefuse and name the risks, until the agent calls again withaccept_risks: true. - Over HTTP, the same calls take
accept_risks: in the body ofPOST /api/stacks, as a query parameter onapplyandrollback. - Afterwards, the stack carries the mark for as long as the file does:
HOST ACCESSon its row andhoston its cluster board card,◈ hostin the TUI, aHOSTcolumn instack ls,host_accessinkaio_overviewandkaio_stack_host_accessin metrics. - Everywhere, the deploy leaves a
warnevent naming them, beside the version and the audit log entry that say who made it.POST /api/stacks/{name}/risksanswers the same list without deploying, for a pipeline that wants to fail on it.

Kaio warns; it does not forbid. A stack that needs the socket, a reverse proxy reading container labels or Kaio itself, is a legitimate thing to run, and the decision is yours. The check makes sure it is made on purpose.
Giving an agent less
Section titled “Giving an agent less”Let it act through Kaio instead. An agent that has to deploy, update or
restart stacks does not need the socket: give it Kaio’s
MCP server with a credential at read or write, as
An agent that runs Kaio does. There is no shell tool, every
call is logged under its name, and taking the access back is one line in the
proxy.
Give it a host of its own. If the platform truly needs to start containers, run it on a server that holds nothing else: no other stack, no credentials, no route to your internal network. Join it to the cluster like any other node and manage it from the cluster board; a stack that owns its host has nothing left to escape to.
Use a daemon it cannot hurt. Rootless Docker or Podman runs the daemon as an ordinary user, so the socket hands over that user rather than root. Kaio runs against Podman as well.
Never on a shared host. A socket-mounting agent next to your production stacks can read their volumes, their environment and their secrets through the daemon, and Kaio’s secret masking does not apply to a process that talks to Docker directly.
Kaio, built by Régis Gaidot