How to Configure Goose SSH Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a goose ssh sandbox by giving the AI agent a restricted user account on an isolated host. Then you lock down its shell access using OpenSSH certificates and strict host permissions. Teams often point local AI agents straight at shared test servers using a developer's own SSH key. That shortcut gives the agent the same broad shell rights as the human engineer. If a prompt goes wrong, the agent can delete files, read secrets, or break running services. How to set up a goose ssh sandbo

SSH Access Management + AI Sandbox Environments: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a goose ssh sandbox by giving the AI agent a restricted user account on an isolated host. Then you lock down its shell access using OpenSSH certificates and strict host permissions. Teams often point local AI agents straight at shared test servers using a developer's own SSH key. That shortcut gives the agent the same broad shell rights as the human engineer. If a prompt goes wrong, the agent can delete files, read secrets, or break running services.

How to set up a goose ssh sandbox

A safe setup starts by separating the agent from your normal user account. You create a dedicated Linux user on a disposable virtual machine or container. This account should have no root rights and no read access to other users' folders. Next, you avoid placing static private keys on the laptop running the agent. Instead, you use an OpenSSH certificate authority to sign a user key for the agent. An OpenSSH certificate holds a public key, an identity string, principal names, and signed options. It uses a much simpler format than TLS certificates.

When you sign the user certificate, you set an identity string and list the allowed principal names. You also set a short validity window so the credential expires on its own. Without a set window, the certificate stays valid forever. You can also bake option rules into the certificate during signing. These rules can block port forwarding, agent forwarding, or interactive pseudo-terminals. Once the remote host trusts your certificate authority key, the agent can log in as the sandbox principal. The remote server checks the signature and expiration time before it opens the shell session.

Why host-level sandboxes still need command controls

A host sandbox and a signed certificate control where the agent logs in and for how long. They also limit which Linux account the agent uses on that remote machine. Still, this setup only checks identity at the start of the SSH session. Once the shell opens, the host allows any command that the sandbox user has permission to run.

If the sandbox user needs tool access to inspect logs or query a database, it holds real power. The agent can still run destructive shell scripts, dump sensitive tables, or read local secrets inside that workspace. Standard SSH logs tell you who logged in, not what each shell command did in flight. Native host permissions cannot pause a single risky command for human review while letting safe read commands pass. They also cannot rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs in command output.

SSH Access Management + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing agent sessions across multiple hosts

As teams run more AI tasks, maintaining separate sandbox accounts on every host becomes hard work. Engineers must rotate authority keys, track principal lists, and clean up leftover files across many machines. When an incident happens, auditors have to piece together shell history files from several different servers. A local user can even wipe those history files if the account has write access to its own home folder. Centralizing how agent sessions run and how commands are checked removes this manual upkeep.

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

Why should I not use my own SSH key for an AI agent?

Your personal SSH key carries all of your shell rights and network reach. If the agent makes a mistake, it can alter production files or read private keys using your identity.

How do OpenSSH certificates help in a goose ssh sandbox?

OpenSSH certificates let you attach an expiration time and strict principal names to a public key. You do not have to copy and delete static public keys on every target server.

Does an SSH sandbox stop an agent from reading sensitive data?

No, a sandbox only isolates the host and user account. If that account can reach a database or log file, the agent can still read raw emails or card numbers unless output masking rewrites them.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.