Learn how to securely use remote coding agents without sharing your credentials through innovative tools and policies.
As the landscape of software development evolves, so too do the tools that assist developers in their workflows. One of the most exciting advancements has been the rise of coding agents. These agents can perform various tasks, streamline processes, and even collaborate with other agents. However, there's a significant challenge associated with using these agents — how to protect sensitive credentials effectively. In this article, we will explore how to run coding agents without exposing your credentials, using a tool known as lend coupled with innovative practices.
Coding agents have become instrumental for developers, providing tailored solutions for numerous tasks. As I have integrated these agents into my toolchain, I frequently employ multiple agents to manage different projects simultaneously. For instance, I might have Claude Code reviewing one branch, while Codex assesses another, all hosted on virtual machines that can be disposed of when no longer needed. This toolkit allows me to keep sensitive information—like SSH keys or my 1Password vault—securely on my laptop rather than exposing it to potential vulnerabilities on remote servers.
My agents run on pico.sh, a hosting service that supplies individual VMs equipped with a Docker engine and SSH access. This setup enables my home directory to persist across disconnections, allowing for easy access to tools and configurations.
The primary challenge with deploying coding agents in a secure manner is ensuring that they can perform the necessary tasks while keeping sensitive credentials safely on your laptop. Traditionally, developers have approached this challenge with two common methods: copying credentials onto the VM or using SSH agent forwarding. However, both options carry significant risks.
When you copy credentials to the VM, they become accessible to any process running on that machine. Alternatively, while SSH agent forwarding allows you to keep your private keys secure on your laptop, it enables the VM to execute any commands that require SSH authentication without validation or oversight.
To address these challenges, I developed lend: a proxy service that facilitates controlled access to your SSH agent and enables remote agents to act as you without gaining direct access to your credentials. With lend, requests for sensitive operations are communicated back to the laptop, where they can be approved, ensuring that all interactions require explicit permission.
The operational flow is straightforward. When an agent within the VM needs to execute a command, the request is forwarded through the lend proxy where it is then validated against a permission policy established on your laptop. This policy dictates what commands the remote agents can request.
For example, to connect to a VM, you utilize the command lend ssh, which starts a proxy connection. Once this connection is established, commands requested by agents on the VM are sent to the appropriate process on your laptop for execution, enabling them to leverage your existing session securely.
The power of lend lies in its sophisticated permissioning capabilities. The policy can be tailored to allow different commands or operations, enabling you to control access tightly. For example, if a coding agent requests access to your GitHub account, the request must include a reason which is displayed when you approve. This means you are aware of the implications of every command executed through lend.
Additionally, lend allows for the establishment of temporary leases on specific commands. For instance, you may decide to grant a remote agent permission to run a command up to five times within a set timeframe. This limits the exposure of sensitive credentials while providing substantial flexibility in operations.
Moreover, every request requires your approval via an interface that details what the agent is requesting to execute. This way, every command is explicitly authorized by you, reducing the risk of unintended exposures or misuse.
Another vital aspect of using lend involves maintaining stable connections across reconnections. When you lose an SSH connection and establish a new one, the forwarded socket typically changes, which disrupts ongoing operations.
To counteract this, lend employs a symlink at a fixed location on the VM which is dynamically updated each time a new connection is made. This ensures that agents can continue to communicate using a consistent socket path, even after reconnections.
The operational flow ensures that, as long as the original connection remains open, agents can continue functioning without interruption. By doing this, the workflow remains both efficient and secure, addressing some common pain points within traditional development setups.
Implementing lend provides several key advantages for developers looking to integrate coding agents into their workflows while keeping security at the forefront:
Firstly, lend allows agents to execute any command on your behalf without accessing sensitive credentials directly. This separation of sensitive information and operational capacity adds an essential layer of security.
Additionally, the structured approval process through lend means that you maintain control over what operations can be performed remotely, which builds transparency within your workflow.
Lastly, the ability to manage permissions and establish versatile command leases enhances flexibility, enabling you to scale your operations without compromising safety.
The rise of coding agents represents an exciting development in software engineering, promoting enhanced workflows and efficiency. However, as we've seen, utilizing these agents effectively requires robust security measures, particularly concerning sensitive credentials.
By incorporating tools like lend into your routine, you can leverage the power of coding agents without exposing sensitive information. This not only keeps your development environment secure but also enables you to operate with confidence as you explore new opportunities in the realm of coding and automation.
What exactly is lend, and how does it work?
Lend is a proxy service that sits in front of your SSH agent, ensuring that remote coding agents can perform tasks on your behalf without directly accessing sensitive credentials. It requires your approval for any operations that necessitate authorization.
Can lend be used on both macOS and Linux?
Yes, lend is designed to operate across both macOS and Linux environments, making it adaptable for various developer setups.
What happens if I deny a request from an agent using lend?
If you deny a request, the agent cannot execute the action or command it requested, maintaining control over your environment and minimizing risk.