omarchy-sudo-passwordless grants root to everything running as you, not just the tool that asked
Read the installed /usr/bin/omarchy-sudo-passwordless on omarchy 4.0.2-1 and diffed it against upstream commit d2a4cc0c: byte-identical, and its safety block only removes a stale sudoers file on the next run, so the reboot claim holds for this version. Read commit 945af75 (2026-08-31 15:24 UTC, head of branch security/nopasswd-expiry-fail-closed), its tmpfiles rule and arm_expiry function, and PR 9387, which merged to quattro on 2026-09-07 and is in the v4.0.3 tag of 2026-09-08 whose release notes list it. The record's central claim that 4.0.2-1 is the latest released package on 2026-09-18 is false: the stable pacman repository at pkgs.omarchy.org carried omarchy and omarchy-settings 4.0.4-1, built 2026-09-15 21:04 UTC, and extracting both packages showed the 945af75 script and /etc/tmpfiles.d/omarchy-nopasswd-sudo.conf inside them. The harvester most likely read this workstation's sync database, last refreshed 2026-09-05. The build date is 2026-08-31 03:11 UTC, which pacman shows as 30 August in a Pacific timezone, so the fix landed about twelve hours after the build, not a day. The original verify was wrong on its own terms: an empty timer list is exactly the post-reboot state the danger warns about, so verify now checks for the file. The fix omitted that running the tool to clean up a stale file falls through to the enable prompt, and gum confirm's Default option is true (read from confirm/options.go in charmbracelet/gum), so Enter re-enables the grant. Gate 1 passes because the shipped script itself prints the reboot caveat and the upstream commit states it. Gates 2 and 3 pass. Severity lowered to medium: this is a user-invoked command with a printed warning, not a default, and the defect is the expiry control silently off after a reboot, reachable only by code already running as that user. Nothing was exercised: the tool was not run and no sudoers file was touched. Re-checked against 4.0.4-1 2026-09-19: Rechecked on omarchy 4.0.4-1, read and never run. /usr/bin/omarchy-sudo-passwordless (omarchy 4.0.4-1) and /etc/tmpfiles.d/omarchy-nopasswd-sudo.conf (omarchy-settings 4.0.4-1) are byte-identical to the v4.0.4 tag c668141e9c42b13c80c9ca4ea108e11708c5e8a5, to v4.0.3 and to commit 945af75a. The v4.0.3 to v4.0.4 compare touches neither file, so the record's account of the 4.0.3 change still describes 4.0.4. The 4.0.4 script still writes <user> ALL=(ALL) NOPASSWD: ALL, still defaults to 15 minutes, still prints the two quoted warnings, and arm_expiry at lines 16 to 27 removes the grant if systemd-run fails. The tmpfiles rule is r! /etc/sudoers.d/99-omarchy-nopasswd-*, and systemd-tmpfiles-setup.service on systemd 261.2-1 runs --create --remove --boot before sysinit.target, so removal is boot-only and does not depend on an age cleanup or the clean timer. test/shell.d/nopasswd-sudo-expiry-test.sh covers the two fail-closed paths and the boot-only rule against a disposable root. One claim was wrong for 4.0.4: the cause said the timer is the only thing that ends the grant, which is now false because boot also ends it, and it quoted only the 4.0.2-1 closing note, which 4.0.4 replaced with "A restart removes the passwordless sudo rule as well." The cause now labels both branches. The danger said "the installed 4.0.2-1 script", which is no longer what is installed, and now names PR 7990 (Adolanium, 2026-08-24, the first public statement of the reboot gap) and the credit commit b9657b63. gum is now 2.0.0-1, so the fix's Enter-defaults-to-Yes claim was re-read at gum v2.0.0 (4d089f95): confirm Default is still true, and the moving main-branch URL is removed. Title, fix, verify and severity still hold. Not exercised: the tool was not run, no sudoers file was read or touched, and no reboot was performed.
On 4.0.2-1 and earlier, a reboot before the timer fires does not clear the grant. The 4.0.2-1 package's script is byte-identical to upstream commit d2a4cc0c4d60cd3bce866f65643f89f7d2978d5e. The transient systemd-run timer does not survive a reboot, and the script only removes a stale sudoers file the next time you run it yourself, so /etc/sudoers.d/99-omarchy-nopasswd-<user> stays in place and every process as that user keeps passwordless root until you remove the file as root or run the command again. Upstream changed this in commit 945af75aa2c0bf5b40a0155500f0774f06db6721 on 2026-08-31 at 15:24 UTC, about twelve hours after the 4.0.2-1 package was built at 03:11 UTC that day, a time pacman -Qi shows as 30 August in a Pacific timezone. It adds /etc/tmpfiles.d/omarchy-nopasswd-sudo.conf, which removes any leftover 99-omarchy-nopasswd-* file during boot, and it revokes the grant immediately if the expiry timer cannot be armed. That change merged as pull request 9387 and is in the v4.0.3 tag of 2026-09-08, whose release notes list it. On 2026-09-18 the stable package repository carried omarchy and omarchy-settings 4.0.4-1, built 2026-09-15, and those packages contain the changed script and the tmpfiles rule. A machine that has not run omarchy update since 2026-09-08 still has the 4.0.2-1 behaviour, and a stale file present when you update is removed at the next boot, not at update time. The reboot gap was first raised publicly in pull request 7990 on 2026-08-24, and upstream credits _SiCk // afflicted.sh for independently reproducing it. On 4.0.4-1 the installed script and tmpfiles rule are byte-identical to 4.0.3 and to the v4.0.4 tag, c668141e9c42b13c80c9ca4ea108e11708c5e8a5. Do not clear a leftover grant by editing /etc/sudoers or the drop-in by hand. A syntax error in either locks every sudo call out. Delete the drop-in instead.
Symptom
Is it safe to run omarchy-sudo-passwordless so an AI agent or a one-off script can call sudo without typing a password? Does the grant apply only to that tool, or to anything else running under my account until it expires?
Cause
omarchy-sudo-passwordless writes /etc/sudoers.d/99-omarchy-nopasswd-<user> containing <user> ALL=(ALL) NOPASSWD: ALL and arms a transient systemd-run --on-active=<minutes>m timer to delete that file, 15 minutes by default when no argument is given. A sudoers rule is scoped to the user, not to the process that asked for it, so every process already running as that user, a browser tab, a background daemon, a compromised dependency, can run sudo with no password for the whole window. The script's own confirmation prompt says this before you agree, printing the number of minutes in place of ${MINUTES}: "This will allow ANY process running as your user to" "execute ANY command as root WITHOUT a password for ${MINUTES} minutes." and "Anyone or anything with access to your user account gets full root." On 4.0.2-1 and earlier the timer is the only thing that ends the grant on its own, and it is a transient unit that does not survive a reboot while the sudoers file does. The 4.0.2-1 script says so after enabling: "Note: if you restart before then, run omarchy-sudo-passwordless again to disable it." On 4.0.3 and later, 4.0.4-1 included, the grant also ends at the next boot, because /etc/tmpfiles.d/omarchy-nopasswd-sudo.conf removes any 99-omarchy-nopasswd-* file during boot, and the script revokes the grant at once if it cannot arm the timer. The 4.0.4-1 script says after enabling: "A restart removes the passwordless sudo rule as well." Neither change narrows the grant. While it lasts it is still NOPASSWD: ALL for every process running as that user.
Fix
Treat the window as a full root session for the account, not a scoped grant for one tool. Ask for the fewest minutes the task actually needs rather than accepting the 15-minute default:
omarchy-sudo-passwordless 2
Turn it off the moment the task finishes instead of waiting out the timer. While the grant is live, running the command with no argument removes the sudoers file and stops the timer:
omarchy-sudo-passwordless
If the machine rebooted while a grant was live on 4.0.2-1 or earlier, the timer is gone and the sudoers file is still there. Delete it directly. Removing a drop-in from /etc/sudoers.d/ cannot lock you out, because the wheel rule that gives you sudo lives in /etc/sudoers, and this never involves editing a sudoers file by hand:
sudo rm -f /etc/sudoers.d/99-omarchy-nopasswd-$USER
Running omarchy-sudo-passwordless after the reboot also removes the stale file, but it then falls through to the enable prompt, and that gum confirm prompt selects Yes by default, so pressing Enter hands out a fresh 15-minute grant. Answer No if you go that way.
Then update. The change that removes leftover grants during boot shipped in 4.0.3, and the stable package repository carried 4.0.4-1 on 2026-09-18:
omarchy update
Verify
List the expiry timer while the grant is live. It shows when it will fire:
systemctl list-timers 'omarchy-nopasswd-expire-*'
An empty list does not prove there is no grant: after a reboot on 4.0.2-1 the timer is gone and the file remains. Check for the file itself, which needs root because /etc/sudoers.d is mode 750:
sudo ls /etc/sudoers.d/ | grep 99-omarchy-nopasswd
No output means no grant file exists. On 4.0.3 and later, confirm the boot-time cleanup rule is installed:
cat /etc/tmpfiles.d/omarchy-nopasswd-sudo.conf
Sources
- https://github.com/omacom/omarchy/blob/d2a4cc0c4d60cd3bce866f65643f89f7d2978d5e/bin/omarchy-sudo-passwordless
- https://github.com/omacom/omarchy/blob/945af75aa2c0bf5b40a0155500f0774f06db6721/bin/omarchy-sudo-passwordless
- https://github.com/omacom/omarchy/blob/945af75aa2c0bf5b40a0155500f0774f06db6721/etc/tmpfiles.d/omarchy-nopasswd-sudo.conf
- https://github.com/omacom/omarchy/pull/9387
- https://github.com/omacom/omarchy/releases/tag/v4.0.3
- https://github.com/omacom/omarchy/blob/c668141e9c42b13c80c9ca4ea108e11708c5e8a5/bin/omarchy-sudo-passwordless
- https://github.com/omacom/omarchy/blob/c668141e9c42b13c80c9ca4ea108e11708c5e8a5/etc/tmpfiles.d/omarchy-nopasswd-sudo.conf
- https://pkgs.omarchy.org/stable/x86_64/omarchy.db
- https://github.com/omacom/omarchy/blob/c668141e9c42b13c80c9ca4ea108e11708c5e8a5/test/shell.d/nopasswd-sudo-expiry-test.sh
- https://github.com/omacom/omarchy/pull/7990
- https://github.com/omacom/omarchy/commit/b9657b631361ccbece50d0ecc278be7ad2f6cd22
- https://github.com/charmbracelet/gum/blob/4d089f95507708a71f64dacfe7ca513219dd5267/confirm/options.go