{
  "version": "https://jsonfeed.org/version/1",
  "title": "Containers on LLBBL Blog",
  "icon": "https://avatars.micro.blog/avatars/2023/40/125738.jpg",
  "home_page_url": "https://llbbl.blog/",
  "feed_url": "https://llbbl.blog/feed.json",
  "items": [
      {
        "id": "http://llbbl.micro.blog/2026/05/16/sandboxing-ai-agents-without-buying.html",
        "title": "Sandboxing AI Agents Without Buying Anything",
        "content_html": "<p>The <a href=\"https://llbbl.blog/2026/05/15/python-and-rust-have-the.html\">previous post</a> (and the one <a href=\"https://llbbl.blog/2026/05/14/your-software-is-mostly-strangers.html\">before it</a>) covered the threat model and the per-ecosystem mitigations: lockfiles, <code>--ignore-scripts</code>, <code>cargo-audit</code>, Trusted Publishing. All of that helps. None of it answers the question that keeps me up at night, which is: what happens when an AI agent on my laptop installs a malicious package, and the malicious package was the literal point of the operation?</p>\n<p>This is the new shape of the threat. You&rsquo;re not getting compromised because you typed <code>npm install</code> wrong. You&rsquo;re getting compromised because Claude or Cursor confidently invented a package name that didn&rsquo;t exist, an attacker registered it five hours ago, and the agent ran <code>pip install hallucinated-thing</code> on your behalf without asking. The agent has shell access. Your SSH keys are right there. Your <code>~/.aws/credentials</code> file is right there. The entire premise of giving an AI agent the ability to <em>just figure it out</em> depends on it being able to execute untrusted code at the speed of conversation, which is also the worst possible threat model.</p>\n<p>If you&rsquo;re a solo developer, an open-source maintainer, or a startup with no budget for Socket or Endor Labs licenses (more on those next post), the answer isn&rsquo;t a commercial firewall. The answer is local isolation, and the tools have gotten dramatically better in the last 18 months.</p>\n<h2 id=\"containers-as-the-baseline\">Containers as the Baseline</h2>\n<p>The minimum viable isolation in 2026 is <em>don&rsquo;t run untrusted code as your user on your host OS</em>. The cleanest way to do that on macOS or Linux is a <a href=\"https://containers.dev/\">devcontainer</a>, a fully described, reproducible Linux environment that VS Code, Cursor, and the Claude Code CLI all natively support. You give the agent the container as its sandbox. Project files mount in. SSH keys, AWS credentials, and the rest of your home directory don&rsquo;t.</p>\n<p>The container runtime matters. Docker Desktop on macOS is a memory pig, 3 to 4 GB resident at idle, with sluggish startup times that make iterative work miserable. <a href=\"https://orbstack.dev/\">OrbStack</a> is the obvious replacement: free for personal use, native Apple Silicon, dynamically allocates memory instead of reserving fixed blocks, and benchmarks show container startup times around 0.2 seconds versus Docker Desktop&rsquo;s multi-second cold starts. If Docker Desktop is eating half your RAM before you even start Claude Code, OrbStack will give you that memory back.</p>\n<p>The thing to internalize, though, is that <strong>a container is not a security boundary by default</strong>. It&rsquo;s a deployment mechanism that happens to have isolation properties when configured correctly. Misconfigured developer containers have been implicated in some of the largest crypto-industry breaches of the last few years. The pattern: a container running with privileged flags, or mounting the wrong host directory, turns into a path straight to the host. Containers help. They don&rsquo;t save you from yourself.</p>\n<p>The configuration mistakes that void the isolation:</p>\n<ul>\n<li><strong>Mounting <code>~/.ssh</code> into the container</strong> so the agent can <code>git push</code>. Now any process inside the container can read your SSH keys.</li>\n<li><strong>Mounting your entire home directory</strong> as a convenience. Now everything is accessible.</li>\n<li><strong>Running with <code>--privileged</code></strong> or sharing the host&rsquo;s Docker socket. Container escape becomes trivial.</li>\n<li><strong>Letting the agent run <code>sudo</code> inside the container.</strong> The container&rsquo;s root can chain to host kernel exploits.</li>\n</ul>\n<p>Least privilege, applied seriously. The agent gets the project directory and nothing else. If it needs to commit, it pushes through a credential helper that lives on the host, not by mounting your SSH keys.</p>\n<h2 id=\"lighter-weight-sandboxes\">Lighter-Weight Sandboxes</h2>\n<p>Spinning up a full container for every <em>test this snippet the LLM wrote</em> interaction is too heavy. There&rsquo;s a middle layer worth knowing about.</p>\n<p><strong>Python.</strong> <a href=\"https://pyodide.org/\">Pyodide</a> compiles CPython to WebAssembly, which means Python code runs in a deny-by-default memory sandbox with no filesystem or network access unless you explicitly grant it. Works great for evaluating LLM-generated snippets, struggles with C extensions and heavy dependencies. <a href=\"https://github.com/safe-py-runner\">safe-py-runner</a> is the pragmatic alternative: it runs Python in a restricted subprocess with timeouts, memory limits, and I/O marshaling. No container needed. For code that absolutely cannot touch your machine, remote V8-isolate services like Deno Sandbox boot pre-snapshotted Python environments in the cloud and air-gap execution entirely.</p>\n<p><strong>Rust.</strong> The <code>build.rs</code> problem from the last post has no first-class solution yet, but on Linux you can wrap <code>cargo build</code> in <a href=\"https://landlock.io/\">Landlock</a>, a kernel feature available on 5.13+ that lets unprivileged processes restrict their own filesystem access. Combined with seccomp-bpf for syscall filtering and cgroups v2 for resource limits, you can run a build script that genuinely cannot read your SSH keys or open arbitrary network sockets. Projects like <a href=\"https://github.com/ErickJ3/sandbox-rs\">sandbox-rs</a> wrap these primitives into something usable without writing your own seccomp filters. None of this works on macOS without a Linux VM in the way, which is another reason OrbStack plus a devcontainer is the path of least resistance for most people.</p>\n<h2 id=\"the-mindset-shift\">The Mindset Shift</h2>\n<p>The honest version of all of this: if you&rsquo;re running AI agents locally, you have to assume they will eventually install something malicious. Not <em>might</em>. Will. The question is whether the blast radius is the contents of one project directory inside a container, or every credential on your machine plus your entire git history. That gap is what isolation buys you.</p>\n<p>Containers, Landlock, WASM sandboxes, none of these are particularly hard to set up. They&rsquo;re just things most developers haven&rsquo;t bothered with because the threat model didn&rsquo;t feel real. After Shai-Hulud, faster_log, and a year of watching AI agents <code>pip install</code> whatever they invent, the threat model is real.</p>\n<p>Next post I&rsquo;ll wrap up the series with the commercial side: Socket, Snyk, Endor Labs, Mend, Sonatype, the pricing comparison, and the actual ROI math for whether any of it makes sense for teams below 50 developers.</p>\n<h2 id=\"sources\">Sources</h2>\n<ul>\n<li><a href=\"https://www.endorlabs.com/lp/state-of-dependency-management-2025\">State of Dependency Management 2025</a> — Endor Labs</li>\n<li><a href=\"https://www.endorlabs.com/learn/securing-the-roi-of-ai-coding-assistants-a-total-cost-analysis\">Securing AI Coding Assistants: A Total Cost Analysis</a> — Endor Labs</li>\n<li><a href=\"https://blog.theredguild.org/a-step-closer-to-isolation-devcontainer-wizard/\">A step closer to isolation — devcontainer-wizard</a> — The Red Guild</li>\n<li><a href=\"https://inside.wpriders.com/how-orbstack-beats-docker-desktops-ram-usage/\">OrbStack vs Docker Desktop: Performance Facts for Mac</a></li>\n<li><a href=\"https://www.reddit.com/r/devops/comments/1ozndrw/apple_containers_vs_docker_desktop_vs_orbstack/\">Apple Containers vs Docker Desktop vs OrbStack benchmark</a></li>\n<li><a href=\"https://codewithandrea.com/articles/run-ai-agents-inside-devcontainer/\">How to Safely Run AI Agents Like Cursor and Claude Code Inside a DevContainer</a></li>\n<li><a href=\"https://kitemetric.com/blogs/secure-ai-agents-with-devcontainers-isolated-dev-environments\">DevContainers for Secure AI: Isolated &amp; Scalable</a></li>\n<li><a href=\"https://www.reddit.com/r/Python/comments/1rejn2o/safepyrunner_secure_lightweight_python_execution/\">safe-py-runner: Secure Python execution for LLM Agents</a></li>\n<li><a href=\"https://github.com/pydantic/mcp-run-python\">mcp-run-python</a> — Pydantic</li>\n<li><a href=\"https://oneuptime.com/blog/post/2026-01-07-rust-sandboxing-seccomp-landlock/view\">How to Run Rust Binaries Without Root Using Sandboxing</a> — OneUptime</li>\n<li><a href=\"https://github.com/ErickJ3/sandbox-rs\">sandbox-rs</a></li>\n<li><a href=\"https://rust-lang.github.io/rust-project-goals/2024h2/sandboxed-build-script.html\">Explore sandboxed build scripts — Rust Project Goals</a></li>\n</ul>\n<p>I&rsquo;d appreciate a follow. You can subscribe with your email below. The emails go out once a week, or you can find me on Mastodon at <a href=\"https://micro.blog/llbbl?remote_follow=1\">@logan@llbbl.blog</a>.</p>\n",
        "date_published": "2026-05-16T10:00:00-05:00",
        "url": "https://llbbl.blog/2026/05/16/sandboxing-ai-agents-without-buying.html",
        "tags": ["DevOps","AI","security","Supply-chain","Containers"]
      }
  ]
}
