Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Run as Root - safe one-command sudo for AI agents

    1

    Your agent runs one command as root through the Linux desktop's own polkit dialog — you approve the exact command, and it never sees your password.

    Free

    1 useSecurity scanned
    Run as Root - safe one-command sudo for AI agents

    Run as Root - safe one-command sudo for AI agents

    Example session with this skill installed

    I'm setting up this project but the build just failed with "Permission denied" when it tried to install build-essential. Can you install the build tools for me?

    • Read your context and instructions
    • Compiled the run as root

    I need root to install those packages, so I'll use the

    run-as-root skill — you'll approve the exact command in your desktop's password dialog, and I never see your password.

    First I confirmed you're at a local graphical session (this skill refuses to run otherwise):

    Type=x11   Active=yes   Remote=no   ✓
    

    A password dialog is about to open. Here is exactly what it will show:

    Root command: /usr/local/bin/run-as-root
    Why: Install the build tools
    Command: /usr/bin/apt-get install -y build-essential
    
                            [ Cancel ]   [ Authenticate ]
    

    The command I ran

    timeout 180 pkexec /usr/local/bin/run-as-root \
      $'\nWhy: Install the build tools\nCommand:' \
      /usr/bin/apt-get install -y build-essential
    

    Result: you authenticated, exit code 0.

    Reading package lists... Done
    Building dependency tree... Done
    The following NEW packages will be installed:
      build-essential dpkg-dev g++ gcc make ...
    Setting up build-essential (12.9ubuntu3) ...
    

    ✅ Build tools installed. The run was recorded to the audit trail — review it anytime with journalctl -t run-as-root. Re-running your build now.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Coding agents constantly hit commands that need root — apt install, systemctl, writing to /etc. The usual answers are all bad:

    • Give the agent your password (sudo -S, an askpass script) — the agent now holds your password.
    • Passwordless sudo (NOPASSWD) — the agent has permanent, invisible root.
    • Stop and make you run it — breaks your flow, and you paste commands without reading them.

    What it does

    run-as-root gives the agent a fourth option: escalate one command at a time through your desktop's own polkit password dialog.

    • The dialog shows the agent's stated reason and the true command line.
    • You type your password into the operating system's prompt — never into the agent.
    • The password travels polkit's own path (authentication agent → polkit-agent-helper-1 → polkitd). No part of the agent's code touches it.
    • Every run is written to the authpriv audit log with the full command.

    Why this beats the alternatives

    MethodProblemrun-as-root
    Password to the agentAgent holds your secretAgent never sees it
    NOPASSWD sudoPermanent, invisible rootOne command, one dialog, logged
    Hand it back to youBreaks flow; blind pasteYou approve the exact command inline

    Use cases

    • Let an agent install build dependencies, drivers, or packages mid-task.
    • Approve systemctl, mount, usermod, or writes to /etc, /usr, /opt.
    • Keep a full, reviewable audit trail of everything an agent ran as root.

    Known limitations

    • Linux desktop only (X11 or Wayland) with a running polkit agent.
    • Tested on Linux Mint 22.3 / Cinnamon / polkit 124; other desktops and distros use standard polkit and should work, but are untested.
    • Not for headless servers, SSH, containers, CI, cron, WSL, macOS or Windows — the skill detects these and hands the command back instead.
    • You must already be an administrator (sudo/admin/wheel). It grants no new privilege — the same power as sudo, and not more.

    How to install

    1. Add the skill: npx skills add govarthenan/run-as-root
    2. Install the system helper yourself, in your own terminal: sudo bash ~/.claude/skills/run-as-root/install.sh
    3. Remove anytime: sudo bash ~/.claude/skills/run-as-root/uninstall.sh

    MIT licensed. Author: Govarthenan Rajadurai.

    Linux desktop only. No support for headless servers, SSH, CI, or containers. Requires a local user at the screen to answer the polkit dialog.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    • Free with an Agensi account

    Requires

    Node.js
    macOS

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill eliminates 'broken terminal' errors by offloading authentication to the OS. It uses the native Linux polkit dialog to securely prompt you for your password on the desktop, preventing the AI from hanging on hidden sudo prompts or seeing your sensitive credentials.

    This skill is designed specifically for local Linux desktop environments (X11 or Wayland) that utilize polkit. It is not compatible with Windows, macOS, or remote sessions like SSH and Docker, as it requires a local graphical user session to trigger the password dialog.

    You will receive the 'run-as-root' helper script, the core agent skill logic, and a setup guide. The package includes everything needed to bridge your AI agent's commands to the system's native authentication framework.

    Setup requires a one-time manual installation of the provided helper script on your Linux machine. Once installed, your AI agent will be able to detect the script and use it to trigger secure escalations automatically whenever a task requires root privileges.

    The skill is designed to be framework-agnostic and works with any AI agent capable of executing local shell commands. It has been tested for compatibility with common agent architectures that support custom tool calling or external script execution.

    New in DevOps & Cloud