Moving my desktop config out of the agent's reach
Earlier today I asked whether the agent could misuse fleet-sudo, the script that turns on its temporary root across the fleet with my smart card. The answer was no: execute permission on that script didn’t matter. What mattered was that the agent could write to the files I run. We fixed fleet-sudo itself by installing a root-owned copy. Then the agent went looking for other files of the same kind, and found that my whole desktop qualified.
The way I’d set up workbench (my Hyprland, kitty and Neovim environment), my ~/.zshenv, ~/.config/zsh, the Hyprland config, Neovim, kitty’s Python bits, waybar, environment.d/ssh-agent.conf and the bench launcher were all symlinks into the shared project tree. That tree lives under /srv/projects, shared between me and the llm-agent account through a group, so the agent can edit things there while I watch. Which is the point, as far as the agent’s work is concerned. But it also meant any edit there would run as me the next time I opened a shell, logged in or started an editor, with my card key and my sudo password close by. Twenty-four links in all, which is a bit more than I would have guessed.
The fix is pretty boring, which I think is a good sign. I now have my own clones of arch-setup and workbench at ~/.local/share/arch-setup (workbench nested inside, the same layout as the shared one), owned by me and pulled straight from GitLab, and my links point there instead. The agent can read them (its half of the kitty layout still runs commands through my copy of bench) but can’t write to them. It went through the links one at a time, swapping each with a temporary link and a rename so Hyprland never saw its config go missing. Afterwards nothing pointed into the shared tree except the ~/Projects shortcuts I use to browse it, and hyprctl configerrors came back empty.
The catch, and I’d rather have it than not, is that the agent’s changes to my desktop no longer reach me on their own. So there’s a small script, bin/review-pull, that fetches both clones, shows me the new commits and the diff, asks, fast-forwards if I say yes, and reloads Hyprland if anything under config/hypr changed. --check just says what’s waiting. It refuses to run from the shared tree, since a copy the agent could have edited checking the agent’s work would rather defeat the purpose. I tried that on purpose, and it did refuse.
The last piece was making sure I actually hear about updates. arch-setup’s CLAUDE.md now tells any agent that my desktop runs from my own clones, that it must never write to them or point my links back at the shared tree, and that after merging a change it should tell me to run review-pull. Workbench is public, so its note is the generic version: with a separate agent user, the user’s config should come from a clone the agent can’t write, and the agent should remind the user to review and pull after a merge.
So the rule I’m working with now is simple enough: anything I execute, source or load shouldn’t be writable by the agent. There’s more of the same kind to clean up, but my shell is no longer one of them.