Skip to content

Add opt-in Tailscale Serve with tailnet identity authentication for generated WSL gateways #966

Closed

Description

@andyeskridge

Summary

Add an opt-in Tailscale Serve mode when creating or replacing an OpenClaw-generated WSL gateway. The gateway remains loopback-bound inside WSL, while Tailscale Serve publishes private HTTPS/WSS access on the user’s tailnet.
When enabled, the generated gateway should trust Tailscale identity authentication in addition to its normal token/device flows.

Requested behavior

  • Add a setup toggle for Tailnet access with Tailscale Serve.
  • Require Windows Tailscale to be installed, connected, and MagicDNS-enabled before destructive gateway replacement begins.
  • Install and authorize Tailscale inside the generated WSL distro.
  • Support browser authorization and transient auth-key authorization; never persist auth keys.
  • Register Companion with the discovered wss://<wsl-node>.<tailnet>.ts.net endpoint while preserving app-managed WSL behavior, keepalive, and replacement detection.
  • Use the real discovered tailnet suffix in setup and completion UI.
  • Do not silently fall back to localhost for managed .ts.net gateways.
  • Add Tailscale-specific recovery guidance for Windows login, tailnet mismatch, WSL daemon state, Serve status, and gateway health.
  • Redact auth keys and Tailscale authorization URLs from logs, journals, diagnostics, and errors.
  • Configure OpenClaw with:
gateway.bind=loopback
gateway.tailscale.mode=serve
gateway.tailscale.resetOnExit=false
gateway.auth.allowTailscale=true

Security note

Enabling gateway.auth.allowTailscale=true means tailnet ACLs and Tailscale identity become an authorization path for the gateway. The setup UI and documentation should state this clearly. Token and device credentials should remain supported for pairing and compatibility.

Acceptance criteria

  • Windows and WSL must be on the same MagicDNS tailnet before pairing.
  • tailscale serve status --json routes HTTPS to the loopback gateway port.
  • Windows can reach the generated https://…ts.net endpoint.
  • Companion registers a managed local WSS gateway record and connects through it.
  • The Windows node connects through the WSS record.
  • openclaw nodes invoke --command device.info --params '{}' succeeds through the real gateway.

Activity

  1. moved this from Backlog to In progress in Windows Companion Appon Jul 10, 2026
  2. clawsweeper commented on Jul 10, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 13, 2026, 7:21 PM ET / 23:21 UTC.

    Summary
    Keep open: current main does not provide Tailscale provisioning or tailnet-identity authentication for generated WSL gateways, and the open linked implementation still requires an explicit security-boundary decision before it can land.

    Reproducibility: not applicable. This issue requests a new opt-in provisioning and authorization mode rather than reporting broken established behavior. Current source inspection confirms the mode is absent.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Do not queue a separate repair: the open closing pull request already owns implementation, and maintainers must first resolve the security-boundary decision before reviewing it for landing.

    Maintainer decision needed

    • Question: Should generated WSL gateways opt in to trusting Tailscale identity and tailnet ACLs as an additional gateway authorization path managed by Companion?
    • Rationale: The repository cannot infer whether core setup should install and operate Tailscale or treat tailnet identity as authorization; that choice changes the gateway trust boundary and long-term recovery obligations.
    • Likely owner: samanthamsong — They reopened the issue after cleanup, making them the strongest available routing candidate for the unresolved trust-boundary decision.
    • Options:
      • Approve the guarded opt-in (recommended): Allow the feature only when explicitly enabled, retain token and device authentication, forbid Funnel, validate matching MagicDNS tailnets before replacement, and require complete secret redaction and recovery proof.
      • Provision Serve without identity trust: Permit managed private WSS publication but continue requiring normal OpenClaw token or device credentials for every gateway connection.
      • Keep Tailscale user-managed: Continue supporting manually configured .ts.net endpoints while leaving Tailscale installation, Serve lifecycle, and identity policy outside Companion setup.

    Security
    Needs attention: The requested feature deliberately adds Tailscale identity and ACLs to the gateway trust boundary, requiring explicit maintainer approval and focused security validation.

    Review details

    Best possible solution:

    Keep the issue paired with #967 and land that implementation only after maintainers approve tailnet identity as a core authorization path and verify fresh-install, destructive-replacement, rollback, secret-redaction, and real gateway invocation behavior.

    Do we have a high-confidence way to reproduce the issue?

    Not applicable: this issue requests a new opt-in provisioning and authorization mode rather than reporting broken established behavior. Current source inspection confirms the mode is absent.

    Is this the best way to solve the issue?

    Unclear pending maintainer approval: the linked pull request implements the requested end-to-end workflow with strong live proof, but core ownership of Tailscale lifecycle and tailnet-identity authorization must be decided first.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Trusting Tailscale identity makes tailnet ACL configuration part of the gateway authorization boundary; an incorrect or unexpectedly broad ACL could grant gateway access without an OpenClaw token.
    • Browser and auth-key enrollment introduce sensitive authorization material that must remain absent from setup logs, journals, diagnostics, command lines, persisted settings, and error messages.
    • Provisioning Tailscale inside a managed WSL distro expands setup and replacement lifecycle ownership, including daemon health, tailnet mismatch, MagicDNS prerequisites, Serve cleanup, and recovery from partial replacement.

    Codex review notes: model internal, reasoning high; reviewed against 77c42440376e.

    Label changes

    Label changes:

    • add P2: This is a substantial but optional setup and remote-access improvement rather than a regression blocking existing core workflows.
    • add impact:security: The request changes gateway authorization boundaries, handles transient Tailscale credentials, and relies on tailnet ACL policy.
    • add impact:auth-provider: The feature adds Tailscale identity as an authentication path alongside existing token and device credentials.
    • add issue-rating: 🌊 off-meta tidepool: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.
    • add clawsweeper:needs-security-review: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a substantial but optional setup and remote-access improvement rather than a regression blocking existing core workflows.
    • impact:security: The request changes gateway authorization boundaries, handles transient Tailscale credentials, and relies on tailnet ACL policy.
    • impact:auth-provider: The feature adds Tailscale identity as an authentication path alongside existing token and device credentials.
    Evidence reviewed

    Security concerns:

    • [high] Tailnet identity becomes gateway authorization
      Enabling gateway.auth.allowTailscale=true permits identity established by Tailscale and constrained by tailnet ACLs to authorize gateway access, so the intended ACL assumptions and failure behavior must be explicitly approved.
      Confidence: 0.98
    • [medium] Enrollment secrets require end-to-end redaction
      Transient auth keys and browser authorization URLs can appear across process invocation, setup output, journals, diagnostics, and exceptions unless every boundary is tested for non-persistence and redaction.
      Confidence: 0.94

    What I checked:

    • Current setup engine lacks the requested workflow: The current setup pipeline contains WSL installation, gateway configuration, pairing, and registration steps but no Tailscale installation, authorization, Serve configuration, or tailnet discovery path. citeturn388490view0. (src/OpenClaw.SetupEngine/SetupSteps.cs:18, 77c42440376e)
    • Existing architecture supports managed local gateways, not managed Tailscale provisioning: Current architecture documents app-managed WSL gateway discovery and local connection behavior, which the requested remote WSS registration would extend rather than merely configure. citeturn654129view0. (docs/CONNECTION_ARCHITECTURE.md:24, 77c42440376e)
    • An open pull request owns implementation: Add Tailscale Serve support for WSL gateways #967 explicitly closes this issue and supplies the requested provisioning, authentication, registration, recovery, redaction, tests, and live proof, but remains open and unmerged at head 36187ba. (36187ba2d344)
    • Maintainer follow-up is active: samanthamsong reopened this issue on July 13, 2026 after an earlier close, so the issue should remain paired with the open implementation until maintainers resolve its security and product direction.
    • Security boundary is explicit: The request would enable gateway.auth.allowTailscale=true, making tailnet identity and ACL policy an additional gateway authorization path while retaining device and token credentials.

    Likely related people:

    • samanthamsong: Reopened the issue after its initial cleanup close, indicating active responsibility for deciding whether this security-sensitive setup direction should remain under review. (role: issue state reviewer and likely decision owner; confidence: medium; files: src/OpenClaw.SetupEngine/SetupSteps.cs, src/OpenClaw.Tray.WinUI/Pages/SetupWizardPage.xaml.cs)
    • andyeskridge: Authored the issue and the open closing pull request containing the concrete Tailscale setup, authentication, registration, recovery, and redaction implementation. (role: linked implementation author; confidence: high; commits: 36187ba2d344; files: src/OpenClaw.SetupEngine/SetupSteps.cs, src/OpenClaw.SetupEngine/SetupContext.cs, src/OpenClaw.Tray.WinUI/Pages/SetupWizardPage.xaml.cs)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. moved this from Local Gateway to Channels in Windows Companion Appon Jul 13, 2026
  4. closed this as completedby moving to Channels in Windows Companion Appon Jul 13, 2026
  5. added
    P2
    impact:security
    impact:auth-provider
    issue-rating: 🌊 off-meta tidepool
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-product-decision
    clawsweeper:needs-security-review
    on Jul 13, 2026
  6. closed this as completedby moving to Channels in Windows Companion Appon Jul 14, 2026
  7. locked as resolved and limited conversation to collaborators on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:linked-pr-openclawsweeper:needs-product-decisionclawsweeper:needs-security-reviewclawsweeper:no-new-fix-primpact:auth-providerimpact:securityissue-rating: 🌊 off-meta tidepool

    Type

    No type

    Fields

    Priority

    Medium

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions