Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Tailscale

Scalekit connector
Open markdown

The Tailscale connector lets your AI agent act in each user's Tailscale account. Each user connects their own Tailscale access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 41 tools.

Tools
41
What they doRead · write · destructive
22 · 16 · 322 read16 write3 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Tailscale connection

    In AgentKit > Connections, create a Tailscale connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'tailscale'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Tailscale:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'tailscale_get_contacts',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Tailscale credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • tailscale_get_configuration_audit_logsRetrieve configuration audit log entries, the record of admin changes to a tailnet, for a time window.Read-only

    Get Configuration Audit Logs

    Retrieve configuration audit log entries, the record of admin changes to a tailnet, for a time window. Returns a logs array with one entry per configuration change, including when it happened, who made it and what changed. Use get_configuration_audit_logs to see who changed settings, ACLs or devices. Use get_network_flow_logs for traffic data.

    Inputs

    endstringrequired
    End Time as an RFC 3339 timestamp, for example '2026-10-01T00:00:00Z'. Logs older than the retention window (30 days) are trimmed to the window.
    startstringrequired
    Start Time as an RFC 3339 timestamp, for example '2026-10-01T00:00:00Z'. Logs older than the retention window (30 days) are trimmed to the window.
    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -
  • tailscale_get_contactsRetrieve the account, support and security contact emails of a tailnet.Read-only

    Get Contacts

    Retrieve the account, support and security contact emails of a tailnet. Returns account, support and security objects, each with email, fallbackEmail and needsVerification. Use get_contacts to read contact emails. Use update_contact to change one.

    Inputs

    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -
  • tailscale_get_deviceRetrieve the details of one device, including addresses, tags, OS, client version, key expiry and connection state.Read-only

    Get Device

    Retrieve the details of one device, including addresses, tags, OS, client version, key expiry and connection state. Returns the device object; pass fields=all to also include enabledRoutes, advertisedRoutes, clientConnectivity and postureIdentity. Use get_device when you already know the device ID. Use list_devices to discover IDs.

    Inputs

    device_idstringrequired
    ID of the device. The preferred form is the node ID returned as nodeId by the list devices tool (for example 'nABC123CNTRL'); the legacy numeric id (for example '12345') also works.
    fieldsstring
    Which fields to return: 'default' omits routes, clientConnectivity and postureIdentity; 'all' returns every field.one of defaultall
  • tailscale_get_device_routesRetrieve the subnet routes a device advertises and the subset that is enabled.Read-only

    Get Device Routes

    Retrieve the subnet routes a device advertises and the subset that is enabled. Returns advertisedRoutes and enabledRoutes, each an array of CIDR strings. Use get_device_routes before set_device_routes to see which advertised routes still need approval.

    Inputs

    device_idstringrequired
    ID of the device. The preferred form is the node ID returned as nodeId by the list devices tool (for example 'nABC123CNTRL'); the legacy numeric id (for example '12345') also works.
  • tailscale_get_dns_configurationRetrieve the full DNS configuration of a tailnet in one call.Read-only

    Get DNS Configuration

    Retrieve the full DNS configuration of a tailnet in one call. Returns nameservers, splitDNS, searchPaths and preferences (including magicDNS and overrideLocalDNS). Use get_dns_configuration for a complete snapshot. Use the narrower get_dns_nameservers, get_split_dns or get_dns_search_paths for one part.

    Inputs

    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -
  • tailscale_get_dns_nameserversRetrieve the global DNS nameservers configured for a tailnet.Read-only

    Get DNS Nameservers

    Retrieve the global DNS nameservers configured for a tailnet. Returns dns (an array of nameserver IP addresses) and magicDNS (whether MagicDNS is on). Use get_dns_nameservers to read the global resolvers. Use get_split_dns for per-domain resolvers.

    Inputs

    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -
  • tailscale_get_dns_preferencesRetrieve the DNS preferences of a tailnet.Read-only

    Get DNS Preferences

    Retrieve the DNS preferences of a tailnet. Returns magicDNS, a boolean that says whether MagicDNS is enabled. Use get_dns_preferences to check MagicDNS. Use set_dns_preferences to change it.

    Inputs

    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -
  • tailscale_get_dns_search_pathsRetrieve the DNS search paths configured for a tailnet.Read-only

    Get DNS Search Paths

    Retrieve the DNS search paths configured for a tailnet. Returns searchPaths, an array of domain suffixes. Use get_dns_search_paths to read the search domains. Use set_dns_search_paths to change them.

    Inputs

    tailnetstring
    Tailnet to operate on. Use '-' (a dash) for the default tailnet of the connected API token, or pass the organization name shown on the Tailscale admin console General settings page, for example 'example.com' or 'alice@gmail.com'.default -