aws / aws/amazon-q-developer-cli

bug: Make Q CLI not run commands under "deniedCommands" for "execute_bash" tool even if user gives consent

Aperta
#3,357 0 commenti 0 reazioni 1 assegnatario Rivendicata da @ekang7 Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

Mac OS

### Expected behaviour

Q CLI should not execute commands that match the "deniedCommands" pattern even if the user gives consent. Since agents are shared across teams using a repository, there can be cases where a developer passes the `--trust-all-tools` command and end up executing the "deniedCommands"

### Actual behaviour

Currently when I add a command such as `aws *` under "deniedCommands" for `execute_bash` tool, Q CLI by default won't execute it. But when user says execute the command `aws `, it asks for user consent whether to execute or not. If the user provides consent, Q CLI executes it.

### Steps to reproduce

- Add the following to the agent config
```
"toolsSettings": {
"execute_bash": {
"deniedCommands": ["aws *"],
"allowReadOnly": true
}
},
```
- Ask Q CLI to execute a command. Let's say `aws s3api list-buckets`. Q asks for consent. When user provides consent by choosing `y` or `t`, Q CLI executes the command.

### Environment

```yaml
Not relevant
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.