docs/cli/approvals.md
openclaw approvalsManage exec approvals for the local host, gateway host, or a node host.
By default, commands target the local approvals file on disk. Use --gateway to target the gateway, or --node to target a specific node.
Alias: openclaw exec-approvals
Related:
openclaw exec-policyopenclaw exec-policy is the local convenience command for keeping the requested
tools.exec.* config and the local host approvals file aligned in one step.
Use it when you want to:
tools.exec.* and local ~/.openclaw/exec-approvals.jsonExamples:
openclaw exec-policy show
openclaw exec-policy show --json
openclaw exec-policy preset yolo
openclaw exec-policy preset cautious --json
openclaw exec-policy set --host gateway --security full --ask off --ask-fallback full
Output modes:
--json: prints the human-readable table view--json: prints machine-readable structured outputCurrent scope:
exec-policy is local-only--host node is rejected in this command because node exec approvals are fetched from the node at runtime and must be managed through node-targeted approvals commands insteadopenclaw exec-policy show marks host=node scopes as node-managed at runtime instead of deriving an effective policy from the local approvals fileIf you need to edit remote host approvals directly, keep using openclaw approvals set --gateway
or openclaw approvals set --node <id|name|ip>.
openclaw approvals get
openclaw approvals get --node <id|name|ip>
openclaw approvals get --gateway
openclaw approvals get now shows the effective exec policy for local, gateway, and node targets:
tools.exec policyPrecedence is intentional:
tools.exec policy can narrow or broaden intent, but the effective result is still derived from the host rules--node combines the node host approvals file with gateway tools.exec policy, because both still apply at runtimeopenclaw approvals set --file ./exec-approvals.json
openclaw approvals set --stdin <<'EOF'
{ version: 1, defaults: { security: "full", ask: "off" } }
EOF
openclaw approvals set --node <id|name|ip> --file ./exec-approvals.json
openclaw approvals set --gateway --file ./exec-approvals.json
set accepts JSON5, not only strict JSON. Use either --file or --stdin, not both.
For a host that should never stop on exec approvals, set the host approvals defaults to full + off:
openclaw approvals set --stdin <<'EOF'
{
version: 1,
defaults: {
security: "full",
ask: "off",
askFallback: "full"
}
}
EOF
Node variant:
openclaw approvals set --node <id|name|ip> --stdin <<'EOF'
{
version: 1,
defaults: {
security: "full",
ask: "off",
askFallback: "full"
}
}
EOF
This changes the host approvals file only. To keep the requested OpenClaw policy aligned, also set:
openclaw config set tools.exec.host gateway
openclaw config set tools.exec.security full
openclaw config set tools.exec.ask off
Why tools.exec.host=gateway in this example:
host=auto still means "sandbox when available, otherwise gateway".gateway or /exec host=gateway.This matches the current host-default YOLO behavior. Tighten it if you want approvals.
Local shortcut:
openclaw exec-policy preset yolo
That local shortcut updates both the requested local tools.exec.* config and the
local approvals defaults together. It is equivalent in intent to the manual two-step
setup above, but only for the local machine.
openclaw approvals allowlist add "~/Projects/**/bin/rg"
openclaw approvals allowlist add --agent main --node <id|name|ip> "/usr/bin/uptime"
openclaw approvals allowlist add --agent "*" "/usr/bin/uname"
openclaw approvals allowlist remove "~/Projects/**/bin/rg"
get, set, and allowlist add|remove all support:
--node <id|name|ip>--gateway--url, --token, --timeout, --jsonTargeting notes:
--gateway targets the gateway host approvals file--node targets one node host after resolving id, name, IP, or id prefixallowlist add|remove also supports:
--agent <id> (defaults to *)--node uses the same resolver as openclaw nodes (id, name, ip, or id prefix).--agent defaults to "*", which applies to all agents.system.execApprovals.get/set (macOS app or headless node host).~/.openclaw/exec-approvals.json.