How to Configure OpenAI Agents SDK SSH Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up openai agents sdk ssh read only access, create a limited Linux user. Then bind your agent tool to a forced command or restricted shell on the host. Teams often give AI agents a normal SSH key to check logs and host stats. If that account has broad rights, one bad prompt can delete files or stop services. An agent only needs to read state, not change how the server runs. How openai agents sdk ssh read only access works on Linux hosts The OpenAI Agents SDK lets models call Python func

Auditor Read-Only Access + 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 openai agents sdk ssh read only access, create a limited Linux user. Then bind your agent tool to a forced command or restricted shell on the host. Teams often give AI agents a normal SSH key to check logs and host stats. If that account has broad rights, one bad prompt can delete files or stop services. An agent only needs to read state, not change how the server runs.

How openai agents sdk ssh read only access works on Linux hosts

The OpenAI Agents SDK lets models call Python functions to run tasks on outside systems. When a team builds an SSH tool, the function opens a session to a remote host. The SSH server itself does not have a single switch for read-only mode. Instead, the Linux system controls what the user can read or write after login.

To keep the agent from changing files, teams create a special Linux user account. This account gets read rights on log folders and system stats, but no write rights. It also gets no sudo rules, so it cannot raise its own power on the box.

Teams also use OpenSSH certificates or key options to lock down the login even more. An admin can sign a user key with a certificate authority key. That certificate holds a public key, an identity, user names, and signed options. On the target host, the authorized keys file or certificate can force one specific script. When the agent logs in, the host runs that wrapper script instead of a full shell. The wrapper checks the command from the agent against a short list of safe read tools. If the agent asks to read a log line or check disk space, the script runs. If the agent tries to write a file, the script stops the run right away.

What native Linux rules solve and where gaps remain

Setting up a restricted Linux user and a forced script stops many basic accidents. The agent cannot edit app code, drop system files, or install new packages on the host. Certificates also help teams avoid leaving forever keys on every single worker node.

Auditor Read-Only Access + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, host users and static wrapper scripts leave big gaps in daily work. First, an SSH login rule only checks who logs in at the start of a session. Once the session starts, a read-only user can still read private files on the disk. For example, a log file or config file might hold emails, phone numbers, or card numbers. Native SSH returns that raw text right back to the agent and the model prompt.

Second, keeping wrapper scripts and key files up to date across many servers takes hard work. Every time an agent needs a new check, an admin must edit scripts on every host. If a team wants a human to approve a risky command, plain SSH cannot pause mid-run. Standard host logs also struggle to tie a shell command back to a specific agent run.

Add command and file guardrails to SSH access

Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev provides an open-source SSH server with guardrails on the host that uses OpenSSH certificates.

Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.

Frequently asked questions

Does OpenSSH have a built-in read-only user flag?

No, OpenSSH only handles the login and the tunnel to the remote host. File and command limits come from Linux user permissions, restricted shells, or forced command scripts.

How do you stop an AI agent from running write commands over SSH?

Use a dedicated Linux user with no write rights and no sudo rules on the host. Pair that user with an OpenSSH forced command script that only allows safe read commands.

Can a read-only SSH user still leak sensitive data to the model?

Yes, read rights let the agent pull raw text from any file that user can open. If logs contain emails, phone numbers, or national IDs, those strings go straight to the model.

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.