Skip to main content

Telegram-approved temporary broad NOPASSWD sudoers window for personal macOS agents

Project description

sudo-request

sudo-request v1 is a personal macOS tool for agent workflows that get blocked by sudo prompts.

It does not emulate sudo -v and it does not store a sudo password. A root daemon waits for Telegram approval, then briefly installs a broad sudoers exception for the requesting local user:

USER ALL=(ALL) NOPASSWD: ALL

The original command is still executed by the user-level CLI, not by the root daemon.

This is intentionally broad. While the window is open, any same-user process can use passwordless sudo. v1 is for personal development machines, not multi-user or managed security environments.

Commands

sudo-request run -- <command> [args...]
sudo-request status
sudo-request cancel <request-id>
sudo-request doctor
sudo-request daemon --foreground
sudo-request update-itself [--source <checkout>] [--window-seconds N]
sudo-request cleanup
sudo sudo-request install
sudo sudo-request uninstall
sudo sudo-request install-daemon
sudo sudo-request uninstall-daemon

Install

install is the low-level root operation. update-itself is the normal approval-based way to refresh an installed copy from a source checkout.

From this source checkout:

sudo uv run sudo-request install

After the package is published, a package-based install can also be started from an installed or ephemeral package command:

sudo uvx --from sudo-request sudo-request install

This copies the tool to /usr/local/libexec/sudo-request, writes a PATH wrapper at /usr/local/bin/sudo-request, and installs a launchd daemon.

After install:

sudo-request doctor
sudo-request run -- /bin/echo ok

Reinstall from the checkout when the installed copy should be updated:

uv run sudo-request update-itself

If running from the installed command instead of the source checkout, pass the checkout explicitly:

sudo-request update-itself --source <absolute_path_to_sudo-request_checkout>

During reinstall the daemon may restart before the CLI can send its final close request. If cleanup already happened, this is reported as:

sudo-request: error status=daemon_unreachable request_id=<id> action=close_request broad_rule=not_installed error_type=<error> message=<detail>

See docs/operations.md for the detailed update flow, post-update verification, and sudo-request command patterns.

Uninstall:

sudo sudo-request uninstall

Config

Create ~/.config/sudo-request/config.toml:

telegram_bot_token_file = "~/.config/sudo-request/telegram_bot_token"
telegram_allowed_user_ids = [123456789]
approval_timeout_seconds = 90
approval_wait_heartbeat_seconds = 10
broad_window_seconds_default = 30
broad_window_seconds_max = 300

Put the Telegram bot token in:

~/.config/sudo-request/telegram_bot_token

Development

uv run sudo-request doctor
uv run python -m unittest discover -s tests
scripts/e2e-smoke.sh

Common local workflows are also available through Task:

task --list
task release:check
task install-source
task verify-installed
task uninstall

Detailed project-maintenance docs live under docs/:

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sudo_request-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sudo_request-0.1.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file sudo_request-0.1.0.tar.gz.

File metadata

  • Download URL: sudo_request-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sudo_request-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ab2acba71b2ac5ae7c4bd318eab196bc1dc88a92997fcd8812d679459b4af28
MD5 c74d7efe540812d562c4c61fc625fc52
BLAKE2b-256 0e9f8113751305d84561e44cb1eb36c4decd75b3945aafc259d0dc1ce0a09724

See more details on using hashes here.

File details

Details for the file sudo_request-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sudo_request-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sudo_request-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4d4b89bea086cea90eb9b7304f5b4a286bf9622d3e7a98df21228d3ff04b0e9
MD5 e1e57ed730716e4571cfdcfb6b735ca0
BLAKE2b-256 761cbd5267f664ae429067244121a993724fae3778b43af81107f5647761165a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page