Skip to content

Commit bf40269

Browse files
authored
feat(security): require acknowledgement for policy warnings (#116489)
1 parent 727a4a6 commit bf40269

64 files changed

Lines changed: 2193 additions & 283 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/cli/plugins.md‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ openclaw plugins install <plugin> --marketplace <name> # marketplace (expli
136136
openclaw plugins install <package> --force # confirm source / overwrite existing
137137
openclaw plugins install <package> --pin # pin resolved npm version
138138
openclaw plugins install clawhub:<package> --acknowledge-clawhub-risk
139-
openclaw plugins install <package> --dangerously-force-unsafe-install
139+
openclaw plugins install <package> --acknowledge-install-policy-warning
140140
```
141141

142142
Maintainers testing setup-time installs can override automatic plugin install
@@ -197,12 +197,10 @@ non-npm sources are not rewritten.
197197
<Accordion title="--pin scope">
198198
`--pin` applies to npm installs only and records the resolved exact `<name>@<version>`. It is not supported with `git:` installs (pin the ref in the spec instead, e.g. `git:github.com/acme/[email protected]`) or with `--marketplace` (marketplace installs persist marketplace source metadata instead of an npm spec).
199199
</Accordion>
200-
<Accordion title="--dangerously-force-unsafe-install">
201-
`--dangerously-force-unsafe-install` is deprecated and is now a no-op. OpenClaw no longer runs built-in install-time dangerous-code blocking for plugin installs.
200+
<Accordion title="--acknowledge-install-policy-warning">
201+
When `security.installPolicy` returns `warn` in an interactive terminal, OpenClaw prints the reason and findings, then uses the same acknowledgement copy as a suspicious ClawHub release: `type: '<plugin>' to install anyway`. If the fully rendered review exceeds 4,000 characters, OpenClaw fails closed before prompting; reduce or coalesce the policy output first. A matching answer re-evaluates the staged source before continuing. A declined or non-interactive direct CLI install stops before commit; after review, `--acknowledge-install-policy-warning` explicitly approves every warning for that command invocation. Automatic and managed install surfaces cannot use that flag themselves; rerun the equivalent direct CLI command when one exists, or change `security.installPolicy` to return `allow` for the reviewed request before retrying the managed flow. Every approved warning is re-evaluated before continuing. Neither acknowledgement nor `--force` overrides `block` or a policy failure.
202202

203-
Use the operator-owned `security.installPolicy` surface when host-specific install policy is required. Plugin `before_install` hooks are plugin-runtime lifecycle hooks, not the primary policy boundary for CLI installs.
204-
205-
If a plugin you published on ClawHub is hidden or blocked by a registry scan, use the publisher steps in [ClawHub publishing](/clawhub/publishing). `--dangerously-force-unsafe-install` does not ask ClawHub to rescan the plugin or make a blocked release public.
203+
If a plugin you published on ClawHub is hidden or blocked by a registry scan, use the publisher steps in [ClawHub publishing](/clawhub/publishing). This flag does not ask ClawHub to rescan the plugin or make a blocked release public. The deprecated `--dangerously-force-unsafe-install` flag remains a no-op.
206204

207205
</Accordion>
208206
<Accordion title="--acknowledge-clawhub-risk">
@@ -440,7 +438,7 @@ openclaw plugins update <id-or-npm-spec> --dry-run
440438
openclaw plugins update @openclaw/voice-call
441439
openclaw plugins update @acme/demo
442440
openclaw plugins update openclaw-codex-app-server --acknowledge-clawhub-risk
443-
openclaw plugins update openclaw-codex-app-server --dangerously-force-unsafe-install
441+
openclaw plugins update openclaw-codex-app-server --acknowledge-install-policy-warning
444442
```
445443

446444
Updates apply to tracked plugin installs in the managed plugin index and tracked hook-pack installs in shared SQLite state. They reuse the source that the user already chose when installing the plugin, so they do not require a second source acknowledgement.
@@ -472,8 +470,8 @@ Updates apply to tracked plugin installs in the managed plugin index and tracked
472470
When a stored integrity hash exists and the fetched artifact hash changes, OpenClaw treats that as npm artifact drift. The interactive `openclaw plugins update` command prints the expected and actual hashes and asks for confirmation before proceeding. Non-interactive update helpers fail closed unless the caller supplies an explicit continuation policy.
473471

474472
</Accordion>
475-
<Accordion title="--dangerously-force-unsafe-install on update">
476-
`--dangerously-force-unsafe-install` is also accepted on `plugins update` for compatibility, but it is deprecated and no longer changes plugin update behavior. Operator `security.installPolicy` can still block updates; plugin `before_install` hooks only apply in processes where plugin hooks are loaded.
473+
<Accordion title="--acknowledge-install-policy-warning on update">
474+
`plugins update` uses the same warning acknowledgement as install, with `type: '<plugin>' to update anyway` in an interactive terminal. The policy is re-evaluated, and `block` or a policy failure remains terminal.
477475
</Accordion>
478476
<Accordion title="--acknowledge-clawhub-risk on update">
479477
Community ClawHub-backed plugin updates run the same exact-release trust check as installs before downloading the replacement package. Use `--acknowledge-clawhub-risk` for reviewed automation that should continue when the selected ClawHub release has a risky trust warning. Official ClawHub packages and bundled OpenClaw plugin sources bypass this release-trust prompt.

‎docs/cli/skills.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ openclaw skills install ./path/to/skill --as custom-name
3535
openclaw skills install @owner/<slug> --force
3636
openclaw skills install @owner/<slug> --force-install
3737
openclaw skills install @owner/<slug> --acknowledge-clawhub-risk
38+
openclaw skills install @owner/<slug> --acknowledge-install-policy-warning
3839
openclaw skills install @owner/<slug> --agent <id>
3940
openclaw skills install @owner/<slug> --global
4041
openclaw skills update @owner/<slug>
4142
openclaw skills update @owner/<slug> --force-install
4243
openclaw skills update @owner/<slug> --acknowledge-clawhub-risk
44+
openclaw skills update @owner/<slug> --acknowledge-install-policy-warning
4345
openclaw skills update @owner/<slug> --global
4446
openclaw skills update --all
4547
openclaw skills update --all --agent <id>
@@ -98,6 +100,20 @@ installs only.
98100
Gateway-backed skill dependency installs triggered from onboarding or Skills
99101
settings use the separate `skills.install` request path instead.
100102

103+
When `security.installPolicy` returns `warn` in an interactive terminal,
104+
OpenClaw prints the reason and findings, then asks `type: '<skill>' to install
105+
anyway` (or `update anyway`). If the fully rendered review exceeds 4,000
106+
characters, OpenClaw fails closed before prompting; reduce or coalesce the
107+
policy output first. A matching answer evaluates the staged skill
108+
again before continuing. Declined and non-interactive direct CLI commands stop
109+
before commit; after review, `--acknowledge-install-policy-warning` is the
110+
explicit noninteractive approval for every warning in that command invocation.
111+
Every approved warning is re-evaluated before continuing. Automatic and managed
112+
skill installs cannot use that flag themselves. Use an equivalent direct CLI
113+
command when one exists; otherwise, change `security.installPolicy` to return
114+
`allow` for the reviewed request, then retry the managed flow. Neither `--force`
115+
nor the acknowledgement overrides `block` or a policy failure.
116+
101117
Notes:
102118

103119
| Flag/behavior | Description |

‎docs/concepts/agent-loop.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ These run inside the agent loop or gateway pipeline:
7575
Hook decision rules for outbound/tool guards:
7676

7777
- `before_tool_call`: `{ block: true }` is terminal and stops lower-priority handlers. `{ block: false }` is a no-op and does not clear a prior block.
78-
- `before_install`: same terminal/no-op semantics as above. Use `security.installPolicy`, not `before_install`, for operator-owned install allow/block decisions that must cover CLI install and update paths.
78+
- `before_install`: same terminal/no-op semantics as above. Use `security.installPolicy`, not `before_install`, for operator-owned install allow/warn/block decisions that must cover CLI install and update paths.
7979
- `message_sending`: `{ cancel: true }` is terminal and stops lower-priority handlers. `{ cancel: false }` is a no-op and does not clear a prior cancel.
8080

8181
See [Plugin hooks](/plugins/hooks) for the hook API and registration details.

‎docs/gateway/security/index.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ Plugins run in-process with the Gateway - treat them as trusted code.
336336
- Installing/updating plugins runs executable code:
337337
- The install path is the per-plugin directory under the active plugin install root.
338338
- ClawHub packages and OpenClaw's bundled/official catalog are trusted sources. A new arbitrary npm, `npm-pack:`, git, local path/archive, or marketplace source warns before install; noninteractive installs require `--force` after you review and trust that source. `--force` confirms provenance and permits overwrite; it does not bypass `security.installPolicy` or remaining install safety checks. Updates reuse the already selected source.
339-
- OpenClaw does not run built-in local dangerous-code blocking during install/update. Use `security.installPolicy` for operator-owned local allow/block decisions and `openclaw security audit --deep` for diagnostic scanning.
339+
- OpenClaw does not run built-in local dangerous-code blocking during install/update. Use `security.installPolicy` for operator-owned local allow/warn/block decisions and `openclaw security audit --deep` for diagnostic scanning.
340340
- npm and git plugin installs run package-manager dependency convergence only during the explicit install/update flow. Local paths and archives are treated as self-contained packages; OpenClaw copies/references them without running `npm install`.
341341
- Prefer pinned exact versions (`@scope/[email protected]`) and inspect the unpacked code before enabling.
342-
- `--dangerously-force-unsafe-install` is deprecated and no longer changes install/update behavior.
343-
- `security.installPolicy` lets operators run a trusted local command to make host-specific allow/block decisions for skill and plugin installs. It runs after source material is staged but before install continues, applies to ClawHub skills too, and is not bypassed by deprecated unsafe flags.
342+
- `security.installPolicy` lets operators run a trusted local command to return `allow`, `warn`, or `block` for skill and plugin installs. It runs after source material is staged but before install continues and applies to ClawHub skills too.
343+
- A `warn` result stops before commit. Interactive CLI commands ask the operator to type the plugin or skill name using the same wording as suspicious ClawHub releases, then re-evaluate policy before continuing. An over-4,000-character rendered review fails closed before prompting. Declined and non-interactive direct CLI commands can use `--acknowledge-install-policy-warning` as explicit approval after review for every warning in that command invocation. Gateway-backed and automatic installs cannot approve warnings themselves. Use an equivalent direct CLI command when one exists; otherwise, change `security.installPolicy` to return `allow` for the reviewed request before retrying the managed flow. Every approved warning is re-evaluated before continuing. `block` and policy failures remain terminal. Neither `--force` nor the deprecated plugin install/update flag `--dangerously-force-unsafe-install` approves policy warnings.
344344

345345
Details: [Plugins](/tools/plugin)
346346

‎docs/help/faq.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ Model Q&A - defaults, selection, aliases, switching, failover, auth profiles - l
14451445
</Accordion>
14461446

14471447
<Accordion title="Are ClawHub skills and third-party plugins safe to install?">
1448-
Treat third-party skills and plugins as code you are choosing to trust. ClawHub skill pages expose scan state before install, but scans are not a complete security boundary. OpenClaw does not run built-in local dangerous-code blocking during plugin/skill install or update; use operator-owned `security.installPolicy` for local allow/block decisions.
1448+
Treat third-party skills and plugins as code you are choosing to trust. ClawHub skill pages expose scan state before install, but scans are not a complete security boundary. OpenClaw does not run built-in local dangerous-code blocking during plugin/skill install or update; use operator-owned `security.installPolicy` for local allow/warn/block decisions.
14491449

14501450
Safer pattern: prefer trusted authors and pinned versions, read the skill/plugin before enabling it, keep plugin/skill allowlists narrow, run untrusted-input workflows in a sandbox with minimal tools, and avoid giving third-party code broad filesystem, exec, browser, or secret access.
14511451

‎docs/platforms/mac/skills.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The macOS app surfaces OpenClaw skills via the gateway; it does not parse skills
1717

1818
- `metadata.openclaw.install` defines install options (brew/node/go/uv/download).
1919
- The app calls `skills.install` to run installers on the gateway host.
20-
- Operator-owned `security.installPolicy` (`enabled`, `targets`, `exec`) can block gateway-backed skill installs before installer metadata runs. Built-in dangerous-code scanning (used for plugin installs) is not wired into the skill install flow.
20+
- Operator-owned `security.installPolicy` (`enabled`, `targets`, `exec`) runs before installer metadata. `block` results and policy failures stop the install. A `warn` result also stops the gateway-backed request: review it with the matching direct CLI when one exists, or change the policy to allow the reviewed request, then retry.
2121
- If every install option is `download`, the gateway surfaces all download choices.
2222
- Otherwise the gateway picks one preferred installer using current install preferences (`skills.install.preferBrew`, `skills.install.nodeManager`) and host binaries: Homebrew first when `preferBrew` is enabled and `brew` is present, then `uv`, then the configured node manager, then Homebrew again if available (even without `preferBrew`), then `go`, then `download`.
2323
- Node install labels reflect the configured node manager, including `yarn`.

‎docs/plugins/hooks.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ Decision rules:
828828

829829
## Install hooks
830830

831-
Use `security.installPolicy` for operator-owned allow/block decisions. That
831+
Use `security.installPolicy` for operator-owned allow/warn/block decisions. That
832832
policy runs from OpenClaw config, covers CLI install and update paths, and
833833
fails closed when enabled but unavailable.
834834

‎docs/plugins/sdk-overview.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ semantics.
699699
### Hook decision semantics
700700

701701
`before_install` is a plugin-runtime lifecycle hook, not the operator install
702-
policy surface. Use `security.installPolicy` when an allow/block decision must
702+
policy surface. Use `security.installPolicy` when an allow/warn/block decision must
703703
cover CLI and Gateway-backed install or update paths.
704704

705705
- `before_tool_call`: returning `{ block: true }` is terminal. Once any handler sets it, lower-priority handlers are skipped.

‎docs/tools/plugin.md‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,24 @@ and fail when incompatible.
146146

147147
Configure `security.installPolicy` to run a trusted local policy command
148148
before a plugin install or update proceeds. The policy receives metadata plus
149-
the staged source path and can allow or block the install. It covers both CLI
150-
and Gateway-backed install/update paths. Plugin `before_install` hooks run
151-
later, and only in OpenClaw processes where plugin hooks are loaded, so use
152-
`security.installPolicy` for operator-owned install decisions instead. The
153-
deprecated `--dangerously-force-unsafe-install` flag is accepted for
154-
compatibility but is a no-op: it does not bypass install policy or
155-
`before_install` hook blocks.
149+
the staged source path and can allow, warn, or block the install. It covers both CLI
150+
and Gateway-backed install/update paths. CLI plugin and skill commands can
151+
acknowledge a warning interactively by typing the target name with the same
152+
copy as suspicious ClawHub releases; policy is then re-evaluated. Reviewed
153+
non-interactive direct CLI commands can use `--acknowledge-install-policy-warning`.
154+
That flag approves every warning for the command invocation; each warning is
155+
still re-evaluated before the install continues.
156+
Gateway-backed and automatic installs remain blocked on warnings because they
157+
have no operator-confirmation flow. When an equivalent direct plugin or skill
158+
command exists, use that command to review and approve the warning. Otherwise,
159+
change `security.installPolicy` to return `allow` for the reviewed request, then
160+
retry the managed flow. Neither `--force` nor the deprecated plugin
161+
install/update flag `--dangerously-force-unsafe-install` approves a policy
162+
warning. Plugin
163+
`before_install` hooks run later, and only in OpenClaw processes where plugin
164+
hooks are loaded, so use `security.installPolicy` for operator-owned install
165+
decisions instead. The flag does not override a block or policy failure.
166+
It also does not bypass `before_install` hook blocks.
156167

157168
See [Skills config](/tools/skills-config#operator-install-policy-security-installpolicy)
158169
for the shared `security.installPolicy` exec schema used by both skills and

‎docs/tools/skills-config.md‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,38 @@ directories. Symlinks and insecure paths are rejected.
175175
The policy receives one JSON object on stdin with `protocolVersion: 1`,
176176
`openclawVersion`, `targetType`, `targetName`, `sourcePath`, `sourcePathKind`,
177177
optional structured `source`, structured `origin`, and `request`. It must
178-
write one JSON object on stdout: `{ "protocolVersion": 1, "decision": "allow" }`
179-
or `{ "protocolVersion": 1, "decision": "block", "reason": "..." }`. Non-zero
180-
exit, timeout, malformed JSON, missing fields, or unsupported protocol
181-
versions fail closed.
178+
write one JSON object on stdout with an `allow`, `warn`, or `block` decision.
179+
`warn` and `block` require a non-empty `reason`; every decision may include a
180+
`findings` array. Each finding requires non-empty string `ruleId` and `message`
181+
fields plus a `severity` of `info`, `warn`, or `critical`. Optional `file` and
182+
`evidence` values must be non-empty strings; a finite numeric `line` is rounded
183+
down and clamped to the safe-integer range from 1 through `Number.MAX_SAFE_INTEGER`.
184+
Malformed finding entries are ignored, and
185+
invalid optional fields are omitted. A non-array `findings` value is treated as
186+
absent. Operator-facing reason and finding text are limited to 1,000 characters.
187+
OpenClaw retains at most 100 normalized findings for display. Only a `warn`
188+
response with more than 100 valid findings fails closed and cannot be
189+
acknowledged; `allow` and `block` retain the first 100. A warning stops the
190+
install before commit. A `warn` review whose fully rendered notice, including
191+
its title, target, sanitized reason and findings, and recovery guidance, exceeds
192+
the 4,000-character aggregate display limit fails closed without presenting a
193+
partial review. An over-budget `block` remains terminal with a
194+
bounded denial, while over-budget findings on `allow` are summarized in bounded
195+
diagnostic output. Interactive CLI
196+
plugin and skill commands ask the operator to type the target name using the
197+
same `install anyway` or `update anyway` copy as suspicious ClawHub releases,
198+
then run policy again before continuing. Declined and non-interactive commands
199+
on the direct CLI may use `--acknowledge-install-policy-warning` as explicit
200+
approval after review for every warning in that command invocation;
201+
every approved warning is re-evaluated before continuing.
202+
Gateway-backed and automatic installs remain blocked on warnings because they
203+
have no operator-confirmation flow. Use an equivalent direct plugin or skill
204+
command to review and approve the warning when one exists. Otherwise, change
205+
`security.installPolicy` to return `allow` for the reviewed request, then retry
206+
the managed flow. `--force` does not approve policy warnings. A `block`,
207+
non-zero exit, timeout, invalid JSON, non-object response, missing or invalid
208+
protocol version or decision, or missing or empty `warn`/`block` reason always
209+
fails closed.
182210

183211
OpenClaw does not execute install policy during normal Gateway startup.
184212
Installs and updates fail closed when policy is enabled but unavailable.

0 commit comments

Comments
 (0)