How to Configure Devin SSH Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up devin ssh prevent delete controls, you restrict the Linux user and SSH certificate options. You also remove write permissions on folders so the AI agent cannot erase files. Many teams give their coding agent a standard developer key to run remote tasks. When permissions are too broad, a bad loop can wipe out critical server files. How devin ssh prevent delete works in OpenSSH First, you create a dedicated Linux user account for the AI coding agent. Do not let the agent log in as the

SSH Access Management + End-to-End Encryption: 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 prevent delete controls, you restrict the Linux user and SSH certificate options. You also remove write permissions on folders so the AI agent cannot erase files. Many teams give their coding agent a standard developer key to run remote tasks. When permissions are too broad, a bad loop can wipe out critical server files.

How devin ssh prevent delete works in OpenSSH

First, you create a dedicated Linux user account for the AI coding agent. Do not let the agent log in as the root user or a shared admin. You should remove write permissions on target folders so the OS blocks file removal. Linux needs directory write rights to remove a file inside that folder. Without write access on the parent folder, the agent can read files and run tests. It still cannot erase logs, configs, or app code during a remote task.

Next, you can replace static SSH keys with OpenSSH user certificates. OpenSSH added certificate support in version 5.4 with a much simpler format than X.509. A certificate holds a public key, an identity string, principal names, and signed options. Your Certification Authority key signs the user key and sets a clear validity window. When you issue a short certificate for the agent, access expires on its own. You can also embed certificate options that force a specific wrapper script at login.

Why native SSH setup leaves a runtime gap

Native Linux permissions and OpenSSH certificates decide who can log in to a server. They also control which folders a user account can change on the disk. Still, an AI coding agent often needs write access to deploy or fix files. Once you grant folder write access for builds, Linux allows file deletion too. The operating system treats creating a file and deleting a file as the same permission.

Wrapper scripts try to inspect incoming shell commands before the server runs them. Yet an autonomous agent can run shell scripts, subshells, or language runtimes over SSH. A static wrapper script struggles to parse every nested command or script file in flight. Teams also struggle to redact sensitive output like emails, phone numbers, or card numbers. Native SSH logs record login events, but they miss individual commands inside an open shell. You need a way to inspect and approve specific destructive commands before they run.

SSH Access Management + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to harden your remote agent setup

Start by separating folders where the agent writes build files from core system data. Mount important config and data directories as read-only for the agent user account. Use a dedicated jump host to funnel all remote agent sessions through one point. Sign user certificates with a short expiration window for each task the agent starts. Keep human operators in the loop whenever the agent requests a high-risk shell action. Review command logs after every agent run to spot strange file changes early.

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

Can Linux permissions block file deletion while allowing file creation?

Yes, you can set the sticky bit on a shared folder in Linux. With the sticky bit set, a user can only delete files they own. If another account owns the core files, the agent cannot delete them.

How do OpenSSH certificates help secure an AI agent?

OpenSSH certificates let a Certification Authority sign a public key with a validity window. The certificate holds principal names and options without needing static keys on every host. When the time window ends, the agent can no longer log in.

Why do forced command scripts fail to catch every delete action?

A forced command checks the initial string sent when the SSH session starts. If the agent opens an interactive shell or runs a script, hidden delete commands still execute. Inspecting each action in flight requires command-level checks and human approval.

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.