Skip to content

[Bug]: Env var substitution rewrites config file with plain-text secrets on gateway restart #3261

Description

@dreamgoat011

Version: 2026.1.24-3
OS: Linux (Pi 5)
Install: npm global

Steps to reproduce:

  1. Create config with env var placeholder: "apiKey": "${NANOGPT_API_KEY}"
  2. Run clawdbot gateway restart
  3. Check config file - secrets are now written in plain text

Expected behavior:
Config file should remain unchanged with ${VAR_NAME} placeholders. Secrets should only be substituted in memory at runtime.

Actual behavior:
Config file is rewritten with actual secret values, exposing them in backups/version control.
Relevant docs: https://docs.molt.bot/gateway/configuration#env-var-substitution-in-config

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions