Skip to content

Feature: Add denylist support for exec-approvals #6615

Description

@aaroneden

Summary

Add denylist support to exec-approvals, complementing the existing allowlist. This enables "allow everything except X" policies.

Use Case

I want to:

  • Allow all commands to run without prompts
  • Except block/prompt for specific dangerous commands like:
    • gog gmail send (sending emails)
    • gog gmail delete (deleting emails)
    • beeper-send.sh (sending messages)

Currently, exec-approvals only supports:

  • security: "deny" - block all
  • security: "allowlist" - allow only listed commands
  • security: "full" - allow everything

There's no way to say "allow everything except these specific patterns."

Proposed Solution

Add a denylist array to exec-approvals config:

{
  "defaults": {
    "security": "denylist",
    "ask": "on-match",
    "denylist": [
      {
        "id": "DENY-EMAIL-SEND",
        "pattern": "/opt/homebrew/bin/gog",
        "argsMatch": "gmail send",
        "reason": "Sending emails requires approval"
      },
      {
        "id": "DENY-EMAIL-DELETE",
        "pattern": "/opt/homebrew/bin/gog", 
        "argsMatch": "gmail delete",
        "reason": "Use 'gmail archive' instead"
      },
      {
        "id": "DENY-BEEPER-SEND",
        "pattern": "*/beeper-send.sh",
        "reason": "Sending messages requires approval"
      }
    ]
  }
}

Key additions:

  • security: "denylist" mode - allow everything except matches
  • argsMatch field - match against command arguments, not just binary path
  • ask: "on-match" - prompt when denylist matches (vs blocking outright)

Current Workarounds

  1. Use security: "full" and hope agent guardrails work (unreliable)
  2. Use security: "allowlist" with a massive list of safe commands (tedious)
  3. Create wrapper scripts (fragile)

Environment

  • OpenClaw 2026.1.30
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions