# How I Let My AI Coding Agent Run sudo on My Linux Box Without Pasting Into a Terminal

DevFeed: [How I Let My AI Coding Agent Run sudo on My Linux Box Without Pasting Into a Terminal](<https://devfeed.tech/articles/how-i-let-my-ai-coding-agent-run-sudo-on-my-linux-box-without-pasting-into-a-terminal-25174.md>)

Original publisher: [Read original article](<https://www.ivanmorgillo.com/2026/06/16/ai-coding-agent-sudo-pkexec-asroot-linux/>)

Author: Ivan Morgillo

Published: 2026-06-16T14:30:00Z

Content type: tutorial

Language: en

Sources: [Ivan Morgillo](<https://devfeed.tech/sources/ivan-morgillo.md>)

Topics: [ai-coding](<https://devfeed.tech/topics/ai-coding.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Security](<https://devfeed.tech/topics/security.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [coding](<https://devfeed.tech/tags/coding.md>), [commands](<https://devfeed.tech/tags/commands.md>), [linux](<https://devfeed.tech/tags/linux.md>), [password](<https://devfeed.tech/tags/password.md>), [security](<https://devfeed.tech/tags/security.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

## AI overview

This tutorial describes a reusable asroot helper that lets an AI coding agent run root commands on Linux through pkexec and polkit's graphical password dialog. The user approves each elevation in the native OS prompt, keeping the password out of the agent's chat and avoiding temporary scripts or pasted sudo commands.

## Source excerpt

Letting an AI coding agent run root commands on Linux without pasting sudo into a terminal -- a tiny reusable asroot helper built on pkexec and polkit's graphical password dialog.