openclaw - ✅(Solved) Fix [Bug]: Exact command hashing in `exec` approvals renders `allow-always` ineffective for dynamic commands [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61667Fetched 2026-04-08 02:56:11
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Here is the standardized English GitHub Issue, formatted and ready to be copied and pasted directly into the repository's issue tracker:


Title: [Bug]: Exact command hashing in exec approvals renders allow-always ineffective for dynamic commands

Environment:

  • OpenClaw Version: 2026.4.1 (Commit: da64a97)

Description: Whenever the agent executes a command, the system generates a command hash (=command:xxxxxxxx) based on the exact, full string of the command. Consequently, if the operation is identical (e.g., running the same Python script) but contains minor variations in the arguments, a new hash is generated and a new exec approval prompt is triggered. When a user clicks "Always allow," it only permanently authorizes that specific hash. It fails to cover similar commands, trapping the user in an infinite loop of approval prompts.

Root Cause

Here is the standardized English GitHub Issue, formatted and ready to be copied and pasted directly into the repository's issue tracker:


Title: [Bug]: Exact command hashing in exec approvals renders allow-always ineffective for dynamic commands

Environment:

  • OpenClaw Version: 2026.4.1 (Commit: da64a97)

Description: Whenever the agent executes a command, the system generates a command hash (=command:xxxxxxxx) based on the exact, full string of the command. Consequently, if the operation is identical (e.g., running the same Python script) but contains minor variations in the arguments, a new hash is generated and a new exec approval prompt is triggered. When a user clicks "Always allow," it only permanently authorizes that specific hash. It fails to cover similar commands, trapping the user in an infinite loop of approval prompts.

Fix Action

Fix / Workaround

Actual Impact: This rigid hashing mechanism has forced me to click "Always allow" hundreds of times over the past three days with no improvement in workflow. The only temporary workaround is forcing the agent to use static, hardcoded script files to keep the command hash static, which severely cripples the agent's dynamic flexibility.

PR fix notes

PR #61687: docs: add exec approval limitation and improvement proposal

Description (problem / solution / changelog)

This PR documents a limitation in the exec approval system where approvals are tied to full command hashes, making "Allow always" ineffective for parameterized commands.

It also proposes improvements such as:

  • executable-level trust
  • script-level trust
  • pattern-based matching
  • persistent approvals

Related issue: #61667

Changed files

  • docs/.i18n/glossary.zh-CN.json (modified, +11/-7)
  • docs/docs.json (modified, +3/-0)
  • docs/tools/exec-approval-limitations.md (added, +22/-0)
  • dream-diary-preview-v2.html (modified, +929/-395)
  • dream-diary-preview-v3.html (modified, +977/-319)
  • extensions/discord/src/doctor-contract.ts (modified, +3/-1)
  • extensions/matrix/src/matrix/client.test.ts (modified, +1/-3)
  • extensions/matrix/src/matrix/client/config.ts (modified, +1/-1)
  • extensions/matrix/src/matrix/monitor/handler.ts (modified, +1/-1)
  • extensions/qa-lab/web/src/styles.css (modified, +1/-2)
  • extensions/slack/src/doctor-contract.ts (modified, +1/-4)
  • src/channels/plugins/acp-bindings.test.ts (modified, +2/-0)
  • src/commands/doctor/shared/legacy-config-migrate.test.ts (modified, +1/-4)
  • src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts (modified, +3/-1)
  • src/cron/isolated-agent.model-formatting.test.ts (modified, +1/-0)
  • src/hooks/gmail-watcher-lifecycle.test.ts (modified, +27/-65)
  • src/hooks/gmail-watcher-lifecycle.ts (modified, +12/-7)

Code Example

python email_sender.py --content-file Day_007.md
python email_sender.py --content-file Day_008.md

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Here is the standardized English GitHub Issue, formatted and ready to be copied and pasted directly into the repository's issue tracker:


Title: [Bug]: Exact command hashing in exec approvals renders allow-always ineffective for dynamic commands

Environment:

  • OpenClaw Version: 2026.4.1 (Commit: da64a97)

Description: Whenever the agent executes a command, the system generates a command hash (=command:xxxxxxxx) based on the exact, full string of the command. Consequently, if the operation is identical (e.g., running the same Python script) but contains minor variations in the arguments, a new hash is generated and a new exec approval prompt is triggered. When a user clicks "Always allow," it only permanently authorizes that specific hash. It fails to cover similar commands, trapping the user in an infinite loop of approval prompts.

Steps to reproduce

Steps to Reproduce:

  1. Set tools.exec.ask = "on-miss" in the configuration.
  2. Prompt the agent to execute any parameterized Python command, and click "Always allow" on the UI prompt.
  3. Prompt the agent to execute the same Python command but with a slightly different parameter.
  4. Observe that a new approval prompt appears despite the previous "Always allow" action.

Expected behavior

Expected Behavior: The allow-always feature should support authorization based on the executable path or command pattern, rather than being strictly limited to full-string command hashes. For example:

  • Allow blanket authorization for a specific executable (e.g., python.exe).
  • Allow authorization for all scripts within a specific directory (e.g., workspace/**).
  • Provide a "Trust this executable for all calls" option in the UI.

Actual behavior

Actual Impact: This rigid hashing mechanism has forced me to click "Always allow" hundreds of times over the past three days with no improvement in workflow. The only temporary workaround is forcing the agent to use static, hardcoded script files to keep the command hash static, which severely cripples the agent's dynamic flexibility.

Technical Details & Evidence: Failed Command Example:

python email_sender.py --content-file Day_007.md
python email_sender.py --content-file Day_008.md

Both commands invoke the exact same script but have different arguments, generating entirely different hashes. This makes allow-always functionally useless for dynamic tasks.

Secondary Persistence Bug: The exec-approvals.json file is wiped clean/reset to empty every time the gateway restarts. Any manually written whitelist entries are lost, further exacerbating the primary issue.

Proposed Solutions:

  1. Upgrade the allowlist to support executable-level matching (ignoring arguments).
  2. Upgrade the allowlist to support wildcard pattern matching for full commands.
  3. Fix the persistence bug so exec-approvals.json is not overwritten or cleared upon startup.

*** This format aligns perfectly with standard open-source contribution guidelines and clearly separates the UX flow issues from the backend persistence bug.

OpenClaw version

v2026.4.1

Operating system

windows11

Install method

No response

Model

qwen3.5-plus

Provider / routing chain

Feishu (飞书) → OpenClaw Gateway (localhost:18789) → Alibaba Cloud Bailian → qwen3.5-plus

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Implementing executable-level matching or wildcard pattern matching for the allowlist can resolve the issue of allow-always being ineffective for dynamic commands.

Guidance

  • Review the exec approval mechanism to understand how command hashes are generated and how they impact the allow-always feature.
  • Consider upgrading the allowlist to support either executable-level matching (ignoring arguments) or wildcard pattern matching for full commands to improve flexibility.
  • Address the persistence bug that wipes the exec-approvals.json file upon gateway restart to prevent loss of manually added whitelist entries.
  • Evaluate the feasibility of adding a "Trust this executable for all calls" option in the UI to enhance user experience.

Example

No specific code example is provided due to the lack of direct code references in the issue, but implementing a pattern matching system for the allowlist could involve using regular expressions or similar string matching techniques.

Notes

The proposed solutions aim to enhance the flexibility and usability of the allow-always feature, especially for dynamic commands. However, the exact implementation details may vary based on the underlying architecture and requirements of the OpenClaw system.

Recommendation

Apply a workaround by implementing executable-level matching or wildcard pattern matching for the allowlist, as this directly addresses the identified issue with the allow-always feature for dynamic commands.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Expected Behavior: The allow-always feature should support authorization based on the executable path or command pattern, rather than being strictly limited to full-string command hashes. For example:

  • Allow blanket authorization for a specific executable (e.g., python.exe).
  • Allow authorization for all scripts within a specific directory (e.g., workspace/**).
  • Provide a "Trust this executable for all calls" option in the UI.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Exact command hashing in `exec` approvals renders `allow-always` ineffective for dynamic commands [1 pull requests, 1 participants]