Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
ADR 0293: SSH password authentication for the remote-host bootstrap
- Status: Accepted (D454; amends ADR 0292, whose no-SSH-secret clause is narrowed to the default key/agent path)
- Date: 2026-09-19
- Related: D373, D449, D454, ADR 0205, ADR 0286, ADR 0292
Context
ADR 0292 bootstraps a pi-host by shelling out to the system ssh client with
BatchMode=yes enforcing that the app holds no SSH secret, but that does not cover a
fresh cloud instance, NAS, or container host reachable from a terminal after one
password prompt — the user would have to install a key first, which is the detour the
bootstrap exists to remove. Accepting a password means the app holds a secret, so the
decision is what shape that takes.
Decision
- Password auth is opt-in and a key or agent stays the default: absent credentials the
argv is byte-for-byte what ADR 0292 produced,
BatchMode=yesincluded. - The secret reaches
sshthrough OpenSSH's own askpass helper (remote/ssh-askpass.ts):SSH_ASKPASSnames a generated/bin/shscript andSSH_ASKPASS_REQUIRE=forcemakessshuse it without a terminal, with the script reading the secret from a0600file in a0700mkdtempdirectory, so the secret is never ansshargument or environment value. - Password mode alone sets
BatchMode=nowithNumberOfPasswordPrompts=1andPubkeyAuthentication=no: the helper answers every prompt with the same secret, so a retry could only repeat a wrong password and trip a server lockout. - The credential is short-lived: material is written just before a child authenticates
and deleted once it cannot still be prompting — after an
exec/execWithInputchild closes, after a forward's local port is up, or ondispose— with a reference count keeping a shared copy alive across concurrent children. - The password is persisted encrypted:
RemoteHostRecord.sshSecretis written asencryptedSshSecretthrough the samesafeStorage-backedEncryptionPortthe device token uses, andmetadata.sshgainsauth: "password"as its only new value, so key descriptors and earlier records keep their shape. - The secret never reaches the renderer:
RemoteHostSshMetadatastays secret-free by construction, the password travels beside it from the IPC request intoSshTarget.passwordand back out asSshBootstrapOutcome.sshSecretfor the caller to encrypt, andRemoteHostSummaryis unchanged. - A password that cannot work is refused before anything runs:
assertSshPasswordrejects a line break withINVALID_ARGUMENTbecause it cannot survive the askpass round trip, Windows is refused withHOST_BOOTSTRAP_FAILEDnaming the remedy, and a host recorded asauth: "password"without a usable secret reports as disconnected rather than as a rejected login. - The Settings SSH form gains an authentication mode with a masked password field and reveal toggle, states that the password is saved in the OS keychain so the host reconnects after a restart, and the copy promising no password was ever stored is replaced in all shipped locales.
Consequences
- The desktop can now be trusted with an SSH password — a real widening, bounded by being opt-in per host, encrypted with the existing store, and never exposed to the renderer, the process table, a URL, or a log line.
remote-hosts.jsongains an optionalencryptedSshSecretandmetadata.ssh.auth; both are additive and the file version stays1.- A host whose only credential is a password can be bootstrapped, removing the terminal
detour; nothing but the system
sshclient consumes the secret, and a malformed descriptor degrades to "not an SSH host".
Alternatives
sshpassorSSH_ASKPASSwith the secret in the environment: a third-party dependency that exposes the secret to anything reading process state.- Store the password unencrypted in
metadata: plaintext, user-editable, and outside the keychain.