Bypassing Exec Approval in OpenClaw Discord
If you're using OpenClaw with Discord, you might suddenly find that every terminal command the AI tries to run gets blocked with an "Approval required" message. It used to work fine, and now nothing executes.
This post explains why it happens and how to fix it.
The Problem
When you ask the AI to run simple commands like git clone or cat in a Discord channel, you get:
Approval required (id xxx). Approve to run; updates will arrive after completion.
There's no obvious place to approve it, and after a timeout, the command is denied.
The Cause
During an OpenClaw update, the default exec security policy was tightened. All shell command executions now require explicit approval by default. This makes sense from a security standpoint, but it's inconvenient when you're the only user on a personal machine.
Three settings are involved:
approvals.exec— Global exec approval toggletools.elevated— Elevated tool usagechannels.discord.execApprovals— Discord channel-specific exec approval
The Fix
1. Disable Global Exec Approval
{
"approvals": {
"exec": {
"enabled": false
}
}
}
2. Disable Elevated Tools
{
"tools": {
"elevated": {
"enabled": false
}
}
}
3. Remove Discord execApprovals Section
{
"channels": {
"discord": {
"execApprovals": null
}
}
}
Apply the Changes
Run these commands in your terminal:
openclaw configure --patch '{"approvals":{"exec":{"enabled":false}}}'
openclaw configure --patch '{"tools":{"elevated":{"enabled":false}}}'
openclaw configure --patch '{"channels":{"discord":{"execApprovals":null}}}'
openclaw gateway restart
Final Config State
After the changes, the relevant parts of openclaw.json should look like this:
{
"approvals": {
"exec": {
"enabled": false
}
},
"tools": {
"elevated": {
"enabled": false
}
},
"channels": {
"discord": {
"enabled": true,
"allowFrom": ["<Discord User ID>"],
"guilds": {
"<Guild ID>": {
"requireMention": false
}
}
}
}
}
Important Notes
- With these settings, the AI will execute all shell commands without approval. Only use this in a trusted environment.
- If
execApprovalsremains in your config, it may overrideapprovals.exec.enabled: false. Make sure to remove it. tools.elevated.enabled: truecan also trigger approval requests.- Always run
openclaw gateway restartafter changing the config. - For a middle ground, use
tools.elevated.allowFromto restrict elevated access to specific users.