fix(server): recognize Tailscale Serve in auth policy #10083
main fromfix/audit-tailscale-reachability·opened View on GitHubTailscale Serve can expose a loopback-bound server, but its auth descriptor still advertises local-only access. The ordinary web Connections settings consequently show a disabled network-access indicator and tell users that only this machine can connect. Access management itself remains independently scope-gated.
Include the existing tailscaleServeEnabled configuration in reachability classification. Desktop retains desktop-bootstrap and gains one-time-token while Serve is configured. The original host-based policy returns when Serve is disabled. Cookie identity, session methods, update scope, credential validation, grant enforcement and listener binding retain their existing behavior.
This rebuild takes over #10083, preserving its history and merging current main. Credit to juliusmarminge and psalmsdove’s original Serve classification work carried by this PR. Related historical report: #4462, already closed by its reporter; the incorrect descriptor remains reproducible on current main. The earlier unrelated changes are excluded.
Human approval required#
Keep this unmerged until a maintainer approves the authentication reachability/bootstrap decision. This descriptor expresses configured remote intent, not transport health: it advertises remote access even if Serve setup fails. No liveness probe is introduced. The prior Macroscope human-review requirement remains in force.
Evidence and validation#
Base: 1451e7c. Candidate: 1c6bd66.
Production before/after output uses actual configuration, environment identity and policy services with disposable state:
| Configuration | Main | Candidate |
|---|---|---|
| Web, loopback, Serve enabled | loopback-browser | remote-reachable |
| Desktop, loopback, Serve enabled | desktop-managed-local, desktop bootstrap only | remote-reachable, desktop bootstrap plus one-time token |
| Same identity, Serve off → on → off | Always local | Remote while configured; original descriptor restored when off |
The runtime probe covers 127.0.0.1 and ::1, preserving cookie identity and session methods. These are service constructions under the same identity, not a live restart or session migration. No UI component changed; proof is the production descriptor rather than screenshots.
- Existing policy suite: 7 pass on main. Two new behavior cases fail on main and pass with the fix: 9 policy tests pass. The PoC host matrix was replaced with these two cases; main’s seven cases remain intact.
- Policy, auth and auth-utils suites: 38 tests pass across three files.
- Scoped lint, formatting, server typecheck and whitespace checks pass.
- Fresh implementation run, followed by full-diff Claude Opus 5.5 and Codex GPT-6 Sol reviews: one complete round, neither found substantive code defects. The stale UI-impact claim and old test counts in the previous body were corrected..
pnpm exec vp test run apps/server/src/auth/EnvironmentAuthPolicy.test.ts apps/server/src/auth/EnvironmentAuth.test.ts apps/server/src/auth/utils.test.ts
pnpm exec tsc-rs --noEmit -p apps/server/tsconfig.json
Not verified: actual Tailscale Serve/HTTPS forwarding, NixOS, live Connections UI, hosted/relay/tunnel connectivity, session migration, macOS/Windows/Linux Electron, iOS or Android. IPv6 policy classification does not prove forwarding to an IPv6-only listener; existing Serve forwarding targets IPv4 loopback.
Current-head CI: lint, build/typecheck, tests, all eight server shards and the aggregate check pass. Preview/web/native/static/smoke jobs skipped where configured. A cancelled Mobile Fingerprint Check was superseded by a successful run of the same workflow/event on the same head. Macroscope Correctness passed; Approvability is neutral and explicitly requires human approval of this auth-policy change. There are no unresolved review threads or active change requests. No current-head CodeRabbit code review is present; the two independent full-diff reviews cover the rebuild. This remains unmerged and is not a merge-ready verdict while the human hold is open.
Tests: GPT-6 Astra; implementation: GPT-6.1 Sol; independent reviews: Claude Opus 5.5 and GPT-6 Sol. Codex and Claude harnesses through T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
1451e7c· PR result:1c6bd66· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
juliusmarminge added labelsmacroscope-review
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch ssh-relay-remote-04. I will merge main into the existing origin branch, rebuild the intended-reachability classification with separate tests and implementation, and run independent adversarial reviews. Human approval of the auth/bootstrap classification remains required; this will stay unmerged. Credit to psalmsdove's original Serve reachability work is retained.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
3d1935dc-f675-4923-8684-102db0bc15df
📥 Commits
-
Reviewing files that changed from the base of the PR and between 1451e7cb23034d29774338608368a15d8845df36 and 1c6bd66ea1feddd24085e313b2a673064a3c5764.
📒 Files selected for processing: 2
-
apps/server/src/auth/EnvironmentAuthPolicy.test.tsapps/server/src/auth/EnvironmentAuthPolicy.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
📝 Walkthrough
-
The auth policy now treats enabled Tailscale Serve as remote reachability, even when the configured host is not remotely reachable. Tests cover web and desktop auth descriptors with Serve enabled and disabled.
Changes: Tailscale Serve auth policy
Layer / File(s) Summary Remote reachability policy and coverage
apps/server/src/auth/EnvironmentAuthPolicy.ts,apps/server/src/auth/EnvironmentAuthPolicy.test.tsThe policy considers enabled Tailscale Serve sufficient for remote reachability. Tests check web and desktop descriptors when Serve is disabled, enabled, and disabled again. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: ⚪ Minimal · up to
1c6bd-
No code issue is identified that blocks merging after normal checks. The stated maintainer approval of the authentication policy is still required.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly identifies the server fix: recognizing Tailscale Serve in authentication policy classification. Description check The description explains the problem, implementation, scope, approval requirement, verification results, limitations, and test evidence. It does not use the template headings exactly, but it provides … Linked Issues check Issue #4462is closed and supplies historical context only. No active directly linked issue remains, so this pull request has no applicable linked-issue coding requirement. The reported policy change …Out of Scope Changes check The changes are limited to EnvironmentAuthPolicy.tsand its focused test. They addtailscaleServeEnabledto reachability classification and verify restoration of the local descriptor. These change…Full details: Description check
-
Explanation
The description explains the problem, implementation, scope, approval requirement, verification results, limitations, and test evidence. It does not use the template headings exactly, but it provides the required information in clearly separated sections.
Full details: Linked Issues check
-
Explanation
Issue
#4462is closed and supplies historical context only. No active directly linked issue remains, so this pull request has no applicable linked-issue coding requirement. The reported policy change matches the stated historical context.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to
EnvironmentAuthPolicy.tsand its focused test. They addtailscaleServeEnabledto reachability classification and verify restoration of the local descriptor. These changes match the stated PR intent and do not demonstrate unrelated scope.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
tanstack-source added labelsbug
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This small, tested change alters the server's advertised authentication reachability and desktop bootstrap methods when Tailscale Serve is enabled. Because it modifies production authentication policy code, maintainer review is required.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).