From 2a9c1609ae643737de729fa95cee9884ce01b730 Mon Sep 17 00:00:00 2001 From: lobo235 <7@netlobo.com> Date: Thu, 18 Jun 2026 20:38:35 -0600 Subject: [PATCH] Clarify agent sudo handling --- AGENT_INSTALL_PROMPT.md | 9 +++++++-- README.md | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AGENT_INSTALL_PROMPT.md b/AGENT_INSTALL_PROMPT.md index b0beb3c..60d5e48 100644 --- a/AGENT_INSTALL_PROMPT.md +++ b/AGENT_INSTALL_PROMPT.md @@ -33,6 +33,10 @@ Operating rules: - Treat --post-install-script as advanced and risky; only use a script that I wrote, reviewed, and explicitly selected. - Keep backups of anything important before destructive work. - Review diagnostic reports before sharing them. Do not publish raw hardware identifiers, DNS domains, IP addresses, SSH keys, shell history, full journals, or unreviewed private configuration. +- Do not assume passwordless sudo. Never ask me to type, paste, or reveal my sudo password in chat. +- If your environment supports interactive sudo prompts, run sudo commands normally and let the terminal/UI prompt me directly. +- If your environment cannot handle interactive sudo, print the exact sudo command I should run in my own terminal, wait for me to paste back the output or confirm completion, and then continue. +- If sudo authentication times out mid-install, pause and ask me to rerun the exact command or re-authenticate in the terminal. Do not work around sudo by weakening system security. Start by determining: 1. Am I on native Linux or WSL2? @@ -73,6 +77,7 @@ Check dependencies before install: - On Ubuntu/Debian hosts, the usual package set is: sudo apt install gdisk dosfstools e2fsprogs rsync util-linux udev coreutils findutils - If tests are requested, shellcheck is optional. +- If installing dependencies needs sudo and sudo is not passwordless, either let the terminal prompt me directly or give me the exact apt command to run myself. Once the basic required information is known, tell me: "I have enough information to run a safe dry-run. Before I do, do you want to consider advanced options?" @@ -94,12 +99,12 @@ If I say yes, present these advanced options and ask which, if any, I want: Dry-run flow: - Build the dry-run command using the selected ISO/source, target by-id path, --user, --prompt-password, --expect-serial, and any selected advanced options. -- Run the dry-run. +- Run the dry-run if you can handle sudo interactively; otherwise show me the exact dry-run command and ask me to run it. - Show me the install plan and explicitly identify the target disk that will be erased, including model, serial, size, transport, and current mountpoints if available. - Ask for confirmation before the real install. Real install flow: -- Run the same command without --dry-run. +- Run the same command without --dry-run only if you can handle sudo interactively; otherwise show me the exact real install command and ask me to run it in my terminal. - Let the script's exact destructive confirmation protect the target unless I explicitly asked for --yes after reviewing the dry-run. - Watch for errors. - After install, verify from the host: diff --git a/README.md b/README.md index 7899457..c90bdc4 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,13 @@ This script is destructive. It repartitions and formats the target disk. If you want Claude Code, Codex, OpenCode, or another local coding agent to walk you through the install, paste this into the agent: ```text -Help me install Ubuntu 26.04 Desktop amd64 onto an external drive using https://github.com/lobo235/ubuntu-external-install. Download the repository, read AGENT_INSTALL_PROMPT.md and SECURITY.md, and follow them exactly. Ask me the required questions one at a time, identify the target disk safely, run a dry-run first, use the safest target guards available, and do not run destructive commands until I explicitly confirm the dry-run plan. +Help me install Ubuntu 26.04 Desktop amd64 onto an external drive using https://github.com/lobo235/ubuntu-external-install. Download the repository, read AGENT_INSTALL_PROMPT.md and SECURITY.md, and follow them exactly. Ask me the required questions one at a time, identify the target disk safely, handle sudo/password prompts without asking me to reveal passwords in chat, run a dry-run first, use the safest target guards available, and do not run destructive commands until I explicitly confirm the dry-run plan. ``` The full agent prompt lives in [`AGENT_INSTALL_PROMPT.md`](AGENT_INSTALL_PROMPT.md). +The agent-guided flow does not require passwordless sudo. If your agent cannot handle interactive sudo prompts, it should prepare exact commands for you to run in your own terminal. + ## Supported Scope Tested: