-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Feature request: first-class .env / environment-backed secret config UX #46109
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper 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 does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper 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 does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature request: first-class
.env/ environment-backed secret config UXSummary
OpenClaw already supports environment-backed secrets well enough for runtime, but the UX still nudges users toward storing secrets directly in
openclaw.json.Using
.env/ environment variables is materially better for:However, once users move secrets out of config and into environment variables, the Control UI / config experience becomes worse:
Why this matters
For real-world setups, users commonly want to keep these out of
openclaw.json:gateway.auth.tokenchannels.discord.tokenThat improves security immediately:
But the current UX makes env-backed config feel second-class.
Current pain point
Example:
channels.discord.token,gateway.auth.token,tools.web.search.apiKey, orskills.entries.notion.apiKeyto.envThis creates a bad tradeoff:
Proposal
Treat env-backed secrets as a first-class configuration mode in both CLI and Control UI.
1. Secret source awareness
For secret fields, show source metadata in config views:
configenvunsetIn UI, a secret should never look simply empty if it is being resolved from environment.
Suggested display:
••••••••From envDISCORD_BOT_TOKEN2. Preserve env references in config editing UX
If a field is set as
${DISCORD_BOT_TOKEN}or similar, the UI should recognize it as an env reference rather than flattening it into “blank” or forcing raw secret entry.Suggested behavior:
From env: DISCORD_BOT_TOKEN3. Add a dedicated “Secrets” / “Environment” helper
This could be minimal but still very useful:
.envas the recommended local secret file4. Make migration/security guidance explicit
When the UI detects secrets stored directly in config, it could suggest:
Even a small affordance here would improve default security posture.
5. Keep values masked, but not invisible
The important point is not to reveal secrets, but to avoid ambiguous emptiness.
Good UX:
Bad UX:
Expected outcome
This would let users get both:
.env/ environment variablesIt would also make multi-machine migration and backup workflows much cleaner, since users can keep:
openclaw.jsonas portable config.envas local secret materialSuggested scope
Even a small first step would already help a lot:
From envinstead of blankThat alone would remove most of the current UX penalty for doing the safer thing.