How to Configure OpenHands SSH Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands ssh approval by turning on agent confirmation mode and using signed OpenSSH user keys. This setup makes the AI coding agent ask a human before it logs into a remote host. Many teams start by giving the agent a static private key on a shared jump host. That broad role lets the agent run any remote shell command without a human check. How openhands ssh approval works with OpenSSH OpenHands runs tasks inside a local workspace and uses an SSH client to reach remote servers. W

Approval Chains & Escalation + SSH Access Management: 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 openhands ssh approval by turning on agent confirmation mode and using signed OpenSSH user keys. This setup makes the AI coding agent ask a human before it logs into a remote host. Many teams start by giving the agent a static private key on a shared jump host. That broad role lets the agent run any remote shell command without a human check.

How openhands ssh approval works with OpenSSH

OpenHands runs tasks inside a local workspace and uses an SSH client to reach remote servers. When you turn on confirmation mode, the agent pauses before it runs a shell command. A human operator must read the proposed command and approve it in the interface.

On the server side, you can pair this agent pause with OpenSSH certificates. An OpenSSH certificate holds a public key, identity data, principal names, and signed options. A Certification Authority key signs the user key to create this certificate. This format is much simpler than the X.509 format used in TLS.

To set this up, an admin signs the agent public key with the authority key. The admin sets a key identity and lists the allowed user principals for the login. You should also set a short time window when you sign the certificate. Otherwise, the certificate stays valid forever by default. When the human approves the action, the agent uses this signed certificate to log in.

What native settings solve and what keeps the session active

Combining agent confirmation with signed OpenSSH certificates solves the initial login problem. The server checks the Certification Authority signature instead of trusting a static public key file. The human check in the agent interface stops the bot from starting surprise sessions.

Still, this native setup leaves a major operational gap during live work. OpenSSH certificates decide who can log into the server and which user account they take. Once the SSH session starts, the server does not check individual commands in flight.

Approval Chains & Escalation + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If an operator approves a single remote script, that script can still run fifty hidden commands. Even worse, if the agent opens an interactive shell, one approval grants full remote control. A single mistake can drop production tables or read private files on the host. Standard SSH logs show who logged in, not the exact output of every remote command. Also, server output can return sensitive data like emails, phone numbers, card numbers, or national IDs. Native SSH tools do not rewrite matched fields in results before the agent reads them.

Why command-level checks matter for AI agents

AI agents work fast and often chain multiple shell commands together in one step. Asking a human to review a long bash string in a chat box causes fatigue. Operators start clicking approve without reading every pipe, flag, and subshell in the text.

To keep production hosts safe, teams need controls that work inside the session itself. You need a way to inspect each command right before the remote server runs it. Separating login permission from command approval stops a single bad prompt from breaking a server. It also gives security teams a clear log of every command the agent ran.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an open-source SSH listener on the host where people and agents keep their normal ssh, sftp, and scp tools.

First, hoop.dev guardrails check one-shot commands and file paths before they run. Next, hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

Does OpenHands stop before every remote command by default?

OpenHands can pause before running local bash commands when you turn on confirmation mode. Still, once it runs an SSH command, everything inside that single command string runs together. The agent cannot pause halfway through a remote script to ask for a second check.

How do OpenSSH certificates improve agent login security?

OpenSSH certificates bind an identity and allowed user principals to a public key. Because a central authority key signs them, you do not need to copy keys everywhere. You can also set a short time window so the agent key expires after the task.

Can native SSH hide sensitive data from an AI agent?

No, standard OpenSSH sends all command output straight back to the client terminal. If a remote file holds emails, phone numbers, card numbers, or national IDs, the agent gets them. You need an inline data masking step to rewrite matched fields in results during the session.

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.