# Lend keeps coding-agent credentials on a user's Mac behind per-request approval
A developer has described a tool called Lend that allows coding agents running on remote virtual machines to use authenticated tools on a local Mac without copying the underlying credentials to the remote environment. The design keeps SSH keys, password-manager data and logged-in command-line tools on the laptop while sending approved command output back to the agent.
The author says the system grew from a workflow in which several agents run simultaneously on disposable or persistent remote virtual machines. That separation limits what is stored on the machines, but it creates a practical problem whenever an agent needs to inspect continuous-integration results, use an authenticated GitHub command or reach another host over SSH. Copying tokens to the VM gives every process there an opportunity to read them, while ordinary SSH-agent forwarding can make all loaded keys usable without a separate approval record.
Lend instead places a proxy in front of the user's existing SSH agent. The proxy can carry normal SSH signing requests and a command-running extension. When a remote agent asks to run a permitted command, the command executes on the laptop, where the relevant login already exists. The remote side receives standard output, standard error and an exit code, but not the credential itself.
Authorization remains local. A policy file on the Mac names the commands the VM may request and can narrow permission to argument prefixes, such as particular subcommands. Requests outside the policy are denied. Allowed requests still require user approval, and the author describes an option to place Touch ID confirmation directly in the approval dialog. That dialog displays the executable path, arguments, working directory and the agent's stated reason, while marking remote-supplied identity details as unverified.
The tool can be exposed to an agent through a small MCP server with one local-command tool, or invoked from a remote command line. The author also documents a reconnect problem: forwarded sockets change when SSH reconnects, so a private, fixed-path symbolic link on the VM is updated by an SSH hook after the new connection is validated. Existing processes may need restarting once to inherit that stable path.
Lend does not make remote execution automatic or continuously available. Requests fail when the laptop is disconnected, a new connection starts a fresh session, and the last validated connection owns the link. Those limits reflect the project's central security choice: privileged actions remain tied to an online, user-controlled machine and an explicit local policy.
For commands that require an environment token, the local rule may retrieve it from a password manager and inject it only into the approved local process. The remote VM cannot choose the secret reference, and the value is not returned in prompts or history. The result is a narrowly mediated workflow rather than a general transfer of user authority to the agent.


![500px provided description: Anohter Laptop With Cool Free Software Stickers At Guadec [#stickers ,#2015 ,#Tech ,#GNOME ,#FOSS ,#Open Source ,#Free Software ,#GUADEC ,#Confrance]](/media/articles/commons-e039f8ff3448.avif)
