You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes AgentGuard's OpenClaw integration so OpenClaw tool calls are routed through runtime/cloud protection and plugin configuration is respected correctly.
Changes
Route OpenClaw before_tool_call events through protectAction()
Allow normal non-whitelisted OpenClaw exec commands to reach AgentGuard policy instead of being blocked at the plugin layer
Read OpenClaw's actual plugin registry state for auto-scan:
channel.registry
activeRegistry
legacy registry fallback
Respect api.pluginConfig.level from OpenClaw plugin config
Remove hardcoded level: 'balanced' from the generated OpenClaw plugin template
Harden local audit write failures so runtime decisions are still returned
Add integration and installer tests for OpenClaw runtime protection, auto-scan, and config level handling
severity: high — src/adapters/openclaw-plugin.ts hunk around runtimeProtectionEnabled / catch (err)
The new default behavior is to fail open for security-sensitive tool calls when protectAction throws, because runtimeFailureMode defaults to block but the implementation only blocks when isSecuritySensitiveRuntimeAction(runtimeActionType) returns true. mapOpenClawToolToRuntimeAction() now returns 'other' for any unrecognized tool, and the code then falls back to the local hook policy instead of blocking. A malicious or renamed tool can evade runtime protection just by avoiding the heuristic names. Fix: Treat any tool call with unclassified action as security-sensitive by default, or block on runtime protection failure unless the tool is explicitly known to be safe.
severity: medium — src/adapters/openclaw-plugin.tsmapOpenClawToolToRuntimeAction(...): RuntimeActionType
The new classifier returns 'other' for tools it cannot recognize, but then classifies many actions as 'shell' based on weak heuristics like includes('command'), includes('request'), or inspecting params.command. This can misclassify benign file/network actions as shell and cause unnecessary blocking, and more importantly may still miss dangerous tools whose payload is nested differently. Fix: Require OpenClaw to provide an explicit tool/action mapping, or validate against a trusted allowlist of known tool schemas instead of free-form string heuristics.
severity: medium — src/adapters/openclaw-plugin.ts hunk adding pluginConfig and readOpenClawConfigLevel()
The plugin now reads api.pluginConfig.level and overrides runtime config, but there is no validation that this config originates from a trusted source. If an attacker can influence plugin config, they can downgrade protection to permissive or balanced. Fix: Only accept level overrides from signed/trusted installer-generated config, or ignore external plugin config for security policy selection.
severity: low — src/tests/runtime-cloud.test.ts new test using cloudUrl: 'https://127.0.0.1:9'
The test depends on a non-routable port and on audit write failure semantics, but protectAction now swallows audit write errors. If writeAuditLog behavior changes or filesystem permissions differ, the test may become flaky because it does not assert the audit failure path explicitly. Fix: Mock writeAuditLog/filesystem failure directly in the unit test rather than relying on environment behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes AgentGuard's OpenClaw integration so OpenClaw tool calls are routed through runtime/cloud protection and plugin configuration is respected correctly.
Changes
before_tool_callevents throughprotectAction()channel.registryactiveRegistryregistryfallbackapi.pluginConfig.levelfrom OpenClaw plugin configlevel: 'balanced'from the generated OpenClaw plugin templateAll tests pass: 201 passed.
Type
Testing
npm run buildpassesnpm testpasses (32 tests)Related Issues