# hal0 — privileged seam grant for GPU benchmarking (D hardened-perms).
#
# The hal0 agent user runs unprivileged, but benchmark containers are rootful
# and need /dev/kfd + the images in root's podman store. It delegates exactly
# one operation to /usr/lib/hal0/bin/hal0-benchctl: "validate and exec this
# one `podman run … llama-bench -o json` cell". The helper re-validates every
# argv element on the root side of the boundary — model path under the
# resolved store, device nodes that exist and are character devices, a closed
# podman-flag set, the image namespace, the llama-bench flag whitelist — and
# never evaluates a shell. The telemetry verb samples GPU counters into the
# result store. No wildcards, no arbitrary args.
#
# Install (as root):
#   install -m 0755 -o root -g root hal0-benchctl /usr/lib/hal0/bin/hal0-benchctl
#   install -m 0440 -o root -g root hal0-benchctl.sudoers /etc/sudoers.d/hal0-benchctl
#   visudo -cf /etc/sudoers.d/hal0-benchctl
#
# Keep this grant pinned to the helper binary; a broader grant would let the
# agent run arbitrary root commands. Revoke with: rm /etc/sudoers.d/hal0-benchctl

hal0 ALL=(root) NOPASSWD: /usr/lib/hal0/bin/hal0-benchctl
