How to Configure Windsurf SSH Least Privilege

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf ssh least privilege by using OpenSSH certificates and tight server accounts. You also restrict the local shell commands that the coding agent can run. Many engineering teams give their coding tools full developer keys for remote servers. This mistake lets an automated agent change production files or read secret data. If a prompt goes wrong, a wide role turns a small bug into an outage. How windsurf ssh least privilege works in practice In June 2026, Cognition renamed Wind

Least Privilege Principle + 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 windsurf ssh least privilege by using OpenSSH certificates and tight server accounts. You also restrict the local shell commands that the coding agent can run. Many engineering teams give their coding tools full developer keys for remote servers. This mistake lets an automated agent change production files or read secret data. If a prompt goes wrong, a wide role turns a small bug into an outage.

How windsurf ssh least privilege works in practice

In June 2026, Cognition renamed Windsurf to Devin Desktop while keeping the same IDE features. Its agent can run terminal commands on its own after the user gives permission. The agent uses a dedicated terminal that loads the user's normal shell files. Because it loads aliases and shell variables, the agent inherits local SSH keys and config. If your local shell can log in to a server, the agent can too.

To lock this down, you must change how OpenSSH checks user keys on the host. Instead of static public keys, teams use a Certification Authority key to sign user certificates. An OpenSSH certificate holds a public key, identity text, principal names, and a set of options. OpenSSH added this simpler certificate format in version 5.4 to avoid complex TLS formats. You sign the key for a single low-privilege principal name rather than a root user.

You also set a short validity window when you sign each user certificate. By default, OpenSSH certificates last forever unless you define a clear start and end time. Giving the agent a dedicated Linux user with read-only file permissions limits what it touches. You can also add certificate options that restrict port forwarding or force one specific command.

Where native SSH permissions fall short for AI agents

OpenSSH certificates and Linux user roles solve the first half of the access problem. They decide who can log in and which Linux account the session will use. Short certificate lifetimes also help reduce the risk of a stolen key sitting on disk. This setup stops an unknown machine from reaching your remote hosts.

Still, native SSH rules leave a large operational gap once the shell session starts. OpenSSH checks the key at login, not what individual commands do in flight. If the agent needs to restart a service or read logs, it needs shell access. Once inside that shell, the agent can chain commands or read local config files. A static Linux user cannot judge if a specific command is safe right now.

Least Privilege Principle + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Local IDE prompts also put too much pressure on the human developer. When an agent asks to run an SSH command, the developer sees a long string. People get tired and click approve without reading every argument in the terminal line. Also, standard server logs only show that the Linux user ran a session. They do not link the remote shell commands back to the agent task.

Separating agent keys from human developer keys

The safest path is to separate human login profiles from agent tasks right away. Do not let the agent use your default SSH agent socket or personal keys. Store agent keys in a separate folder that is not loaded by default shell files. Point the agent to a dedicated host alias that only uses a restricted account.

On the remote server, place the agent user in a tight group with read-only rights. Remove sudo rights so the agent can never raise its own privileges during a task. Use OpenSSH certificate options to turn off agent forwarding and port tunneling for that key. This stops the coding tool from hopping from one remote host to another server. Even with these steps, teams still need visibility into every command run inside the session.

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 inline on the host. On every one-shot command or file transfer an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs, and 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

Does Devin Desktop use the same terminal setup as Windsurf?

Yes, Devin Desktop is the new name for Windsurf and keeps the same IDE features. Its agent runs commands in a dedicated terminal that loads your normal shell files.

Why do OpenSSH certificates help with windsurf ssh least privilege?

OpenSSH certificates let you sign a public key with an identity, principal names, and options. You can limit which user account the agent uses and expire the certificate fast.

Can Linux file permissions alone stop risky agent commands?

Linux permissions block writes to protected folders, but they cannot inspect commands in flight. An agent with read access can still dump sensitive config files or phone numbers.

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.