sudo-proxy

io.github.tarides由 GitHub 帳號 tarides 發布v1.2.0更新於 Oct 26, 2026

Privileged command execution proxy with human approval via pkexec or sudo

概覽

AI 產生的概覽

讓 AI 助理透過 sudo 執行特權或遠端指令,每道指令都需人工按鍵核准,且不儲存任何憑證。

可以做什麼
  • 啟動與停止特權指令服務,可在本機或經 SSH 通道在遠端主機上執行
  • 以明確的 argv 執行指令,每道指令都在終端提示中由人工核准或拒絕
  • 查詢服務狀態並更新已設定的主機清單
  • 開啟詳細日誌時記錄每次請求,形成稽核紀錄
適用情境
當助理需要安裝套件、修改系統檔案、管理服務或在遠端主機上執行指令,而你希望即使關閉了助理本身的權限提示,每道指令仍由人工確認時使用。
執行需求
以 stdio 本機程序執行;需透過 cargo install 或 cargo binstall 安裝 sudo-proxy 執行檔(需 Rust 工具鏈,或使用預先編譯的靜態執行檔),並確保 sudo-proxy-mcp 位於 PATH 中。需要終端顯示核准提示並具備 sudo 權限;遠端使用需要 SSH。未宣告任何 API 金鑰或環境變數。
安裝前請注意
它授予真實的 root 等級權限而非沙箱:被核准的指令可以變更或刪除本機或遠端主機上的任何內容。核准只需按一次鍵,務必仔細閱讀顯示的指令;沒有自動核准模式,也沒有政策引擎。sudo 密碼在終端中即時輸入且不儲存。專案自述尚未經過獨立稽核,其安全保證為自行提出。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 sudo-proxy,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

sudo-proxy

[tarides/sudo-proxy MCP server]

[Repository]

An MCP server that lets an agent run privileged, mutating commands — locally or over SSH — with a human keypress required on every one and no credential ever stored.

Privileged command execution proxy with an MCP server for AI agent integration. Receives requests over a Unix socket, shows a single-keypress TUI prompt for human approval, then escalates via sudo. Configure sudo-proxy-mcp in Claude Code or any MCP client and the model can run privileged commands — with explicit human approval on every one.

⚠️ Not yet independently audited. The security assurance in this repo is self-produced. Security reviewers: REVIEWING.md is a 15-minute on-ramp — the falsifiable claims, the trust boundary, and where we have no assurance. Reporting: SECURITY.md.

Architecture

AI model ──► sudo-proxy-mcp ──► Unix socket ──► sudo-proxy ──► TUI Y/N ──► sudo             (MCP server)         │                                  │                            local socket, or SSH tunnel                        (start_server spawns sudo-proxy --host                         which sets up the tunnel and remote                         server)

The TUI prompt asks for approval (single keypress), then sudo handles privilege escalation. The password prompt appears in the same terminal. This flow is identical for local and remote hosts. A non-privileged mode runs commands directly as the current user, still behind the same Y/N gate — see docs/usage.md.

Why not just use the Bash tool?

Bash toolsudo-proxy MCP
Privilege escalationNot possiblesudo with human approval
Human reviewNone — executes immediatelyTUI Y/N gate on every command (privileged and unprivileged)
TimeoutUp to 10 min, no user prompt60 s TUI prompt + configurable overall timeout
Remote hostsNot supportedSSH tunnel with TUI on remote terminal
EnvironmentInherits shell envSanitized allowlist only
Audit trailNoneServer logs each request (with -v)

sudo-proxy fills the gap when a model needs to install packages, edit system files, manage services, or run any other command — with the human always in the loop, even when Claude Code is run with --dangerously-skip-permissions.

It is deliberately not a way to run unprivileged commands with less scrutiny than the Bash tool: an unprivileged command targeting the local machine is refused and delegated back to the Bash tool (which already applies your permission rules), and loopback aliases like 127.0.0.1 cannot dodge that. sudo-proxy handles privilege escalation and commands on remote hosts; there, unprivileged commands are gated the same way, and the per-command gate is only relaxed if you deliberately mark a host eligible in hosts.json and confirm once per session (a grant that is never persisted). See REVIEWING.md invariant G7.

For how this relates to mcp-firewall, sandboxing, polkit, doas, and other neighboring tools, see docs/comparison.md.

Features and non-features

What sudo-proxy does:

  • Per-command human approval — a single-keypress Y/N TUI gate on every command, privileged and unprivileged, with no way to bypass it.
  • Real privilege escalation via sudo — installs packages, edits system files, manages services; not limited to read-only diagnostics.
  • Local and remote over one flow — the same approval TUI whether the command runs on this machine or on a remote host over an SSH tunnel.
  • Stores no secret — the sudo password is typed live into the terminal; nothing is cached, encrypted-at-rest, or written to disk.
  • Explicit argv — commands are passed and displayed exactly as they run, with no shell-string interpolation.
  • Sanitized environment — a fixed allowlist, not the inherited shell environment.
  • Audit trail — each request is logged by the server (-v).
  • Works under --dangerously-skip-permissions — the human gate holds even when the agent's own permission prompts are disabled.

What sudo-proxy deliberately does not do:

  • No stored or managed credentials — it is not a password cache or a secrets manager.
  • No unattended execution — there is no auto-approve mode; a human approves each command or it does not run.
  • Not a sandbox — it grants real privilege rather than isolating or faking it.
  • Not a policy engine or ACL — the human at the keypress is the policy; there are no rules to write or maintain.
  • Not read-only — it is not restricted to a whitelist of safe diagnostic commands.
  • No hosted service — it runs on your own machine; commands never transit a third-party relay.
  • Not a general remote shell — no persistent interactive sessions, SFTP browser, or fleet manager; just gated one-shot commands.

Quickstart

Install the binaries (needs a Rust toolchain; prebuilt static binaries are on Releases):

bash
cargo install sudo-proxy

Or fetch the prebuilt static binaries without compiling, via cargo binstall:

bash
cargo binstall sudo-proxy

cargo binstall downloads the release tarball from GitHub and verifies its minisign signature (public key RWT7gwtBU0v4puI76u0oYwMAT9nmYwGimSOnqJJ+kHExsjTDQj1eZkMW, key ID A6F84B53410B83FB) before installing; a missing or bad signature aborts the install. Prefer cargo install if you'd rather build from source.

Point your MCP client at the server — add to the project's .mcp.json or ~/.claude/claude_desktop_config.json:

json
{  "mcpServers": {    "sudo-proxy": {      "command": "sudo-proxy-mcp"    }  }}

Install as a Claude Code plugin

The repo is also a Claude Code plugin and its own marketplace. Instead of editing .mcp.json by hand:

/plugin marketplace add tarides/sudo-proxy/plugin install sudo-proxy@tarides

The plugin registers the sudo-proxy MCP server and ships a skill that tells the model to reach for sudo-proxy only for privileged or remote work, to start the server before executing, and to write a clear description for each command so the approval prompt is easy to judge. It does not install the sudo-proxy-mcp binary — that must already be on your PATH (see the cargo install / cargo binstall steps above). A tool whose whole point is explicit human consent should not install itself silently.

Run commands

Then the model starts a server (opening a terminal with the approval TUI) and runs commands through it:

jsonc
start_server()execute({"argv": ["apt", "install", "nginx"], "description": "Install nginx"})

Each execute shows the exact command in the TUI; press y to approve, N (default) to deny. For remote hosts, pass host to start_server and execute.

When a prompt appears, the TUI rings the terminal bell and blinks the question line so a request is not missed while the daemon's terminal is unfocused or off-screen. The bell honors the terminal's own visual-bell/urgency setting (audible beep, taskbar/dock flash, or both). Both cues are on by default; set SUDO_PROXY_NO_BELL to silence the bell and SUDO_PROXY_NO_BLINK to stop the blink (same opt-out style as NO_COLOR).

MCP Registry

Listed in the official MCP Registry as mcp-name: io.github.tarides/sudo-proxy.

Documentation

AI-assisted development

sudo-proxy was developed with substantial AI assistance using Claude Code. Commits where AI contributed materially carry a Co-Authored-By trailer naming the specific model. All design decisions, threat modeling, and the final form of every committed change were reviewed and approved by the human maintainer, who takes responsibility for the codebase.

This disclosure is provided in line with emerging industry practice around transparency about generative-AI involvement in software development. It is not a statement that the project is "AI-generated": the human-in-the-loop principle that the tool itself enforces at runtime is also the principle under which it was built.

License

MIT

來源:README.md,提交 f42ce06

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v1.2.0最新Oct 2, 2026
  2. v1.1.0Sep 22, 2026
  3. v1.0.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分