openclaw - 💡(How to fix) Fix feat(exec): add description field for intent-based hook approval [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#61430Fetched 2026-04-08 02:58:44
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Code Example

{
  "command": "rm -rf /tmp/cache",
  "description": "Delete temporary cache directory"
}

---

{
  "command": "rm -rf /tmp/cache"
  // hook must guess intent from "rm -rf /tmp" pattern
}
RAW_BUFFERClick to expand / collapse

Problem

Currently the exec tool only carries a command string. Hook systems like permission-enforcers must use pattern matching on the command text to decide whether to allow or block an operation. This is fragile and doesn't capture the user's intent.

Proposed Solution

Add a description (or intent) field to the exec tool that carries a short natural-language description of what the command is intended to do. Hook systems can then make intelligent decisions based on intent rather than parsing command strings.

Example

{
  "command": "rm -rf /tmp/cache",
  "description": "Delete temporary cache directory"
}

vs. current pattern-matching approach:

{
  "command": "rm -rf /tmp/cache"
  // hook must guess intent from "rm -rf /tmp" pattern
}

Use Cases

  1. Permission Enforcer: Block "delete system files" but allow "delete temp cache" based on intent
  2. Plan Mode hooks: Ask user "You're about to delete X — confirm?" with human-readable description
  3. Audit logs: Make logs readable instead of opaque command strings
  4. Safety guardrails: Distinguish between "I want to install a package" vs "I want to reformat your disk"

References

  • Claw-Code (OpenClaw fork) has implemented this in their exec tool
  • Related skills: hook-system and permission-enforcer in OpenClaw workspace skills

Constraints

  • description should be optional to maintain backward compatibility
  • Description is informational — not used as the actual command to execute
  • Model should populate this automatically when calling exec

extent analysis

TL;DR

Add a description field to the exec tool to provide a short natural-language description of the command's intent, enabling hook systems to make informed decisions.

Guidance

  • Update the exec tool to include an optional description field in the command object, as shown in the proposed solution example.
  • Modify hook systems, such as permission enforcers, to utilize the description field for decision-making instead of relying on pattern matching.
  • Ensure the description field is populated automatically when calling the exec tool to maintain a seamless user experience.
  • Review and update relevant use cases, such as permission enforcers, plan mode hooks, audit logs, and safety guardrails, to leverage the new description field.

Example

{
  "command": "rm -rf /tmp/cache",
  "description": "Delete temporary cache directory"
}

Notes

The implementation of the description field should prioritize backward compatibility, making it optional to avoid disrupting existing workflows.

Recommendation

Apply the workaround by adding the description field to the exec tool, as it provides a more robust and intent-based approach to decision-making in hook systems.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING