r/openbsd_uncensored • u/Run-OpenBSD • 9d ago
GitHub - simplestringdev/claude-code-openbsd: Running Claude Code on OpenBSD via vmd + Alpine Linux + Docker, with OpenBSD's own security model (pf/doas/pledge) as the real perimeter 11-21-26
https://github.com/simplestringdev/claude-code-openbsdClaude Code on OpenBSD
Claude Code has no native OpenBSD build — the npm package only ships prebuilt binaries for darwin-*, linux-* and win32-* targets, so npm install -g u/anthropic-ai/claude-code simply has nowhere to fetch a binary from on OpenBSD. There's no workaround for that: it's a hard platform gap, not a missing dependency.
This repo documents a working setup that runs Claude Code on top of OpenBSD anyway, using OpenBSD's own virtualization (vmd) to host a Linux guest — and treats OpenBSD's security model (not Linux's) as the actual perimeter around the agent. It's the architecture behind a real, long-running "resident agent" I've had operating unattended on a spare laptop for several days at time of writing, not a one-off experiment.
Why bother with OpenBSD as the host at all?
If the agent has to run inside a Linux VM either way, why not just run Linux as the host and skip a layer? Because the layer being skipped is where most of the actual safety comes from:
pf, OpenBSD's stateful firewall, with a default-deny posture and per-service rate-limiting (SSH brute-force protection is a few lines ofpf.conf, not a separate daemon).doasinstead ofsudo— a much smaller attack surface for privilege escalation, and (as used here) trivially easy to scope to a handful of named commands instead of "yes/no to root".pledge**/**unveilfor the host's own daemons and scripts — a process that callspledge("stdio rpath", NULL)cannot open a socket even if compromised, no matter what code runs inside it.vmd**/**vmm, OpenBSD's own hypervisor — one fewer piece of C code (no QEMU/KVM) in the host's trusted computing base for the VM that does the actual "day job" networking.A famously small, security-audited base system,
W^Xenforced by default, and a release cadence built around "remove the thing that was wrong" rather than "add a flag to disable it".
None of that protects the inside of the Linux VM. What it does is make the host that VM runs on a much smaller, harder target — which matters a lot when the thing running inside is an autonomous agent with real credentials.
Continued ...
2
u/whatThePleb 8d ago
No.