How to Configure Devin SSH Least Privilege

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up devin ssh least privilege, give the agent a restricted Linux user and a signed OpenSSH certificate. You must also limit which shell commands that user can run on the host. Teams often give an AI coding agent a shared root key to move fast. Broad keys let an automated agent delete files, read secrets, or break live servers. How devin ssh least privilege works in Linux First, create a dedicated Linux user account just for the AI agent on your server. Do not add this user to the wheel

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.

To set up devin ssh least privilege, give the agent a restricted Linux user and a signed OpenSSH certificate. You must also limit which shell commands that user can run on the host. Teams often give an AI coding agent a shared root key to move fast. Broad keys let an automated agent delete files, read secrets, or break live servers.

How devin ssh least privilege works in Linux

First, create a dedicated Linux user account just for the AI agent on your server. Do not add this user to the wheel or admin group on the machine. Give the account read rights only on the folders it needs to inspect. If the agent must restart one service, grant that single command in the sudo rules.

Next, replace static public keys with OpenSSH user certificates for better control. OpenSSH certificates hold a public key, an identity string, principal names, and signed options. A central key authority signs the agent key and sets a short time window. You must set an expiration window, or the signed certificate stays valid forever. The target server trusts the authority key and checks the principal name during login. You can also embed options in the certificate to force a single command. You can block port forwarding in the certificate options too.

What native SSH limits solve and what they miss

Linux user accounts and OpenSSH certificates solve the basic login problem well. They decide which machine the agent can reach and when the key expires. A forced command option also locks the session to one specific script or binary. This stops the agent from opening a full root shell on your host.

Still, real agent tasks rarely fit inside one static forced command. An AI engineer needs to read logs, check process status, and test small fixes. Once you grant an interactive shell to run those tasks, native SSH steps back. The server checks who logs in at the start, not what runs next. It does not inspect individual shell commands in flight before they hit the kernel. If the agent runs a destructive command in an allowed folder, Linux runs it. If the agent prints a file with customer emails or card numbers, the raw text returns. Native SSH logs login events, not the full stream of commands and outputs.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why static jump hosts fall short for AI agents

Many teams route agent traffic through a traditional bastion or jump host first. A bastion gives you one network choke point to watch incoming network sessions. Yet the agent still holds a private key or certificate in its own workspace. If that workspace leaks, an attacker can use the key until it expires. Also, a standard jump host forwards encrypted traffic without reading the shell commands inside. It cannot pause a risky command to ask a human on the team for approval.

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 avoid static SSH keys for Devin?

Static SSH keys never expire on their own and often stay on disk forever. If a key leaks from the agent workspace, anyone can log into your servers. Signed OpenSSH certificates let you set a short validity window for every task.

Can OpenSSH certificates restrict what commands an agent runs?

Yes, OpenSSH certificates support a forced command option when you sign the key. This option runs only one preset command or script when the user logs in. Still, it is too rigid when an agent needs to run varied diagnostic commands.

How do I stop an AI agent from reading sensitive data over SSH?

Start by removing read permissions on secret files at the Linux file system level. Note that file permissions cannot rewrite emails, phone numbers, or national IDs inside shared logs. You need in-flight output filtering to rewrite matched fields in results before they return.

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.