setup_install_polkit_rule
Install or remove a Linux polkit rule that auto-approves dependency installation prompts for whitelisted tools, requiring only one password entry for setup. Thereafter, installs run silently.
Instructions
Install or remove the Linux polkit auto-approve rule that lets install_dependency run without prompts. CRITICAL ONE-TIME SETUP for the agent-native install flow on a fresh machine: triggers a single pkexec password prompt for THIS call (the user types their password once); thereafter every install_dependency call for a whitelisted tool (wtype/ydotool/wl-clipboard/xdotool/ffmpeg) runs prompt-free. Uses subject.active so the rule applies to any logged-in user on the machine (not hardcoded to a single account). Linux only — returns 501 on macOS/Windows.
Recommended flow:
run_diagnostics — see if install_polkit_rule check is warning
setup_install_polkit_rule({enable: true}) — user types password once
install_dependency({tool: "wtype"}) — silent install, no prompt
Pass enable=false to remove the rule (also triggers a polkit prompt).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enable | Yes | true to install the rule, false to remove it. |