Skip to content

Remote Execution Connector

The Remote Execution connector allows Agentcy to execute commands and transfer files on remote hosts via SSH. It provides 3 live tools for running commands, uploading files, and downloading files.

Authentication

The connector authenticates via SSH using either password or private key authentication.

json
{
  "name": "Production Server",
  "source_type": "remote_execution",
  "config": {
    "host": "server.example.com",
    "port": 22,
    "username": "deploy",
    "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n..."
  }
}
VariableRequiredDescription
hostYesRemote host address (IP or hostname)
portNoSSH port (default: 22)
usernameYesSSH username
passwordOne ofSSH password (use private_key instead when possible)
private_keyOne ofSSH private key (PEM format)
timeout_secsNoConnection and command timeout in seconds

WARNING

Store private keys and passwords as secrets. Avoid committing credentials in plain text. Use a dedicated service account with the minimum required permissions.

Live Tools (3)

ToolDescriptionArguments
remote_exec_commandExecute a shell command on the remote hostcommand, cwd?, env?, timeout?
remote_exec_uploadUpload a file to the remote hostlocal_content, remote_path, mode?
remote_exec_downloadDownload a file from the remote hostremote_path

Example: Agent Using Remote Execution Tools

User: "Check disk usage on the production server"

Agent: I'll run a disk check on the server.
→ Calls remote_exec_command(command: "df -h")
→ Returns: "Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda1       100G   72G   28G  72% /
  /dev/sdb1       500G  410G   90G  82% /data"
→ Reports: "Production server disk usage: root partition at 72%, data partition at 82%.
  The /data partition may need attention soon."
User: "Upload the new config file"

Agent: I'll upload the configuration.
→ Calls remote_exec_upload(local_content: "...", remote_path: "/etc/app/config.yaml", mode: "0644")
→ Returns: "File uploaded to /etc/app/config.yaml"

ETL Ingestion

This connector does not support ETL ingestion. All tools operate as live SSH interactions with the remote host.

Configuration Reference

json
{
  "name": "Production Server",
  "source_type": "remote_execution",
  "config": {
    "host": "server.example.com",
    "port": 22,
    "username": "deploy",
    "password": null,
    "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n...",
    "timeout_secs": 30
  }
}
FieldTypeDefaultDescription
hoststringrequiredRemote host address
portnumber22SSH port
usernamestringrequiredSSH username
passwordstring--SSH password
private_keystring--SSH private key (PEM format)
timeout_secsnumber30Connection and command timeout

Troubleshooting

ErrorCauseFix
Connection refusedSSH service not running or port blockedVerify SSH is running and port 22 (or custom port) is open
Authentication failedInvalid credentialsCheck username, password, or private key
Host key verification failedUnknown host keyAdd the host key to known_hosts or verify the host fingerprint
Permission deniedUser lacks permission for the command or pathUse a user with appropriate sudo or file permissions
Command timeoutCommand exceeded timeoutIncrease timeout_secs or run long commands with nohup
Connection timed outHost is unreachableVerify network connectivity and firewall rules

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.