#How to lock openclaw.json
1 messages ยท Page 1 of 1 (latest)
i configured this in my openclaw.json "controlUi": {
"allowInsecureAuth": true,
"dangerouslyDisableDeviceAuth": true,
"allowedOrigins": [
"*"
]
} but somehow my openclaw was stopped and this config was changed
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
~/.openclawand away from~ - run
openclaw security audit --fixto tighten state/config permissions
Why this helps:
commands.config: falsedisables/configchannels.discord.configWrites: falseblocks Discord-initiated config writes- denying
gatewayblocks agentconfig.patch/config.apply tools.fs.workspaceOnly: truehelps stop direct file edits to~/.openclaw/openclaw.json
Also, gently, these are very risky:
gateway.controlUi.allowInsecureAuth: truegateway.controlUi.dangerouslyDisableDeviceAuth: truegateway.controlUi.allowedOrigins: ["*"]
Docs:
- https://docs.openclaw.ai/channels/discord
- https://docs.openclaw.ai/gateway/configuration-reference
- https://docs.openclaw.ai/web/control-ui
- https://docs.openclaw.ai/gateway/security
First thing, can you paste:
openclaw --version
openclaw config get commands