Skip to content

Bash permission deny rules in agent config not being enforced #11218

Closed

Description

@iamhenry

Description

Bash commands that are explicitly denied in the agent's orchestrator.md permission config are executing without being blocked.

Steps to Reproduce

  1. Create an agent config with bash permission deny rules:
permission:
  bash:
    "rm *": deny
    "*": allow
  1. Run the agent and execute a denied command:
rm test-delete-me.md
  1. Expected: Command should be blocked with a permission denied error
  2. Actual: Command executes successfully

Evidence

# Created test file
$ echo "# Test File" > test-delete-me.md

# Attempted to delete (should have been blocked)
$ rm test-delete-me.md
# ✅ Executed without error - file was deleted

Agent Config

File: .opencode/agent/orchestrator.md

permission:
  bash:
    "rmdir *": deny
    "mv *": deny
    "rm *": deny
    "git reset*": deny
    # ... other deny rules
    "*": allow

Environment

  • OpenCode version: v1.1.42
  • OS: macOS
  • Agent mode: primary

Expected Behavior

Commands matching deny patterns should be rejected before execution.

Activity

  1. cravenceiling commented on Jan 30, 2026

    @cravenceiling
    Contributor

    I think it’s because of the order of the permissions. I just tried this:

    permission:
      bash:
        "*": allow
        "rmdir *": deny
        "mv *": deny
        "rm *": deny
        "git reset*": deny
    

    and it worked.

  2. iamhenry commented on Jan 30, 2026

    @iamhenry
    Author

    ill try but that's still a bug, right?

  3. cravenceiling commented on Jan 30, 2026

    @cravenceiling
    Contributor

    I don't think so, it's just the order in which permissions are loaded, in the end when "*": enable is loaded all the previous rules are overwritten. But maybe I'm wrong.

  4. rekram1-node commented on Jan 30, 2026

    @rekram1-node
    Contributor

    not a bug the ordering is intentional and it is documented

  5. iamhenry commented on Jan 30, 2026

    @iamhenry
    Author

    Good to know. Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions