How to Configure Haystack SSH Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up haystack ssh credentials by giving your pipeline a private key or signed certificate. The AI pipeline then uses that key to log in to remote Linux servers. Teams often build custom tools inside their pipelines to run shell commands on target machines. Most engineers start by placing a static private key on the runner host. That key usually maps to a broad Linux user account on the remote machine. If the agent makes a mistake, a broad account lets it alter files or read private data.

Ephemeral Credentials + 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 haystack ssh credentials by giving your pipeline a private key or signed certificate. The AI pipeline then uses that key to log in to remote Linux servers. Teams often build custom tools inside their pipelines to run shell commands on target machines. Most engineers start by placing a static private key on the runner host. That key usually maps to a broad Linux user account on the remote machine. If the agent makes a mistake, a broad account lets it alter files or read private data.

How haystack ssh credentials work in practice

A pipeline needs a secure way to talk to remote hosts during a task. You pass a private key or an OpenSSH certificate to the tool component. OpenSSH certificates use a simpler format than standard web certificates. A certificate authority key signs the user public key to create the certificate. The signed certificate holds a public key, identity info, principal names, and options. When the pipeline runs, the SSH client presents this credential to the target server.

The remote server checks the key or the certificate authority signature before allowing entry. If you use static keys, you must copy the public key to every host. If you use OpenSSH certificates, the server only needs to trust the authority key. You can also set a validity window when you sign the certificate. By default, an OpenSSH certificate stays valid forever unless you set a time limit. Short time limits help reduce the risk of stolen files on the runner host.

Why static keys and certificates leave a gap

Native SSH setup controls who can open a shell on a Linux machine. It checks the key or certificate at the start of the session. Once the login succeeds, the session runs with the full rights of that Linux user. The SSH daemon does not inspect individual shell commands while the pipeline works.

An AI agent can generate unexpected shell commands based on user prompts. A valid login cannot stop an agent from running a destructive command inside the shell. Also, standard SSH logs only show that a specific key logged in at a certain time. They do not link each shell command back to the exact pipeline user or task. If a command returns sensitive text like emails or phone numbers, standard SSH passes it right through. Data masking is needed to rewrite matched fields like card numbers or national IDs in results.

Ephemeral Credentials + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping Linux roles for agent pipelines

You should limit what the target Linux account can do after login. Create a dedicated Linux user on the remote host just for the pipeline. Give this user read-only rights to specific folders instead of full root rights. Do not add the pipeline user to the admin group on the server.

You can also add options when you sign an OpenSSH user certificate. These options can restrict port forwarding or force a single preset command to run. Locking the account down at the OS level limits damage from bad agent prompts. Still, OS permissions take a lot of time to maintain across many servers. Teams need a simpler way to inspect commands and mask sensitive output in flight.

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

Where should I store private keys for a pipeline?

Keep private keys in an encrypted secret store rather than in source files. Load the key into memory only when the pipeline starts its task. Delete the key from the runner host as soon as the task finishes.

Are OpenSSH certificates better than static SSH keys for agents?

Yes, because you can set a short expiration time when you sign the certificate. Without a time limit, a static key works forever until you remove it manually. Certificates also save you from copying public keys to every single target server.

Can native SSH block specific words or hide private data in command output?

No, the SSH protocol only handles the encrypted tunnel and the initial login check. It does not read the text stream to block bad commands or mask emails and phone numbers. You need an inspection layer to filter commands and rewrite sensitive fields in results.

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.