This article follows the official documentation. We haven’t tested this tool for a hands-on review.
A coding agent with shell access can use the Tailscale CLI to check whether a remote development machine is on your private network and reachable. Tailscale connects enrolled devices through a private, encrypted network called a tailnet. The CLI reports connection status and checks whether a host responds. It does not grant the agent permissions beyond those in your tailnet access rules.
To open a remote shell, the agent can use Secure Shell (SSH) over Tailscale after an operator enables and authorizes the connection. The example below checks a host and reads a repository’s Git status without changing files. It follows documented behavior and has not been installed or tested for this article.
Install and connect a device
Install Tailscale using the instructions for your operating system. Where the tailscale command lives depends on the platform. On the macOS App Store version, for example, the CLI is bundled inside the app, and the CLI reference explains how to call it. Then connect the device to your tailnet:
tailscale up
Complete the sign-in flow that Tailscale presents. The device must be signed in before an agent can use its local Tailscale daemon, a background service, to inspect the tailnet. Check the connection with:
tailscale status
The command reports the local device and its peers, which are other devices on the tailnet.
For machines that must connect without a person signing in, Tailscale documents using an auth key, a credential that registers the device without a browser sign-in. Treat that key like a password: provide it through an approved secret store or deployment configuration, and do not put it in an agent prompt or commit it to the repository.
Check a remote development host
An agent can first read the peer list as JSON, then test a named host:
tailscale status --json
tailscale ping dev-host
Here, dev-host is a placeholder for the remote device’s Tailscale machine name or its Tailscale IP address. The JSON output lists peers and users in a format an agent can read. tailscale ping sends pings to the host only over Tailscale and shows details about the connection, which helps with troubleshooting. By default it sends up to 10 pings and stops once a direct path is established. The CLI reference documents both commands and their flags.
The status command reads the local Tailscale daemon’s view of the tailnet. The ping command sends traffic to another device. Neither command changes files or exposes a service to the public internet.
If the host permits SSH, the agent can make a read-only check on it:
ssh remote-user@dev-host 'git -C /path/to/repo status --short'
remote-user and /path/to/repo are placeholders for the account and repository path on that machine. This command uses the standard SSH client; the remote command asks Git to report working-tree changes without modifying them. It makes a network connection and runs a command on the remote host.
A suitable agent prompt is: “Check whether dev-host is reachable over Tailscale. If SSH access works, report the Git status of /path/to/repo. Do not edit files or run other remote commands.”
Check SSH access rules
Tailscale SSH lets Tailscale handle sign-in and access checks for SSH connections inside a tailnet. An operator must enable it on the destination with tailscale set --ssh. The tailnet policy must grant the source access to the destination on port 22 and also allow it to connect with Tailscale SSH. The server component is available on Linux and on macOS devices running the open-source tailscaled variant. See the Tailscale SSH requirements before relying on it.
The default SSH rule uses check mode. In check mode, the person who starts the connection has to sign in again in a browser before SSH opens. Do that sign-in yourself before the agent runs SSH commands.
If tailscale ping reaches the host but SSH fails, check whether the host has an SSH server running or whether Tailscale SSH is enabled. Also check whether the access policy allows connections to port 22 and whether the username is valid. Reachability alone does not grant shell access.
The CLI also includes service-sharing features. In particular, Funnel routes traffic from the public internet to a local service, so an agent should not enable it as a routine connectivity fix. Use it only when public access is intended and the service has suitable authentication.