Skip to content

browser.profiles.*.cdpUrl does not support SecretRef interpolation #78337

Description

@esqandil

Summary

browser.profiles.*.cdpUrl is the documented way to attach to a remote CDP service like Browserbase or Browserless, and the docs explicitly say "treat remote CDP URLs/tokens as secrets" (docs/tools/browser.md §Security). However, this field is not on the supported SecretRef surface, and the runtime reads the URL raw with no interpolation pass. The consequence is that the API key must live in cleartext inside openclaw.json.

This is a quiet trap: the field accepts arbitrary strings, the SecretRef resolver can be configured correctly, the WebSocket library would accept the URL — but the gateway routes the literal placeholder string to the remote service, which then fails with an opaque "not reachable" error.

Repro

  1. Configure a SecretRef provider for the API key:
    "secrets": {
      "providers": {
        "onepassword_browserbase": {
          "source": "exec",
          "command": "/usr/bin/op",
          "args": ["read", "op://OpenClaw/Browserbase/credential"]
        }
      }
    }
  2. Try any of these in browser.profiles.browserbase.cdpUrl:
    • wss://connect.browserbase.com?apiKey={{SECRET:onepassword_browserbase}}
    • wss://connect.browserbase.com?apiKey=${secret:onepassword_browserbase}
    • A raw SecretRef object — rejected by schema, the field is string.
  3. Run any browser tool with profile=browserbase. Connection fails because the literal interpolation token is sent as the API key.
  4. Inlining the resolved secret directly into cdpUrl works (and is the only path that does).

Source evidence

dist/config-qEt9W89m.js:

function resolveProfile(resolved, profileName) {
    const profile = resolved.profiles[profileName];
    if (!profile) return null;
    const rawProfileUrl = profile.cdpUrl?.trim() ?? "";
    // ... no resolveSecretString / interpolateSecrets call before use
}

docs/reference/secretref-credential-surface.md "Supported credentials" section does not list browser.profiles.*.cdpUrl. Critically, the omission is silent — there is no entry under "Unsupported credentials" either.

Why this matters

Today's debugging took ~30 minutes before reading the dist source revealed resolveProfile reads the URL raw. The user had to fall back to inlining the resolved API key into openclaw.json, which the docs themselves discourage ("avoid embedding long-lived tokens directly in config files" — docs/tools/browser.md §Security).

Existing related issues:

Suggested fix

Two options, in order of preference:

Option 1 (preferred): Add SecretRef interpolation to cdpUrl

Add a token-replacement pass at profile resolve time, expanding ${secret:<provider>} placeholders against the resolved secrets map. This matches user expectation, the docs' security guidance, and how other credential-bearing fields already work.

Option 2 (doc-only fallback): Document the exclusion explicitly

Add browser.profiles.*.cdpUrl to the "Unsupported credentials" list in docs/reference/secretref-credential-surface.md, and add a short note in docs/tools/browser.md §Browserbase saying SecretRef interpolation is not supported and the resolved key must be inlined.

Option 2 is a doc-only fix and unblocks users immediately; Option 1 is the correct long-term answer.

Environment

  • OpenClaw 2026.5.4 (commit 325df3e)
  • Linux x64, Node v22.22.2
  • Browserbase free tier

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape 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:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked 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