Is there a way to whitelist commands in regex like way

So basically I have a lot of commands like this
cd /folder && bundle exec rails test

If i whitelist cd then any cmd that start with cd will run.
If I don’t whitelist cd but white list the bundle exec rails test it will not run

Is there a way to do something like this ?

cd * && bundle exec rails test

Hey, good question.

Unfortunately, Command Allowlist currently doesn’t support regex or wildcard patterns, only exact command matches.

Possible workarounds:

  1. Sandbox Mode: If “Run in Sandbox” is enabled (Cursor Settings → Agents → Auto-Run), commands will run automatically in a sandbox without manual approval. This works for most commands, including your bundle exec rails test.

  2. Create an alias: You can create a shell alias like railstest that runs cd /folder && bundle exec rails test, then add that alias to the allowlist.

If you’d like regex or wildcard support, you can leave a feature request.

+1

i’d like to allow things like supabase * --dry-run and supabase * --local, but for obvious reasons i can’t just whitelist all supabase commands

We definitely need something like regex to avoid babysitting agents through simple commands, and without opening it up widely and taking on risk of dangerous commands.