Files
hermes-agent/website/docs/reference
unsupportedpastels 2570a16785 fix(terminal): log a one-time note when a sudo password goes to a non-local backend
A sudo password (SUDO_PASSWORD, terminal.sudo_password or the interactive
prompt cache) is sent to whichever terminal backend runs the command. For
container, cloud sandbox, SSH and plugin backends, programs running in that
backend can read it there. Hermes sent it without saying so.

BaseEnvironment._prepare_command, which every backend goes through (managed
Modal included), now passes its result to
tools/environments/sudo_password_note.note_sudo_password_sent. The first time
a non-empty password is sent to a backend whose is_local is False, it logs one
WARNING per process per backend class, naming the backend (derived from the
class name, e.g. docker, ssh, vercel_sandbox) and advising a password that is
only valid there, or passwordless sudo in that environment's image. The
password itself is never logged. A lock guards the once-only state. Which
backends receive the password, the command text and the sudo stdin are all
unchanged.

The sudo docs in tools.md, cli-config.yaml.example and .env.example, and the
SUDO_PASSWORD row in the environment variable reference, now give the same
advice.

Tests (tests/tools/test_sudo_password_backend_note.py) go through real
execute / _prepare_command calls with a cached password: a non-local backend
logs exactly one warning across two commands, docker and ssh each log their
own, LocalEnvironment, a command without sudo, no password and an empty
password log none, and the message never contains the password. A control
test checks that the command text and stdin match the base output for
docker, ssh and local.
2026-11-13 13:18:51 -05:00
..
…