Post

Given today's LiteLLM supply chain attack, what are people's preferred development environment sandboxes on MacOS these days? I think it's time I started running my development environments somewhere where rogue code can't steal all my ~/... credential files

9 reposts106 likes

That's good. I think I've managed to avoid everything that puts credentials in plain text. First lesson in my third full time programming job in 1998, never put any credentials in plain text. Should have been my first lesson in my first internship and everyone else's, too! :)

docker is so heavy. WSL (doesn't apply to you) is just waiting to burn me again. Browser sandboxes are super but too small. Attempts to create sandboxed python, sandboxed bash are interesting but seems like the relevant language development body would need to be onboard, not just some hobbyist.

The right question. Docker containers are the obvious answer but most dev setups mount ~ for convenience. After Trivy + LiteLLM in the same week, "pip install" should come with a warning label. Sandboxed dev environments are no longer optional.

Move your personal stuff to a MacBook Air or whatever. Any time a system has developer tools on it, it’s basically compromised.

I've not done this myself but I've been wondering if a Docker container where you shell in and run Claude Code would work.

Devcontainer (I have 2) in vscode, starting from Anthropic’s template, adding in the stuff I like, and weakening the firewall to block internal hosts (instead of allowing specific hosts). Works generally well, but the terminal in vscode is not on the same level as standalone terminals. Bit messy.

I’ve wrapped leash.strongdm.ai + orbstack (on mac) podman (on linux) with tooling so I run my “shed” command with an issue number, that creates a worktree then launches and drops me in to a container with the worktree and .claude mounted. Doesn’t solve everything, but better than not having it :)

leash.strongdm.aiLeash by StrongDM — Security for AI AgentsSecurity, visibility, and authorization for AI agents. Sandboxed execution, MCP authorization, and policy enforcement from development to production.

I have different modes (cedar rule sets) so ‘research’ has full internet, but can only write to a ‘research’ mount that I then ‘scan’ for dodgy content (in another container, no worktree) before opening with a ‘dev’ container that has limited internet, but full write to the worktree

Getting file permissions, injecting github token envs and making claude still work and a few other wrinkles was a pita, but now working and running multiple “sheds” in tmux (with auto mode + branch name in panel title) has helped with keeping track of what is what!

I do use a separate OS X user account as well, and ssh to it.. My main issue with any of this is that many tools like Superpowers Visual Mode really expect to be in a terminal that can then open a browser you can see. That's the one area I feel like I'm missing out on with this approach.

I have been using the litellm proxy as a docker image all along and it was not affected by the attack. The llm proxy gives a much better way to get usage accounting via api for all models in one place I would probably explore bifrost though as an alternative after this

have you considered using a separate user account in your system and relying on unix perms do the rest? if you dont like this, Im curious why

I'm not even sure how I'd do that while using macOS, since I'd want to be logged in as my main user account I guess I could sudo to the alternative user in the terminal app?

Yes, I've used it, packaged it for Homebrew (`brew install sandvault`) and really like how relatively minimal it is compared to e.g. a Docker container in a VM. With a bit of work (I have a wrapper) you can hook it up to any tool that lets you change the commands for claude/codex e.g. Superset.

I do this atm. You can ssh or su to the claudeuser account(cua). You can also chmod a dir in the cua so your main account can see and write to a cua shared dir. via finder etc I use as a one way share, ie: ~/claudeuser/claude_home Copy/paste is a little hurdle but is solvable in a variety of ways

I'm spinning up spot instances on AWS whenever I need an LLM to write code... plan locally with limited permissions, then off to a spot instance to build.. provision temp/ephemeral credentials where possible. Bonus is Claude Code runs a lot faster, with significantly less waiting on network IO

Not running MacOS, but for this, and general supply chain attacks, I run all my dev in qemu VMs. Repos mounted from host, but never credentials. Has some nice benefits, like being able to restart fresh dev environments quickly.

I have a separate user account (macOS). - ssh access (persists through sleep so never lose session) - authorized key, localhost only (no password) - some read-only PATs configured in that user account - experimenting with nix so I can blow it away and start over easily!

Possibly unwise: my real user has full access to sandbox user directory, so I can just cd over and run privileged commands (eg git push). This setup has been very smooth. Only disadvantage is my agents stop running when I close the laptop!

its not trivial without giving up loads of convenience we all take for granted nowadays. this is an emerging market

i use devcontainers eg docker. no fancy network isolation or firewalling yet but that'd probably be a good thing to figure out quick!

I’ve been working on going back to a VM I build with Vagrant. It still has its issues but at least it won’t meddle with documents.

I use (and built) github.com/kanaka/contagent Runs your whole agent (not just tools) in a docker container. Uses your actual host UID:GID, mounts in the current directory at the same path (no /workdir/ mismatch), passes through ssh-agent auth socket (but not the key material), etc.

github.comGitHub - kanaka/contagent: Contagent is a containerized runtime for coding agents on your local machine.Contagent is a containerized runtime for coding agents on your local machine. - kanaka/contagent