# Tailscale for agent machines

> Install Tailscale on the agent host, join the tailnet, tighten ACLs, then pair T3 or SSH without opening public ports.

Source: https://fullbytedeveloper.com/blog/tailscale-for-agent-machines
Published here: 2026-11-26, updated 2026-12-03

Agent machines should not sit on open SSH ports for convenience. Tailscale puts the host on a private WireGuard tailnet so laptops, phones, and GPU boxes can reach each other without publishing the agent to the public internet [1][2]. T3 Code documents LAN and tailnet pairing after both devices join [5].

## Install Tailscale on the agent host

Tailscale's Linux download page documents a one-line installer [1]:

```bash
curl -fsSL https://tailscale.com/install.sh | sh
```

**Warning:** review the script before piping to `sh`, or use the distro package steps on the same download page [1].

Bring the node up (CLI docs cover `tailscale up` and related commands) [2]:

```bash
sudo tailscale up
sudo tailscale status
```

After the browser auth flow finishes, `tailscale status` should list the host with a Tailscale IP in the `100.x` CGNAT range [2]. Enable MagicDNS if you want stable names inside the tailnet instead of memorizing those addresses [4].

This draft host does not have the Tailscale binary installed, so the capture below is the expected failure when you check before install:

```bash
command -v tailscale || echo "tailscale not installed"
```

```text
tailscale not installed
```

Run the install steps on the agent box itself, then re-check `tailscale status` there [1][2].

## See the private path as a diagram

<figure>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 280" role="img" aria-label="Laptop reaches agent host over tailnet without a public port forward">
  <defs>
    <marker id="arrowTailscaleAgent" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto">
      <path d="M0,0 L8,3 L0,6 Z" fill="#14b8a6"/>
    </marker>
  </defs>
  <rect x="0" y="0" width="720" height="280" rx="12" fill="#0b1f3a"/>
  <rect x="24" y="56" width="160" height="80" rx="8" fill="#123052" stroke="#14b8a6" stroke-width="2"/>
  <text x="44" y="92" fill="#f8fafc" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">laptop / phone</text>
  <text x="52" y="116" fill="#f59e0b" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">tailnet peer</text>
  <path d="M196 96 H260" stroke="#14b8a6" stroke-width="3" fill="none" marker-end="url(#arrowTailscaleAgent)"/>
  <rect x="268" y="40" width="184" height="112" rx="8" fill="#123052" stroke="#f59e0b" stroke-width="2"/>
  <text x="292" y="80" fill="#f59e0b" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">Tailscale mesh</text>
  <text x="280" y="108" fill="#cbd5e1" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">WireGuard + ACLs</text>
  <text x="292" y="132" fill="#cbd5e1" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">MagicDNS names</text>
  <path d="M460 96 H524" stroke="#14b8a6" stroke-width="3" fill="none" marker-end="url(#arrowTailscaleAgent)"/>
  <rect x="532" y="56" width="164" height="80" rx="8" fill="#123052" stroke="#14b8a6" stroke-width="2"/>
  <text x="556" y="92" fill="#f8fafc" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">agent host</text>
  <text x="548" y="116" fill="#f59e0b" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">100.x address</text>
  <rect x="24" y="184" width="672" height="68" rx="8" fill="#123052" stroke="#64748b" stroke-width="2"/>
  <text x="36" y="216" fill="#f8fafc" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">Skip public port-forward. Keep Claude Code deny rules on the host anyway [3][7].</text>
  <text x="36" y="240" fill="#cbd5e1" font-family="ui-sans-serif, system-ui, sans-serif" font-size="14">Reachability is not authorization for .env files.</text>
</svg>
</figure>

*The mesh answers who can dial the box. Permission rules on the agent still decide which files tools may read.*

## Tighten who can reach the agent host

ACL docs describe policy that controls which devices and users can talk on the tailnet [3]. Prefer tags for agent boxes (for example a production tag) and grant only your laptop user or group access to SSH or the T3 port. Do not leave "allow all" if the host holds cloud keys [3].

Controls that matter together:

1. Install and join: `install.sh` plus `tailscale up` [1][2].
2. Name lookup: MagicDNS for stable hostnames [4].
3. Who can connect: ACLs and tags [3].
4. Agent UI remote: T3 LAN and Tailscale routes [5].
5. Secrets on disk: Claude Code deny rules still required [7].

## Pair an agent UI over the tailnet

For T3 Code, remote-access docs say `t3 up --lan` (or the LAN choice in `t3 up`) is the LAN/private-network pairing path, with a pairing code as the gate for devices on those networks [5]. It is not Tailscale itself. After both devices join the same tailnet, T3 can learn Tailscale routes and the docs cover Tailscale HTTPS as a separate step [5]. Follow that doc for the exact Settings clicks on the day you install [5].

```bash
t3 up --lan
```

Expect a pairing link or QR for a phone or second desktop on the same tailnet. Keep the host awake; remote docs require the machine to stay running and reachable [5]. For terminal choices around agent work, see [Terminals for agent work](/blog/terminals-for-agent-work). For trying T3 itself, see [Try T3 Code](/blog/t3-code-agent-workspace).

## Keep Claude Code permissions separate

Tailscale only answers "who can reach the box." Claude Code still needs deny rules for `.env` and a check before merge. Pair this page with [env lock](/blog/claude-code-env-lock) and [terminals for agent work](/blog/terminals-for-agent-work) [6][7].

A common failure mode is opening SSH on `0.0.0.0` "just for the weekend" while Tailscale is already installed. You then have two paths: the private one you meant, and a public one scanners find. Prefer listening on the Tailscale interface or binding SSH to the `100.x` address, then confirm with `ss` or `tailscale status` that the public NIC is not advertising the same port [2][3].

## Operate day to day

Check membership after sleep or VPN changes with `tailscale status`. If a node shows offline, wake the machine or re-run `tailscale up` before you dig into agent UI bugs [2]. MagicDNS names fail when MagicDNS is disabled in the admin console; fall back to the `100.x` address while you fix the setting [4].

When a contractor needs temporary access, add their device or user through ACLs with an expiry rather than sharing your laptop's SSH key [3]. Revoke the tag grant the same day the contract ends. Network access revocation is faster than rotating every secret the agent ever touched, but you should still rotate cloud keys if the host was fully exposed.

SSH over the tailnet still uses normal user keys. Generate and install those with the [SSH keys for developers](/blog/ssh-keys-for-developers) flow, then point a Host alias at the MagicDNS name so scripts stay short ([SSH config](/blog/ssh-config)).

## Mistakes that reopen the public internet

Port-forwarding the agent host "temporarily" after Tailscale already works. Scanners do not respect temporary [3].

Leaving ACLs as allow-all because the first `t3 up` pairing felt hard. Tags and least privilege are the product feature you bought [3].

Treating Tailscale as a substitute for `.env` deny rules. Reachability and tool permissions are different layers [7].

Binding SSH only to `0.0.0.0` and hoping another firewall layer saves you. Prefer the tailnet address and verify listeners [2].

Skipping MagicDNS then hard-coding stale `100.x` addresses into phone shortcuts after a node rebuild [4].

Sharing one auth account across three laptops so you cannot revoke a single lost device cleanly [3].

## Exit nodes and subnets (keep narrow)

Tailscale can advertise exit nodes and subnet routes. Those features widen reach beyond a single agent host. For coding agents, start with node-to-node access only. Advertise a subnet only when a runbook says the agent must reach a private database network, and put that grant behind tags with expiry [3]. An exit node that routes all laptop traffic through a GPU box is a different threat model than "SSH to the agent."

Subnet routes also tempt people to skip ACLs ("everyone on the office LAN can hit the agent"). Keep the ACL table explicit even when routes exist [3].

## Logging and break-glass

Keep a short break-glass note: how to get console access if Tailscale auth fails (cloud provider serial console, physical keyboard, or out-of-band IPMI). Without that note, a bad ACL edit locks you out of the only path you use to fix ACLs. Test the break-glass path once after you tighten policy [2][3].

Pair SSH identities with [SSH keys for developers](/blog/ssh-keys-for-developers) and Host aliases from [SSH config](/blog/ssh-config) so scripts call `ssh agent-box` instead of a raw `100.x` address that changes after a reinstall.

## What you have now

A private path to an agent host without opening the coding box to the public internet, plus a reminder that Claude Code deny rules still apply on disk [5][7]. Install, join, tighten ACLs, then pair the UI. Related terminal choices live on [Terminals for agent work](/blog/terminals-for-agent-work). When you raise clients to v1.106 for hybrid ML-KEM-768, use [Tailscale v1.106 hybrid ML-KEM-768](/blog/tailscale-v1106-hybrid-ml-kem-768).

Browse the [Dev tools topic](https://fullbytedeveloper.com/blog/topic/dev-tools).

Send this to the friend who was about to port forward a GPU box for Claude Code.

Image: Dark metallic cube with an orange center port surrounded by six interlocking teal rings with orange accents, cyan arrowed paths carrying small shapes inward on a dark grid floor.
https://fullbytedeveloper.com/media/tailscale-for-agent-machines/tailscale-for-agent-machines-venice.webp
The agent host sits on a private mesh; peers reach it through the tailnet instead of a public port forward.

## Sources

1. [Tailscale Linux download / install.sh, accessed 2026-12-03](https://tailscale.com/download/linux)
2. [Tailscale CLI docs, accessed 2026-12-03](https://tailscale.com/kb/1080/cli)
3. [Tailscale ACL docs, accessed 2026-12-03](https://tailscale.com/kb/1018/acls)
4. [Tailscale MagicDNS, accessed 2026-12-03](https://tailscale.com/kb/1081/magicdns)
5. [T3 Code remote access docs, accessed 2026-12-03](https://github.com/pingdotgg/t3code/blob/main/docs/user/remote-access.md)
6. [Full Byte Developer: Terminals for agent work](https://fullbytedeveloper.com/blog/terminals-for-agent-work)
7. [Full Byte Developer: Lock Claude Code out of your .env](https://fullbytedeveloper.com/blog/claude-code-env-lock)
