Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Exec approvals are the companion app / node host guardrail for letting a sandboxed agent run commands on a real host (
gatewaynodefull| Command | What it shows |
|---|---|
text openclaw approvals gettext --gatewaytext --node <id|name|ip> | Requested policy, host policy sources, and the effective result. |
text openclaw exec-policy show | Local-machine merged view. |
text openclaw exec-policy settext preset | Synchronize the local requested policy with the local host approvals file in one step. |
When a local scope requests
host=nodeexec-policy showIf the companion app UI is not available, any request that would normally prompt is resolved by the ask fallback (default:
denyExec approvals are enforced locally on the execution host:
openclawsystem.runApprovals live in a local JSON file on the execution host:
text~/.openclaw/exec-approvals.json
Example schema:
json{ "version": 1, "socket": { "path": "~/.openclaw/exec-approvals.sock", "token": "base64url-token" }, "defaults": { "security": "deny", "ask": "on-miss", "askFallback": "deny", "autoAllowSkills": false }, "agents": { "main": { "security": "allowlist", "ask": "on-miss", "askFallback": "deny", "autoAllowSkills": true, "allowlist": [ { "id": "B0C8C0B3-2C2D-4F8A-9A3C-5A4B3C2D1E0F", "pattern": "~/Projects/**/bin/rg", "source": "allow-always", "commandText": "rg -n TODO", "lastUsedAt": 1737150000000, "lastUsedCommand": "rg -n TODO", "lastResolvedPath": "/Users/user/Projects/.../bin/rg" } ] } } }
exec.securityexec.askaskFallbackdenyallowlistfulltools.exec.strictInlineEvalExamples that strict mode catches:
python -cnode -enode --evalnode -pruby -eperl -eperl -Ephp -rlua -eosascript -eIn strict mode these commands still need explicit approval, and
allow-alwaysIf you want host exec to run without approval prompts, you must open both policy layers — requested exec policy in OpenClaw config (
tools.exec.*~/.openclaw/exec-approvals.jsonYOLO is the default host behavior unless you tighten it explicitly:
| Layer | YOLO setting |
|---|---|
text tools.exec.security | text fulltext gatewaytext node |
text tools.exec.ask | text off |
| Host text askFallback | text full |
tools.exec.host=autosecurity=fullask=offautohost=nodeautohost=gatewayautotools.exec.host/exec host=...CLI-backed providers that expose their own noninteractive permission mode can follow this policy. Claude CLI adds
--permission-mode bypassPermissionsagents.defaults.cliBackends.claude-cli.argsresumeArgs--permission-mode defaultacceptEditsbypassPermissionsIf you want a more conservative setup, tighten either layer back to
allowliston-missdenybashopenclaw exec-policy preset yolo
That local shortcut updates both:
tools.exec.host/security/ask~/.openclaw/exec-approvals.jsonIt is intentionally local-only. To change gateway-host or node-host approvals remotely, use
openclaw approvals set --gatewayopenclaw approvals set --node <id|name|ip>For a node host, apply the same approvals file on that node instead:
bashopenclaw approvals set --node <id|name|ip> --stdin <<'EOF' { version: 1, defaults: { security: "full", ask: "off", askFallback: "full" } } EOF
openclaw exec-policyopenclaw exec-policy set --host nodeopenclaw approvals --node .../exec security=full ask=off/elevated fullIf the host approvals file stays stricter than config, the stricter host policy still wins.
Allowlists are per agent. If multiple agents exist, switch which agent you are editing in the macOS app. Patterns are glob matches.
Patterns can be resolved binary path globs or bare command-name globs. Bare names match only commands invoked through
PATHrg/opt/homebrew/bin/rgrg./rg/tmp/rgLegacy
agents.defaultagents.mainecho ok && pwdExamples:
rg~/Projects/**/bin/peekaboo~/.local/bin/*/opt/homebrew/bin/rgEach allowlist entry tracks:
| Field | Meaning |
|---|---|
text id | Stable UUID used for UI identity |
text lastUsedAt | Last-used timestamp |
text lastUsedCommand | Last command that matched |
text lastResolvedPath | Last resolved binary path |
When Auto-allow skill CLIs is enabled, executables referenced by known skills are treated as allowlisted on nodes (macOS node or headless node host). This uses
skills.binsFor safe bins (the stdin-only fast-path), interpreter binding details, and how to forward approval prompts to Slack/Discord/Telegram (or run them as native approval clients), see Exec approvals — advanced.
Use the Control UI → Nodes → Exec approvals card to edit defaults, per-agent overrides, and allowlists. Pick a scope (Defaults or an agent), tweak the policy, add/remove allowlist patterns, then Save. The UI shows last-used metadata per pattern so you can keep the list tidy.
The target selector chooses Gateway (local approvals) or a Node. Nodes must advertise
system.execApprovals.get/set~/.openclaw/exec-approvals.jsonCLI:
openclaw approvalsWhen a prompt is required, the gateway broadcasts
exec.approval.requestedexec.approval.resolveFor
host=nodesystemRunPlansystem.runThat matters for async approval latency:
system.runcommandrawCommandcwdagentIdsessionKeyExec lifecycle is surfaced as system messages:
Exec runningExec finishedExec deniedThese are posted to the agent's session after the node reports the event. Gateway-host exec approvals emit the same lifecycle events when the command finishes (and optionally when running longer than the threshold). Approval-gated execs reuse the approval id as the
runIdWhen an async exec approval is denied, OpenClaw prevents the agent from reusing output from any earlier run of the same command in the session. The denial reason is passed with explicit guidance that no command output is available, which stops the agent from claiming there is new output or repeating the denied command with stale results from a prior successful run.
fullask/exec/exec security=fulldenyexecSafe bins, interpreter binding, and approval forwarding to chat.
Shell command execution tool.
Break-glass path that also skips approvals.
Sandbox modes and workspace access.
Security model and hardening.
When to reach for each control.
Skill-backed auto-allow behavior.
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine