What you’ll see
Tailscale
- Tailnet: how many devices are online, the next device key to expire, how many expire within 14 days, and how many devices have a Tailscale update waiting.
- Devices: every device as a dot, under Tagged, Personal and Shared with you. Green is online. Grey is offline, which laptops and phones are whenever they sleep. Orange is a key that expires within 14 days or a device waiting for approval, and red is a key that has expired or expires today. Hover over a dot for its reason or when it was last seen; click it for the device’s page. Devices with key expiry turned off never count as a problem for it, and neither do devices shared with you, whose keys belong to their own tailnet.
Device
One page for every device, opened from its dot and titled with its name.
- Now: online, or when it was last seen, and its key expiry when it’s close. In the corner, Turn off key expiry or Turn on key expiry (whichever applies), and Approve device while it waits for approval. Both Approve and turning expiry back on ask first.
- Online, last 24 hours: a strip of the day, from Legato’s own checks every 5 minutes, which it keeps in History. It starts filling when you add the pages.
- Details: key expiry, its Tailscale address and MagicDNS name, its owner or tags, its Tailscale version, its subnet routes and exit node, and its system.
Status
- Watches each device’s key and approval.
- Red when a device’s key has expired or expires today, orange when it expires within 14 days or the device is waiting for approval.
- Grey for a device that’s offline, which never needs attention.
- Notifies you when it turns orange or red.
How it connects
The pages read Tailscale’s API at api.tailscale.com, signed in as an OAuth client. Legato trades the client’s ID and secret for a short-lived access token and gets a new one as it runs out (Tailscale’s OAuth clients). They use - for the tailnet, which means the client’s own tailnet.
Requests it makes on its own 3
- POST
/api/v2/oauth/tokenAn access token for the client.
BothWhen the access token runs out
- GET
/api/v2/tailnet/-/devices?fields=all Every device with its online state, last seen, key expiry, approval, tags and version.
TailscaleOnce a minute
- GET
/api/v2/device/{param.id}?fields=all One device.
DeviceOnce a minute
Requests it makes when you act 2
- POST
/api/v2/device/{param.id}/keyTurns the device’s key expiry off or back on.
DeviceWhen you press Turn off key expiry or Turn on key expiry
- POST
/api/v2/device/{param.id}/authorizedLets a device that’s waiting join the tailnet.
DeviceWhen you press Approve device
Online means the device is connected to Tailscale’s control server, as the admin console shows it. Tailscale doesn’t publish a rate limit for its API; the pages make about 120 requests an hour with the overview and one device open. Tailscale answers every device at once, and the 1 MB cap on an answer is reached at a few hundred devices.
The client can do only what its scopes allow. Devices Core set to Read is enough for every card. The buttons need Devices Core set to Write, and Tailscale asks you to pick a tag when you choose that. With a read-only client the buttons don’t work.
Sources and buttons explains each part of a page.
Set it up
- Make an OAuth client. In the Tailscale admin console, open the Trust credentials page, choose Credential, then OAuth. Set Devices Core to Read, or to Write with a tag if you want the buttons, and choose Generate credential. Copy the client ID and the client secret before you close the page.
- Save it in Legato. In Settings → Secrets, save it under
tailscale-client, bound toapi.tailscale.com, as the client ID and the secret joined by a colon:client-id:client-secret. If you keep the client in 1Password, link two references, one to the client ID field and one to the client secret field. Installing from Legato’s gallery asks for the two in their own fields. - Add the pages. Paste the prompt into your agent, or download the two pages and run
/Applications/Legato.app/Contents/Helpers/legato set tailscale-device tailscale-device.json, thenlegato set tailscale tailscale.json. Keep the IDtailscale-device: every dot opens it with its device’s ID.
The cards fill within a minute. A mistyped or revoked client is the usual reason they don’t: the card says Tailscale refused the OAuth client, and after a few tries the devices turn into one red dot.
A client doesn’t expire, so there’s nothing to renew. To stop Legato’s access, revoke the client on the Trust credentials page.
Prompt for your agent
Add 2 Legato pages for Tailscale, starting from https://legatobar.com/examples/tailscale.json, https://legatobar.com/examples/tailscale-device.json. Use the page IDs tailscale, tailscale-device if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. I’ll save my Tailscale OAuth client as tailscale-client in Settings → Secrets myself. Don’t press Approve device or the key expiry buttons to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.Download the pages
Questions
Can I use an API access token instead?
The pages installed from the gallery sign in with an OAuth client, because an API access token runs out and every card stops until you make a new one. If you’d rather use a token, change each source’s auth to { "type": "bearer" } and save the token under the source’s secret name. Nothing then warns you before it expires.
Why is an offline device grey and not red?
Phones and laptops go offline whenever they sleep, so offline isn’t a problem by itself. A device counts as a problem only for things that need you: a key about to expire, or a device waiting for approval.
Why can’t I connect, disconnect or pick an exit node?
Those belong to the Tailscale app on this Mac, and Tailscale’s API can’t change them. The pages work with your tailnet as the admin console does.
Does it work with Headscale?
No. Headscale has its own API, which these pages don’t read.