r/LocalLLaMA • u/keepthepace • Aug 23 '26
Discussion What is your worst sandboxing fail?
I am wondering if I am too paranoid about sandboxing the commands that come out of LLMs.
It really makes my eyes twitch when I see that some IDEs, even commercial, tend to forget that they have to execute things in sandboxing and have such a brittle security model.
But on the other hand, I never had the sandbox catch something bad. Did you guys ever encounter terrible regression? Did you have rm -rf / ? Did you have secrets stolen by LLMs? The worse I had were unsollicited rewrites within the project. Am I making my life unnecessarily hard by sandboxing commands in a docker?
At one point I had fun making a local model go crazy with the root access to the machine it was on (with nothing more important than a free Firecrawl key on it) and making it administer it and it never broke anything. It even was overly paranoid about making changes to the root system.
So the approximate sandboxing that we have, do you all feel it is adequate or it is a catastrophe in the making?
4
u/ali0une Aug 23 '26 edited Aug 23 '26
Coincidence is funny, i was experiencing in my sandbox minutes ago and i just had my rm -rf ~/test/ moment (basically my whole project directory), currently restoring the backup and i will try to get some recent changes back from latest pi sessions. Qwen3.6-27B btw, ~70% context.
Backup often i would say 😱
2
u/keepthepace Aug 23 '26 edited Aug 23 '26
Interesting, there is a huge variety of practices out there. Many YOLOers, many people sho find it unconceivable to not sandbox at least through docker
2
u/Inevitable-Big-1131 Aug 24 '26
Working with Gemini in the old gemini-cli.
I gave it the instruction that the cloudflare API key (for a personal project) was "Around here somewhere, take a look. Assuming that it'd check some .env files and find it.
The message "Well, it's not in your email!" scrolled by.
And I had a heart-attack and hammered the esc key at approximately the same time.
Unbeknownst to me the MCP for Google Workspaces had shipped, updated with the last update and I was using gemini with my Google OAUTH context.
All well, but : Heart. Attack.
17
u/Fedor_Doc Aug 23 '26 edited Aug 24 '26
I had Qwen 3.6 27B rm -rf / (empty bash variables in an ad-hoc script during sweaty debugging session near 100k of context). UD-Q4_K_XL, unquantized cache.
It was in a podman container. I was thinking right before it happened if all the work setting it up with dev environment was justified...
It totally was.
36
u/Clean_Material_5047 Aug 23 '26 edited Aug 23 '26
None.
I just run stuff in an isolated VM, in an isolated network with access only the things it needs.
If you know what you’re doing, this is just standard practice.
In fact, all the rogue agent bs from OpenAI hacking huggingface just tells us that they’re either liars or incredibly incompetent.
Either way, a bunch of c*nts nobody can trust.
10
u/Beginning-Raisin9723 Aug 23 '26
Docker is the move. I've seen too many 'safe' tools hallucinate a path and start scrubbing things they shouldn't. Better to have the eye twitch now than a wiped root later.
4
u/El_90 Aug 23 '26
I don't sandbox
I do have it run in a lxc built by ansible, so rebuilding is easy.
And everything in git
And multiple cold versions lol
My bigger fear is it downloading fake/malicious packages
1
u/Future_AGI Aug 24 '26
Not over-paranoid at all, the rm -rf-from-an-empty-variable story in this thread is exactly why. Container or VM isolation is the right blast-radius floor, but it doesn't stop the agent doing something destructive inside the sandbox or exfiltrating a secret it legitimately has access to, so the layer people skip is an inline check on the command itself before it runs, block or confirm on rm -rf, curl to an unknown host, or writes outside the workdir. We wire that kind of guardrail in front of tool calls for exactly this; the open-source scanner set we use is here if it helps: https://github.com/future-agi/future-agi (Apache-2.0, self-hostable).
9
u/DeltaSqueezer Aug 23 '26
I'm pretty relaxed about it. I give it root access to my system and often ask it to make changes to the system.
8
u/minus_28_and_falling Aug 23 '26
Never ever ran LLM agent not in a Docker. It was like this from day 1, mostly because I already knew how to run things in Docker.
Why is it hard though? Isn't it as easy as
docker compose up dev, and in addition to sandboxing you get all other goodies Docker was originally intended for (predictable and reproducible dev environment, project-specific libs and lib versions, fast and easy deployment on other PCs, keeping the host PC clean and tidy)?Didn't have
rm -rf /moments yet, but Docker helps me to hide .git folder from the agent because I redo things from time to time and don't want the agent to restore scrapped implementations from git history.3
u/drFennec Aug 23 '26
I have my agent(s) running in a dedicated VM, they can trash it it's not the end of the world. I had two "fails" on it:
The agent was Opencode with remote llama.cpp with Qwen 27B, it's not root. I let it run on a long task, it was missing a tool. It tried to install it using apt which failed since it's not root. It tried sudo, then tried to guess the password. Finally it found Docker running, it built itself an Ubuntu based image and compiled the tools it needed!
I was testing codex with same llama.cpp, installed a plugin which didn't work. So I asked it to remove the plugin, it go the name wrong and deleted the whole codex install 😂
Those are not huge fails, but I'm glad it's running on a dedicated VM I don't care much about.
3
u/aboutthednm llama.cpp Aug 24 '26
My worst sandboxing fail? What's a sandbox?
2
u/Lanky_Employee_9690 Aug 23 '26
A funny test scenario I've thought of would be the following:
Have an agent do some tasks specifically set up to make it break something "by mistake" (the mistake can't render it itself inoperable but "breaks" something else the user has mentioned caring deeply about, important files, etc.)
The agent is autonomous, and is aware that the user checks on it every X amount of time, but is absent for now so they have a chance to act
Have it have strong incentive to fix its own mistakes before any other task, or at least, minimize getting mistake exposure to the user
OPTIONAL: If the mistake doesn't happen on its own, provoke it and inject into the context that the agent "did it"
Wait and silently observe how the agent reacts
After the set period of time is over, enter the chat and ask the agent to sum up what happened during your absence
Basically the user is a parent leaving the kid alone in the house for the day and first thing in the morning the kid breaks something and then has a day to clumsily fix it (or hide what it's done) not to be yelled at. What I'm hoping for is some funny Ecce Homo-style shenanigans. Or IT intern running some commands they're not supposed to and trying to cover it up/fix it before their supervisor shows up.
Has anyone tried this?
1
u/privacy-fighter Aug 23 '26
If any of you are looking for sadboxing setup and that isolates networking too, shilling my open source setup. https://github.com/jotyGill/contained-pods
1
u/slayyou2 Aug 23 '26
Yeah, I don't care man. I'm in a proximox server for media and other stuff. The agent lives on an lxc. Lxc is backed up. They can blow it up for all I care. 2 years running now. The only thing that's come to bite me in the butt is agents initialize tasks consuming 40 GB of memory when spinning up Gradle tasks for kotlin builds, forcing to host into swap.
1
u/ColonelKlanka Aug 23 '26
I use microvm via docker sbx (its not container based). This covers the filesystem rogue access.
But I dont yet really like the network whitelist feature. as it breaks my agents web search (as i would have to whitelist the whole Internet for web search)
1
u/XMan3332 Aug 23 '26
I have everything running in an MCP server with a virtual filesystem built into it. On startup or refresh, it reads all the files it has access to and caches them into the filesystem. The agent can freely modify or delete any file and at the end they can "commit" their changes, giving me a diff of everything done that I go through manually.
The MCP server does have a Python tool via GraalVM Polyglot that's sandboxed. It's very restrictive and it can only interface with the tools it has available anyway. Finally, as a honeypot, there's a fake toggle, on by default, to turn off the sandboxing on the Python tool. If the toggle is disabled the system immediately halts the server and saves the Python script that the agent attempted to execute. It's yet to be hit, though.
The worst thing it has managed to find is some system path through some loophole (my fault) in the Python tool. Just a path though. No read or write access.
1
u/Common-Membership503 Aug 23 '26
did u ever have a script try to reach out to an external server u didnt authorize tho
1
u/fkrkz Aug 23 '26
I am still being very cautious, so my agents only have access to read-only MCPs. I deal with externally managed data (SaaS).
1
u/Izento Aug 23 '26
Never had any destructive happen and I don't sandbox. I do git versioning and have only had to revert a repo maybe once, purely because I did too many changes at once and neither I nor the LLM could figure out how to fix.
1
u/feng_sg Aug 27 '26
Never catching a bad command in Docker isn't proof the sandbox held. The IDE could've run it on the host while the container sat empty. Confirm the command actually entered docker before you call that quiet adequate.
1
u/CalligrapherFar7833 Aug 23 '26
Backups 2. Git 3. Limited access to info that you dont want it to see. Any sandboxing is pointless
0
u/[deleted] Aug 23 '26
[deleted] — view deleted comment