refactor(installer): remove hardened (unprivileged hal0-api) mode; drop live-hello; fix ready-summary IPs#953
Merged
Conversation
…op live-hello; fix ready-summary IPs hal0-api now always runs as root, so updates, systemd drop-in writes, and service restarts work directly — no privileged seam or perms workaround. Removes the HAL0_USER!=root path: the User substitution (now User=root), the 20-run-as-hal0.conf drop-in + template, and the /etc/hal0 + /var/lib/hal0 chown flip. Upgrading a previously-hardened box removes any stale run-as-hal0 drop-in to revert to User=root. Agent isolation (hermes/agents run as hal0 via run-as-hal0.sh) is unchanged. Also: remove the install-time 'live hello' greeting (threw up a temp slot + streamed a chat; on a fresh box just printed 'skipped: no model pulled'). And fix the 'hal0 is ready' summary — filter LAN IPs by interface so container/bridge addrs (e.g. podman 10.88.0.1) stop leaking into 'Reach hal0 at' / becoming the primary HOST; lead next-steps with model pull + hal0 update + docs/logs footer. Dormant slot/agent privilege seam (hal0-slotctl, container.py euid routing, perms.py) left in place; removing it is a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks
This was referenced Jun 23, 2026
bogdan-d
pushed a commit
to bogdan-d/hal0
that referenced
this pull request
Jun 23, 2026
… routing) Follow-up to Hal0ai#953 (hardened mode removed). With hal0-api always root, the slot privilege seam is dead code. Removes: ContainerProvider._privileged() + the two euid!=0 branches (the root path is unchanged — behavior-preserving), the hal0-slotctl wrapper + sudoers + their install.sh writes (replaced with an upgrade cleanup that deletes any stale copies), the installer-route _privileged_systemctl_argv sudo fallback, and the now-obsolete seam test + conftest euid fixture. Kept: src/hal0/install/perms.py (still used by 'hal0 doctor' for root-only + agent ownership auditing; stale seam doc updated) and the agent env seam (hal0-agentenv / run-as-hal0.sh — agents still run as hal0). perms.py's non-root branches are now unwired — a candidate for a later cleanup alongside doctor. 289 targeted tests pass (providers + perms + installer routes); ruff + bash -n clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bogdan-d
pushed a commit
to bogdan-d/hal0
that referenced
this pull request
Jun 23, 2026
Bump version 0.8.0-beta.3 -> 0.8.1-beta.1 and add the CHANGELOG entry for the installer/privilege simplification (Hal0ai#953, Hal0ai#954) + Hermes durable memory on by default (Hal0ai#955: private:hermes + shared banks, agent-id hermes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes hardened mode (the
HAL0_USER != rootpath that ranhal0-apias an unprivileged service user) from the installer.hal0-apinow always runs as root, so it can apply updates, write systemd drop-ins, and restart services directly — eliminating a class of operational breakage (hal0 updatepermission-denied, the memoryextraction_slotdrop-in failing to apply, the daemon unable to restart itself). Bundles two related installer-output cleanups.1. Remove hardened (unprivileged hal0-api) mode
hal0-api.servicebase unit:User=${HAL0_USER}→User=root.20-run-as-hal0.confdrop-in and its template (installer/systemd/hal0-api.service.d/).HAL0_USER != rootperms-flip block that recursively chowned/etc/hal0+/var/lib/hal0to the service user (kept only the non-hardening agent-dir seeding).HAL0_USERenv var, its--sudore-exec passthrough, and its docs.User=root.hal0viarun-as-hal0.sh(that's#843root-clobber protection, not hardened mode).2. Remove the install-time "live hello"
Threw up a throwaway
helloslot, loaded a model, and streamed a one-line greeting. On a fresh install (no model pulled) it just printedlive hello skipped: no model pulled. Gone.3. Fix the "hal0 is ready" summary
podman/cni/docker/veth/br-/flannel/virbr/...) by interface name, so noise like the podman10.88.0.1gateway no longer leaks into "Reach hal0 at" — and can no longer be picked as the primaryHOST/dashboard URL.hal0 setup/hal0 model pull <id>(what a fresh box actually needs), addhal0 update, and a docs/logs footer.hal0-apiis open on the LAN with no built-in auth (ADR-0012). Running it as root means a compromise of that surface is root on the host. This is the project default (HAL0_USERdefaulted toroot); hardened mode was an opt-in that proved operationally fragile (no privileged-update seam was ever wired, sohal0 updatecouldn't write its own files). The slots already run as root podman containers regardless, so this changes only the API process's own privilege. Front:8080with a reverse proxy / firewall on untrusted networks.Out of scope (follow-up)
The now-dormant slot/agent privilege seam (
hal0-slotctl+ sudoers,container.pyeuid routing,src/hal0/install/perms.py) is dead code under root-onlyhal0-apibut is left in place — removing it touches core slot management and deserves its own PR + slot testing.Test plan
installer/install.sh) —hal0-apicomes upUser=root; no20-run-as-hal0.conf; services healthy. (Can't be fully exercised from an existing install — needs a clean box.)User=root.hal0 updateapplies without permission errors.10.88.x), correct dashboard URL.bash -nclean. (Already applied + verified live on CT105 + CT107: hal0-api as root, slots managed,hal0 memory graph enable --slot <x>returnswritten/restarted: true.)🤖 Generated with Claude Code