How to Configure Goose SSH Credentials
You set up goose ssh credentials by linking the agent to your local SSH keys. The agent then uses your OpenSSH client to log in to remote hosts. Most teams start by pointing the agent at a standard key pair on a laptop. That approach works at first, but broad host roles give the agent too much power. One bad prompt can change files or drop data across every linked server. How goose ssh credentials work in practice Goose runs shell commands on your machine to finish tasks you give it. When a t
Ephemeral Credentials + SSH Access Management: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up goose ssh credentials by linking the agent to your local SSH keys. The agent then uses your OpenSSH client to log in to remote hosts. Most teams start by pointing the agent at a standard key pair on a laptop. That approach works at first, but broad host roles give the agent too much power. One bad prompt can change files or drop data across every linked server.
How goose ssh credentials work in practice
Goose runs shell commands on your machine to finish tasks you give it. When a task needs a remote server, the agent calls the local SSH client. It reads your local client rules and picks the right key for that host. You do not put raw keys inside the agent app itself. Instead, the agent relies on your system SSH agent or key files on disk.
Teams often move from static keys to OpenSSH certificates to tighten this flow. A certificate Authority key signs a user public key to make a user certificate. Each certificate holds a public key, identity info, principal names, and a set of options. OpenSSH certificates use a much simpler format than X.509 certificates. You can also set a validity window so the signed key expires on time. If you skip the window, the certificate stays valid forever by default.
Using signed certificates stops teams from copying static public keys to every remote host. The remote server checks the signature from the authority key and lets the agent in. You can also route the agent through a bastion or jump host for network control.
Where native SSH setup falls short for AI agents
Native keys and certificates solve the login step well. They check who the user or agent is before opening a shell on the host. Still, login checks only decide who gets through the front door. Once the session starts, the agent gets the full power of that Linux user role.
An AI agent reads logs, writes scripts, and runs commands at high speed. If the remote user role can restart services or read secret files, Goose can too. Native OpenSSH options can lock a key to one single command on the server. That rule is too stiff for an agent that needs to debug a live issue. The agent needs to run many safe read commands while blocking destructive write commands.
Ephemeral Credentials + SSH Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Standard SSH setups also leave a gap in how teams check command output. Server logs or database dumps on a host often hold sensitive user records. When the agent runs a shell command, raw emails, phone numbers, or card numbers return. Those values flow straight back into the model context without any field rewriting. Teams need a way to inspect commands in flight and mask sensitive fields in results.
Steps to tighten agent SSH sessions
Start by giving the agent its own dedicated Linux user on every target host. Never let the agent share a personal admin key with a human engineer. Scope the remote Linux user so it can only read the folders it needs. Remove root privileges from that account so the agent cannot alter system settings.
Next, replace long-lived static keys on the client machine with signed OpenSSH user certificates. Set a short validity window when you sign the key with your authority key. Match the principal name on the certificate to the restricted agent user on the host. This step ensures the credential dies on its own after the task ends.
Check SSH commands and file transfers on the host
OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.
When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.
Frequently asked questions
Where does Goose store SSH keys?
Goose does not keep its own separate store for SSH keys. It uses the standard OpenSSH client and keys already set up on your machine.
Should an AI agent use my personal SSH key?
No, sharing your personal key gives the agent all of your admin rights. Create a separate key and a restricted host user just for the agent.
How do OpenSSH certificates help with agent access?
OpenSSH certificates let you sign a public key with an identity and a time limit. You avoid leaving static keys on hosts, and access expires when the window closes.
Related guides
In this post