Skip to content

Feature: Add denylist support for exec-approvals #6615

@aaroneden

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: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:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions