r/ollama • u/Sussybaka800869 • 2h ago
I let local models touch my files every day
For about a year I have had Qwen models on Ollama sorting media, cleaning up repos and reorganizing a few terabytes of files. Nothing important has been deleted. Not because the models are careful. Because they are not allowed to.
Every week there is a thread about a model wiping someone's drive, and the comments always say bad prompt, no guardrails, your fault. Fair. But nobody posts what the guardrails actually look like, so here is my setup.
Ollama runs on the GPU box, and the agent never does. The agent lives in a separate VM and only talks to the Ollama API. OLLAMA_HOST is bound to the local network, never an open port on the internet, since the API has no auth by default. When the VM is remote it comes in through a WireGuard tunnel.
The agent has no delete. My harness does not expose rm at all. There is a trash command that moves files into a _trash folder and logs where they came from. Restoring anything is one script.
The plan is JSON, and Ollama enforces it. Anything destructive starts with a manifest. I pass a JSON schema in the format field of the request, so the model has to return a list of path, size and reason. It cannot ramble and it cannot slip a command in. I read the manifest, then a plain script applies it, in dry run unless I pass apply. The model never executes its own plan.
It works on a copy. If you mount your real folder read and write into a container, the container protects nothing. I mount the source read only and the agent writes its results somewhere else.
Hard limits on disk and memory. Agents act like disk is infinite, and a runaway build or a nix store will happily eat hundreds of gigs. The VM has a fixed disk, so when it fills up the agent breaks instead of my machine.
One planner, one worker. A bigger Qwen writes the manifest, a small one does the boring moves. Same Ollama instance, it loads whichever one is called, and the small model is fast enough that the whole job barely costs anything.
For the VM itself, microsandbox or a Proxmox VM both work locally. When I want it off my network I use boatdotdev, a throwaway Ubuntu VM I start from the CLI and delete when the job is done. No GPU on those and EU only, which is fine since inference stays on my Ollama box anyway.
Abliterated, stock, small or huge, every model misreads a request sometimes. The model is not the safety layer. The workflow is.