How to Configure Goose SSH Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up goose ssh prevent delete controls by pairing restricted Linux users with command checks. This stops an AI agent from wiping host files during a remote session. Engineering teams often give local AI agents full remote keys to fix server bugs fast. When those keys map to root or broad admin accounts, one bad command can erase whole folders. A small prompt error can turn a routine log check into an outage. Setting clear bounds on what the agent can run keeps your hosts safe. How to set

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.

You set up goose ssh prevent delete controls by pairing restricted Linux users with command checks. This stops an AI agent from wiping host files during a remote session. Engineering teams often give local AI agents full remote keys to fix server bugs fast. When those keys map to root or broad admin accounts, one bad command can erase whole folders. A small prompt error can turn a routine log check into an outage. Setting clear bounds on what the agent can run keeps your hosts safe.

How to set up goose ssh prevent delete rules

First, create a dedicated Linux user on the remote host just for the agent. Do not add this user to the admin group or give it root rights. Next, use standard Linux file rules to lock down important system folders. Set the agent user to read-only on app code, log paths, and config files. If the agent needs to write temp files, give it one isolated scratch folder. You can also set the append-only attribute on log files so no process can remove them.

On the login side, teams often use OpenSSH certificates to manage agent keys. A certificate Authority key signs the public key of the user or agent. The signed certificate holds an identity string, principal names, and specific login options. OpenSSH certificates use a much simpler format than standard TLS certificates. You can also bind a forced wrapper script to the agent key on the host. When the agent logs in, the host runs this script before the command runs. The script reads the incoming command string and blocks words that remove files or folders.

Why native host setup leaves a gap

Native Linux permissions and OpenSSH certificates solve who can log in to a host. They also limit which folders a specific Linux user can change or wipe. Still, this host setup leaves a big gap during active work. If an agent needs write rights to update an app, it can also delete those files. Standard Linux file permissions treat file updates and file drops in the same way in many folders. Maintaining custom wrapper scripts across hundreds of servers is also hard work for your team.

Simple text wrapper scripts are easy for an automated agent to bypass by accident. An agent might run a script inside a language runtime or encode a command string. The host wrapper only sees the outer call and lets the inner delete run. Plus, standard SSH logs only show that a user logged in with a specific key. They do not show the exact commands the agent ran inside an open shell. Teams also have no built-in way to pause a risky command for human review. If sensitive data like emails, phone numbers, card numbers, or national IDs sit in files, raw shell output will return them.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing agent sessions across many hosts

When you run a few servers, updating local users and wrapper scripts takes minutes. As your fleet grows to dozens of cloud hosts, manual host rules break down. One missed permission on a new server leaves that machine open to bad agent commands. Teams need a consistent way to inspect every remote command before the server runs it. Central checks let you block file drops while still letting the agent read logs and restart apps. You also gain a clear audit log of every action the agent takes across your servers.

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

Can Linux file permissions alone stop an agent from deleting files?

Yes, if the agent only needs to read files, read-only folder rules will stop deletes. If the agent must create or edit files in a directory, standard write rules also allow file deletion unless you set sticky bits.

Why do shell wrapper scripts fail to block all delete commands?

Wrapper scripts inspect the initial command text sent when the session starts. If the agent opens an interactive shell or calls a Python script, the wrapper cannot see the file delete calls inside that script.

How do OpenSSH certificates help with AI agent access?

OpenSSH certificates let a central authority key sign an agent key with an identity and valid principals. This stops teams from copying static public keys to every host and makes key rotation much easier.

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.