OpenClaw Tools 的配置方法

OpenClaw 提供了 4 种预定义配置文件,用于控制工具权限
| Profile | 权限范围 | 适用场景 |
| minimal | 仅 session_status(会话状态) | 受限环境、只读监控 |
| coding | 文件系统、运行时、会话、内存、图片 | 代码开发、自动化脚本、技术支持 |
| messaging | 仅消息相关工具(默认) | 客服机器人、通知助手 |
| full | 所有工具(无限制) | 开发环境、超级管理员 |
OpenClaw 的主要配置文件位于:
~/.openclaw/openclaw.json
举例:
1、快速启用全部权限(推荐开发环境)
{
"tools": {
"profile": "full"
}
}
2、精细化权限控制,如下:
{
"tools": {
"profile": "coding",
"allow": ["web_search", "browser", "canvas"],
"deny": ["gateway", "exec"] #最先匹配这里
}
}
优先级如下:
deny (最高) → allow → profile (最低)
allow的意思是追加权限,因此正确的理解是,在coding功能的基础上,加上allow指定的功能,但是拒绝deny指定的功能
根据官方文档,coding 配置文件默认包含:
- 文件系统:
read,write,edit,apply_patch - 运行时:
exec,bash,process - 会话:
sessions_list,sessions_send,sessions_spawn - 内存:
memory_search,memory_get - 图片:
image
3、如果要严格限制只能使用特定的工具,应该使用minimal,如图:
{
"tools": {
"profile": "minimal", // 从最小权限开始
"allow": ["web_search", "browser", "canvas", "read", "write"]
}
}
4、多层策略精准控制权限,如下:
{
"tools": {
// 基础配置文件
"profile": "coding",
// 全局允许(可使用工具组)
"allow": [
"group:openclaw", // 所有核心工具
"group:fs", // 仅文件系统工具
"my_custom_tool" // 自定义工具
],
// 全局拒绝(覆盖允许列表)
"deny": ["exec", "gateway"],
// 基于提供商的策略
"byProvider": {
"anthropic": {
"profile": "full" // Claude模型允许所有工具
},
"openai": {
"allow": ["read", "write", "web_search"]
}
}
},
#控制特定的agent的权限
"agents": {
"list": [
{
"id": "coding-assistant",
"tools": {
"profile": "coding",
"alsoAllow": ["browser", "canvas"]
}
}
]
}
}


