Skip to content

Infrastructure (SSH and Docker)

The Infrastructure (SSH and Docker) credential gives the coding agents (Claude Agent, Codex Agent, OpenCode Agent and Antigravity Agent) access to your own machines:

  • Docker against your build server: docker build, docker push, docker compose…
  • SSH to the servers you allow: ssh, scp and rsync, for example to deploy.

It is what you would do from your own computer, done by the agent instead, also with nobody watching (from a schedule or a rule). NappAI’s own Docker is never used: everything happens on your servers.

To turn it on in a node, see the Docker and SSH section of each agent’s page, for example Claude Agent.

Who can create it

  • It is only available if your account’s plan includes Docker and SSH in coding agents. You can check it in Subscription, among what your plan includes. If it does not, the credential is not in the list.
  • Only the account’s owner and admins can create it, edit it and turn it on in a node. The rest of the team can run the flows that already have it, but not change it.

Before you start: a key just for this

Use a new SSH key, only for the agents, instead of reusing yours. There are two ways:

  • Let NappAI generate it. In the credential window, press Generate key pair under SSH Private Key. The private key is filled in for you (you never see or copy it) and the Public key shows below, with a button to copy it. Nothing is stored until you save the credential.

  • Generate it yourself, if you prefer the private key to come from your computer:

    Ventana de terminal
    ssh-keygen -t ed25519 -f nappai_agents -C "NappAI agents"

    This gives you two files: nappai_agents (the private key, which you paste into the credential) and nappai_agents.pub (the public one).

Either way, authorize the public key only on the servers you want the agents to reach. If you ever want to cut the access, removing it from those servers is enough.

Fields

FieldWhat to enter
SSH Private KeyThe whole private key, in OpenSSH or PEM format, including the -----BEGIN …----- and -----END …----- lines. Or press Generate key pair and NappAI fills it in.
Key PassphraseThe key’s passphrase, only if it has one. Otherwise leave it empty. A key generated by NappAI has none.
Allowed HostsThe servers the agent may sign in to, one per line, as user@host or user@host:port. For several servers of the same domain you can write user@*.yourdomain.com.
Known HostsThe fingerprints of every allowed server, in the format of a known_hosts file, one per line. They are required: the agent refuses any server whose fingerprint is not here. Press Read host keys to fill them in, or paste them yourself (below).
Docker HostOptional. Your build server, as ssh://user@host or ssh://user@host:port. It must also be in Allowed Hosts. With it, the agent’s docker commands run on that server.
Registry URLOptional. The image registry images are pushed to, for example registry.yourdomain.com.
Registry UsernameOptional. The registry user.
Registry Password or TokenOptional. The registry password or token. The agent can read this value: use a token that can only push images (see Limits).
Ask for approval before each command on the serversOff by default. See Command approval.

Allowed Hosts example

deploy@build.yourdomain.com
deploy@production.yourdomain.com:2222
deploy@*.staging.yourdomain.com
  • Every line needs the user.
  • Without a port, 22 is used.
  • The wildcard is only valid at the start of the name, as *.domain; a bare * is not accepted.

How to get the Known Hosts lines

The simplest way: fill in Allowed Hosts first and press Read host keys. NappAI connects to each server, reads its host key, fills in the field and shows you each fingerprint (SHA256:…). Compare it with your server’s before saving (ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub on the server shows it). If a server does not answer, or is a wildcard such as *.staging.yourdomain.com, it tells you so and you add its line by hand.

Only servers with a public address are read. For one in your internal network, or if you prefer to do it yourself, from a computer that already trusts those servers run ssh-keyscan for each one and paste what it prints:

Ventana de terminal
ssh-keyscan build.yourdomain.com
ssh-keyscan -p 2222 production.yourdomain.com

Each line looks like host key-type AAAA…; with a port other than 22 the host shows as [host]:2222. If you use a wildcard such as *.staging.yourdomain.com, add one line for every server of that domain the agent will sign in to.

To be sure the fingerprint is the right one, compare it with the one the server itself reports (ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub), or copy the lines from your own ~/.ssh/known_hosts if you already sign in to those servers.

Save the credential and authorize the key

While a required field is missing, the window lists which ones above the buttons. When you save, NappAI checks the credential: that the key can be opened (with its passphrase, if it has one), that every server in Allowed Hosts has its line in Known Hosts and that the Docker Host is among the allowed ones. If something is wrong, the error shows next to the field to fix.

If everything is right, the window shows the Public key (with a button to copy it) and the list of allowed servers. Add that line to the ~/.ssh/authorized_keys file of the user the agent signs in as, on every allowed server:

Ventana de terminal
echo "ssh-ed25519 AAAA… " >> ~/.ssh/authorized_keys

It is the same public key as your .pub file; the window shows it so you do not have to look for it. Click Done to close.

When you edit the credential, the secret values are hidden; if you do not change them, they are kept. Changes apply from the agent’s next instruction.

Command approval (optional)

The Ask for approval before each command on the servers switch is off by default: the agent works without waiting for anyone, also in scheduled runs.

If you turn it on:

  • Approval is asked before every SSH session (ssh, scp, rsync) and every Docker command that changes something: docker push, docker run, docker compose up, docker compose down, docker stop, docker rm, docker exec, docker login…
  • It is never asked for docker build (without pushing) or for read-only commands such as docker ps, docker images, docker logs or docker inspect.
  • The request arrives in Approvals with the agent, the server and the exact command. Approve runs it; Reject makes it fail and the agent is told why.
  • The agent waits for the answer. If nobody answers within the instruction’s time limit (the node’s Time Limit (s)), the command is not run.

Limits: what you should know

  • The key never enters the agent’s workspace. A separate signer holds it, and it only lives while the agent’s workspace is on. The agent can use it to sign in to your servers, but cannot read or copy it, and it never shows in answers, steps or logs.
  • Only your allowed servers. The agent is set up to sign in only to the servers in Allowed Hosts, and only if their fingerprint matches Known Hosts. Even so, the real guarantee is that the key is only authorized on those servers: that is why a new key just for this is the safe choice.
  • The agent does see the registry password. Docker needs it in the agent’s workspace to push. Use a registry token that can only push (not delete or administer), and rotate it whenever you see fit.
  • Approval is a workflow control, not a security barrier. It lets a person review what the agent is about to do, but a determined agent could get around it. What really limits the access is the plan, who turns it on and the list of servers.
  • Internet access. The agent can still reach the internet as usual (to install packages, for example); this credential only decides where it can sign in with your key.
  • Copied nodes. A node copied or duplicated within the same account keeps the access while the person who turned it on is still an owner or admin. If someone without those permissions changes the node’s credential, the access is turned off until an admin turns it on again.

More information

For creating, editing and deleting credentials in general, see Credentials.