LLLanyard

Guides

Let AI agents use SSH without seeing your keys

An AI coding agent that can run commands can run ssh. To do that it normally reads a private key from ~/.ssh, or you paste a password into the chat. Either way the secret ends up somewhere the agent, its logs or a prompt-injected web page can reach. LLLanyard keeps SSH logins in your keychain instead, and gives a connection the key for as long as it lasts.

Store a login

lllanyard ssh add prod --host deploy@prod.example.com          # paste your existing private key (nothing is shown)
lllanyard ssh add nas --host admin@192.168.1.5 --password      # or a password
lllanyard ssh generate web --host root@web1.example.com        # or make a new key; prints the public half

The key goes into your operating system's keychain. If you made a new key, add the public half to the server's ~/.ssh/authorized_keys; lllanyard ssh pubkey web prints it again. Once you've checked a pasted key works, delete the original file.

Connect

lllanyard ssh prod                       # a session
lllanyard ssh prod -- uptime             # run one command
lllanyard ssh with prod -- scp ./app.tar.gz deploy@prod.example.com:/srv/

When you connect, LLLanyard starts a private ssh-agent that only your user can reach, loads the key into it without writing a file, runs ssh, then stops the agent and deletes its folder. ssh with does the same for any program that uses SSH, such as scp, rsync or git. On Windows, which has no agent socket, the key is written to a private temporary file for the session and deleted afterwards.

Let an AI use it

An agent that runs lllanyard ssh prod -- uptime gets the output, never the key. lllanyard setup claude-code, setup codex and the others add instructions telling the agent to do exactly that. In Claude Desktop, the ssh_run tool runs one command only after you click Run in a dialog showing the login and the exact command.

Limit what a login can do

lllanyard ssh add prod --host deploy@prod.example.com --allow "uptime" --allow "df -h" --allow "systemctl status *" --expires 30d
lllanyard ssh policy prod --confirm

These limit what an AI can ask for through LLLanyard. For a hard boundary, also give the login a restricted account on the server.

Things to know

More guides