mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
devvm set SSH_AUTH_SOCK process-wide from the finder's inspect, each start and a new VM's plan, so later limactl calls and every background process devvm spawned got whichever VM's agent was set last: a run that reached several VMs (a group's sync, a link's change) could hand one VM another's agent, and ssh-add -l checked the wrong agent. - vm: Env.useAgent is gone; Env.agentSocket maps a choice to its socket (devvm's, the user's from Environ, or none). The finder's found carries agent, set by inspect and by bringUp from the confinement it returns; found.exec passes it. start sets Confinement.AgentSocket for every mode, runningConfinement takes the running mode and sets it too, and the sync, devcontainer commands, --clone's seed, home copy, export, desktop and the shell carry it. - backend: ExecOpts.Agent, ShellOpts (Shell takes it), AgentSocket "" means none; the backend never reads devvm's SSH_AUTH_SOCK. - lima: limactl removes SSH_AUTH_SOCK from every command; Exec, Shell and start (confine) set the VM's own; a degraded start's check carries it. - daemon: Spawn drops SSH_AUTH_SOCK from the child environment. - Guard: forbidigo bans os/syscall Setenv, Unsetenv and Clearenv outside tests and daemon/status.go; testdata/lint breaks it. - Tests: TestAgentPerVM (two VMs, devvm's and the user's, in one run), TestDetach (no agent), TestExecAndShell and TestProfileAgent (Lima's per-command env), TestUpSSHAgent and TestOpenAgent check the shell's and Exec's agents and that devvm's environment stays as it started. - Docs: internals/security.md (how the agent travels), contributing's forbidigo list and owners table. Co-Authored-By: Claude Opus 5.5 <[email protected]>