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.
Advanced exec-approval topics: the
safeBinstools.exec.safeBinscutDefault safe bins:
cutuniqheadtailtrwcgrepsortgrep-e--regexpValidation is deterministic from argv shape only (no host filesystem existence checks), which prevents file-existence oracle behavior from allow/deny differences. File-oriented options are denied for default safe bins; long options are validated fail-closed (unknown flags and ambiguous abbreviations are rejected).
Denied flags by safe-bin profile:
grep--dereference-recursive--directories--exclude-from--file--recursive-R-d-f-rjq--argfile--from-file--library-path--rawfile--slurpfile-L-fsort--compress-program--files0-from--output--random-source--temporary-directory-T-owc--files0-fromSafe bins also force argv tokens to be treated as literal text at execution time (no globbing and no
$VARS*$HOME/...Safe bins must resolve from trusted binary directories (system defaults plus optional
tools.exec.safeBinTrustedDirsPATH/bin/usr/bin/opt/homebrew/bin/usr/local/bin/opt/local/bin/snap/bintools.exec.safeBinTrustedDirsShell chaining (
&&||;$()$()On macOS companion-app approvals, raw shell text containing shell control or expansion syntax (
&&||;|`$<>()For shell wrappers (
bash|sh|zsh ... -c/-lcTERMLANGLC_*COLORTERMNO_COLORFORCE_COLORFor
allow-alwaysenvnicenohupstdbuftimeoutbusyboxtoyboxshashIf you allowlist interpreters like
python3nodetools.exec.strictInlineEval=trueallow-always| Topic | text tools.exec.safeBins | Allowlist ( text exec-approvals.json |
|---|---|---|
| Goal | Auto-allow narrow stdin filters | Explicitly trust specific executables |
| Match type | Executable name + safe-bin argv policy | Resolved executable path glob, or bare command-name glob for PATH-invoked commands |
| Argument scope | Restricted by safe-bin profile and literal-token rules | Path match only; arguments are otherwise your responsibility |
| Typical examples | text headtext tailtext trtext wc | text jqtext python3text nodetext ffmpeg |
| Best use | Low-risk text transforms in pipelines | Any tool with broader behavior or side effects |
Configuration location:
safeBinstools.exec.safeBinsagents.list[].tools.exec.safeBinssafeBinTrustedDirstools.exec.safeBinTrustedDirsagents.list[].tools.exec.safeBinTrustedDirssafeBinProfilestools.exec.safeBinProfilesagents.list[].tools.exec.safeBinProfiles~/.openclaw/exec-approvals.jsonagents.<id>.allowlistopenclaw approvals allowlist ...openclaw security audittools.exec.safe_bins_interpreter_unprofiledsafeBinsopenclaw doctor --fixsafeBinProfiles.<bin>{}Custom profile example:
json5{ tools: { exec: { safeBins: ["jq", "myfilter"], safeBinProfiles: { myfilter: { minPositional: 0, maxPositional: 0, allowedValueFlags: ["-n", "--limit"], deniedFlags: ["-f", "--file", "-c", "--command"], }, }, }, }, }
If you explicitly opt
jqsafeBinsenvjq -n envApproval-backed interpreter/runtime runs are intentionally conservative:
pnpm execpnpm nodenpm execnpxWhen approvals are required, the exec tool returns immediately with an approval id. Use that id to correlate later system events (
Exec finishedExec deniedAfter an approved async exec finishes, OpenClaw sends a followup
agenttodeliver: falseINVALID_REQUESTbestEffortDeliverYou can forward exec approval prompts to any chat channel (including plugin channels) and approve them with
/approveConfig:
json5{ approvals: { exec: { enabled: true, mode: "session", // "session" | "targets" | "both" agentFilter: ["main"], sessionFilter: ["discord"], // substring or regex targets: [ { channel: "slack", to: "U12345678" }, { channel: "telegram", to: "123456789" }, ], }, }, }
Reply in chat:
text/approve <id> allow-once /approve <id> allow-always /approve <id> deny
The
/approvePlugin approval forwarding uses the same delivery pipeline as exec approvals but has its own independent config under
approvals.pluginjson5{ approvals: { plugin: { enabled: true, mode: "targets", agentFilter: ["main"], targets: [ { channel: "slack", to: "U12345678" }, { channel: "telegram", to: "123456789" }, ], }, }, }
The config shape is identical to
approvals.execenabledmodeagentFiltersessionFiltertargetsChannels that support shared interactive replies render the same approval buttons for both exec and plugin approvals. Channels without shared interactive UI fall back to plain text with
/approveWhen an exec or plugin approval request originates from a deliverable chat surface, the same chat can now approve it with
/approveThis shared text-command path uses the normal channel auth model for that conversation. If the originating chat can already send commands and receive replies, approval requests no longer need a separate native delivery adapter just to stay pending.
Discord and Telegram also support same-chat
/approveFor Telegram and other native approval clients that call the Gateway directly, this fallback is intentionally bounded to "approval not found" failures. A real exec approval denial/error does not silently retry as a plugin approval.
Some channels can also act as native approval clients. Native clients add approver DMs, origin-chat fanout, and channel-specific interactive approval UX on top of the shared same-chat
/approveWhen native approval cards/buttons are available, that native UI is the primary agent-facing path. The agent should not also echo a duplicate plain chat
/approveIf a native approval client is configured but no native runtime is active for the originating channel, OpenClaw keeps the local deterministic
/approve/approve <id> <decision>Generic model:
approvals.execchannels.<channel>.execApprovalsNative approval clients auto-enable DM-first delivery when all of these are true:
execApprovals.approverscommands.ownerAllowFromchannels.<channel>.execApprovals.enabled"auto"Set
enabled: falseenabled: truechannels.<channel>.execApprovals.targetFAQ: Why are there two exec approval configs for chat approvals?
channels.discord.execApprovals.*channels.slack.execApprovals.*channels.telegram.execApprovals.*These native approval clients add DM routing and optional channel fanout on top of the shared same-chat
/approveShared behavior:
/approveexecApprovals.approverscommands.ownerAllowFromexecApprovals.approverscommands.ownerAllowFromexecApprovals.approverscommands.ownerAllowFromplugin:channels.matrix.dm.allowFromcom.openclaw.approval/approve/approveplugin:/approvetargetaskFallbackSensitive owner-only group commands such as
/diagnostics/export-trajectorycommands.ownerAllowFromTelegram defaults to approver DMs (
target: "dm"channelbothSee:
textGateway -> Node Service (WS) | IPC (UDS + token + HMAC + TTL) v Mac App (UI + approvals + system.run)
Security notes:
0600exec-approvals.json© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine