#How to lock openclaw.json

1 messages ยท Page 1 of 1 (latest)

swift grail
#

I want to lock openclaw.json configs. only allow to change agents config. when my openclaw gateway stopped it always couse from changing openclaw.json during chat with agent

paper surgeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> โœ… Mark Solution

limpid oreBOT
swift grail
#

i configured this in my openclaw.json "controlUi": {
"allowInsecureAuth": true,
"dangerouslyDisableDeviceAuth": true,
"allowedOrigins": [
"*"
]
} but somehow my openclaw was stopped and this config was changed

sly nacelleBOT
#

Let me verify this against the docs/code first, because config keys around openclaw.json are easy to get wrong.

#

I found something important: the gateway itself can persist some config changes on startup, and channel /config writes can also mutate openclaw.json unless you disable them. Checking the exact spots now.

#

Short answer: I could not find a documented built-in way to make openclaw.json writable only for agents.*.

I did verify one important thing though: startup only auto-seeds gateway.controlUi.allowedOrigins when that field is missing/empty on a non-loopback bind. An existing non-empty value like ["*"] should not get overwritten just from restart. So if it changed, something actually wrote config.

Best hardening Iโ€™d use:

{
  commands: {
    config: false,
  },
  channels: {
    discord: {
      configWrites: false,
    },
  },
#
  tools: {
    deny: ["gateway", "cron"],
    fs: { workspaceOnly: true },
  },
}

And also:

  • keep agent workspaces away from ~/.openclaw and away from ~
  • run openclaw security audit --fix to tighten state/config permissions

Why this helps:

  • commands.config: false disables /config
  • channels.discord.configWrites: false blocks Discord-initiated config writes
  • denying gateway blocks agent config.patch / config.apply
  • tools.fs.workspaceOnly: true helps stop direct file edits to ~/.openclaw/openclaw.json