Skip to content

[Bug]: clearUnboundScopes strips operator scopes unconditionally for non-local token-auth clients #51396

Description

@marccampbell

Bug type

Regression (worked before, now fails)

Summary

In 2026.3.13, clearUnboundScopes() unconditionally strips all operator scopes for non-local clients without device identity, even when token auth succeeds. This breaks chat.send (and any operator.write-scoped method) for backend clients connecting over a network with valid --token auth.

Steps to reproduce

  1. Start gateway with openclaw gateway --bind tailnet --token
  2. Connect from a remote host (non-loopback) via WebSocket with valid token in auth.token and scopes: ["operator.admin"]
  3. Connection succeeds (hello-ok)
  4. Call chat.send → rejected with missing scope: operator.write

Connecting from localhost with the same token works fine.

Expected behavior

Non-local clients authenticating with a valid token should retain their requested scopes (same as localhost behavior).

Actual behavior

missing scope "operator.write" message received

OpenClaw version

2026.3.13

Operating system

Debian 12

Install method

npm global

Model

anthropic/opus-4.6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.regressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions