Configure sandbox SSH key
add_ssh_keyAuthorizes an OpenSSH public key on a running sandbox so you can SSH in as user and set up reverse tunnels; returns the machine IP for port 22.
Instructions
Configure sandbox SSH key. Adds an OpenSSH public key to the running sandbox so the caller can SSH as user user. The response carries machineIp, which is the host to connect to on port 22.
This is also how you reach your own machine from inside a sandbox without the CLI: authorize the key, then open a reverse tunnel with stock OpenSSH, and a port on your machine answers at 127.0.0.1:<port> inside the sandbox for as long as the ssh process runs.
ssh -o ExitOnForwardFailure=yes -i ~/.ssh/id_ed25519 -N -R 7777:127.0.0.1:7777 user@<machineIp>boat forward <id> --reverse --local 7777 is the same tunnel with the key handling and redial done for you.
On a sandbox with network.inbound boat-only, the route answers 403 inbound_closed when the sandbox has no inbound list. A sandbox takes SSH over IPv4 and over IPv6, and boat sees only the address of this API request. When the list has entries, the route answers 403 inbound_not_allowed, with the address in error.details.address, only when the list does not cover the caller's address and holds no entry of the other IP version. In every other case the route answers normally, and the host accepts or drops the SSH connection by its real source address. With ?include=caller, the answer then holds caller.address and caller.listed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sandboxId": "<sandboxId>",
"key": "<key>"
},
"name": "add_ssh_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Public SSH key in OpenSSH format. Private keys are rejected. | |
| include | No | Optional fields of the answer. `caller`: on a sandbox with an inbound list, the answer holds `caller.address` and `caller.listed`. Without it, the answer has the fields that it had before. | |
| sandboxId | Yes | Public Sandbox id returned by create/list/get sandbox calls. |