OpenClaw exec安全权限配置指南。用于配置tools.exec的security和ask参数,管理agent命令执行权限。触发词:exec权限、安全配置、提权、exec security、ask off、allowlist。
在 openclaw.json 的 tools.exec 下:
tools.exec.security 和 tools.exec.ask 无法通过 config.patch 或 gateway config.apply 修改,会报错:
gateway config.patch cannot change protected config paths: tools.exec.security
bash
python3 -c
import json
with open(/home/zzclaw/.openclaw/openclaw.json) as f:
c = json.load(f)
c[tools][exec][security] = full
c[tools][exec][ask] = off
with open(/home/zzclaw/.openclaw/openclaw.json, w) as f:
json.dump(c, f, indent=2, ensure_ascii=False)
print(done)
然后重启 gateway:
bash
openclaw gateway restart
| 场景 | security | ask | 说明 |
|---|---|---|---|
| 生产环境(严格) | allowlist | on-miss | 白名单内放行,其余审批 |
| 开发环境(宽松) |
security 为 allowlist 时,可通过 tools.exec.allowlist 配置允许的命令模式:
json
{
tools: {
exec: {
security: allowlist,
allowlist: [
git *,
npm *,
python3 *,
cat *,
ls *,
echo *
]
}
}
}
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 openclaw-exec-permission-1775875562 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-exec-permission-1775875562 技能
skillhub install openclaw-exec-permission-1775875562
文件大小: 2.08 KB | 发布时间: 2026-4-12 10:49