Menu

Give Your Coding Agent sudo, Not Your Laptop: Docker Sandboxes in Practice
πŸ“°

Give Your Coding Agent sudo, Not Your Laptop: Docker Sandboxes in Practice

DEV Community: dockerΒ·Anoop GopiΒ·7 days ago
#NCgBUcPm
#devtodocker#devto#dev#docker#agent
Long article (2495 words) β€” no AI summary yet.
Reading 0:00
15s threshold

The local steps ran on Mac with sbx 0.54.1; the GitHub secret and cloud parts come from Docker's docs.

If you use Claude Code or Codex every day, you know how this goes. At first you approve every command. By the twentieth npm install you're tired of clicking yes, so you let the agent run on its own.

From that point on, the agent is working on your laptop, in your shell, with your files and your credentials, and nobody is watching each step. Usually nothing goes wrong. But "usually" isn't a security model.

Docker Sandboxes are Docker's answer to this. In this post I'll cover what they are, how to set one up, and what they don't protect you from.

Why a normal container isn't enough

Most of us would reach for a container first. Put the agent in a container and call it done.

The problem is that agents usually need Docker too, to build an image or start a test database. The quick fix is to mount /var/run/docker.sock into the container.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.