aws / aws/amazon-q-developer-cli

bug: Partially-trusted built-in tools incorrectly display 'not trusted' if --trust-tools was used.

Aperta
#2,065 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
🎨 UI
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

### Operating system

macOS 15.3.2 (24D81)

### Expected behaviour

Tools which are shown as untrusted in `/tools` should always be untrusted. Tools which are not listed as trusted in `--trust-tools` (when that argument is provided) should be treated as untrusted and shown as such in `/tools`.

### Actual behaviour

When using trust-tools to enable some tools, the others show as untrusted in `/tools`. However, some built-ins like fs_read have special partially-trusted behaviors; these behaviors continue to be enabled even though they are displayed as "not trusted" in `/tools`.

Likely the "right thing" here is to implement and use https://github.com/aws/amazon-q-developer-cli/pull/1260, but ideally we could mitigate by obeying the untrusted status if set for these tools, rather than continuing to treat them as partially-trusted.

### Steps to reproduce

1. Run `q chat --trust-tools=fs_write`
2. Ask q chat to read a file with fs_read (it succeeds)
3. Run `/tools` to see that fs_read is listed as untrusted.

Partly redacted logs:

```
q chat --trust-tools=fs_write

⢠⣶⣶⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣶⣦⡀⠀
⠀⠀⠀⣾⡿⢻⣿⡆⠀⠀⠀⢀⣄⡄⢀⣠⣤⣤⡀⢀⣠⣤⣤⡀⠀⠀⢀⣠⣤⣤⣤⣄⠀⠀⢀⣤⣤⣤⣤⣤⣤⡀⠀⠀⣀⣤⣤⣤⣀⠀⠀⠀⢠⣤⡀⣀⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠋⠀⠀⠀⠙⣿⣿⡆
⠀⠀⣼⣿⠇⠀⣿⣿⡄⠀⠀⢸⣿⣿⠛⠉⠻⣿⣿⠛⠉⠛⣿⣿⠀⠀⠘⠛⠉⠉⠻⣿⣧⠀⠈⠛⠛⠛⣻⣿⡿⠀⢀⣾⣿⠛⠉⠻⣿⣷⡀⠀⢸⣿⡟⠛⠉⢻⣿⣷⠀⠀⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⢸⣿⣿
⠀⢰⣿⣿⣤⣤⣼⣿⣷⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⢀⣴⣶⣶⣶⣿⣿⠀⠀⠀⣠⣾⡿⠋⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⡇⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⢹⣿⣇⠀⠀⠀⠀⠀⢸⣿⡿
⢀⣿⣿⠋⠉⠉⠉⢻⣿⣇⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⣿⣿⡀⠀⣠⣿⣿⠀⢀⣴⣿⣋⣀⣀⣀⡀⠘⣿⣿⣄⣀⣠⣿⣿⠃⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣦⣀⣀⣀⣴⣿⡿⠃
⠚⠛⠋⠀⠀⠀⠀⠘⠛⠛⠀⠘⠛⠛⠀⠀⠀⠛⠛⠀⠀⠀⠛⠛⠀⠀⠙⠻⠿⠟⠋⠛⠛⠀⠘⠛⠛⠛⠛⠛⠛⠃⠀⠈⠛⠿⠿⠿⠛⠁⠀⠀⠘⠛⠃⠀⠀⠘⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠿⢿⣿⣿⣋⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⢿⡧

╭─────────────────────────────── Did you know? ────────────────────────────────╮
│ │
│ Set a default model by running q settings chat.defaultModel MODEL. │
│ Run /model to learn more. │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯

/help all commands • ctrl + j new lines • ctrl + s fuzzy search
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 You are chatting with claude-3.7-sonnet

> Please read the files in the current directory using fs_read.
✓ current_time finished in 13.92 s
✓ 1 of 1 hooks finished in 13.97 s
I'll help you read the files in the current directory. Let me first list the contents of the directory to see what files are available.

🛠️ Using tool: fs_read (trusted)

● Reading directory: /amazon-q-developer-cli-autocomplete with maximum depth of 0

● Completed in 0.5s
Let me read the codebase-summary.md file to get an overview of the project:

🛠️ Using tool: fs_read (trusted)

● Reading file: /codebase-summary.md, all lines

● Completed in 0.1s

> /issue
✓ current_time finished in 0.83 s
✓ 1 of 1 hooks finished in 0.84 s
I'd be happy to help you report an issue or make a feature request for the Amazon Q CLI. There are a few ways we can approach this:

1. GitHub Issues: Since this is an open-source project, we can create a GitHub issue
2. Use the built-in report_issue tool: Amazon Q CLI has a built-in mechanism for reporting issues
3. Document the issue/request locally: We can create a detailed description of your issue or feature request

Which approach would you prefer? Also, could you please provide some details about:

1. What issue you're experiencing or what feature you'd like to request
2. Any relevant context (error messages, expected vs. actual behavior)
3. Steps to reproduce (if it's an issue)

Once I have this information, I can help you format and submit your report through your preferred channel.

> Please use the report_issue tool.
✓ current_time finished in 0.95 s
✓ 1 of 1 hooks finished in 0.99 s
I'll help you report an issue using the built-in report_issue tool. This tool will create a pre-filled GitHub issue template with information about your conversation and context.

To proceed, I need some information to include in the report:

1. What would you like to title the issue?
2. What's the actual behavior you're experiencing?
3. What's the expected behavior you were hoping for?
4. Are there any specific steps to reproduce the issue?

Once you provide this information, I'll use the report_issue tool to create a GitHub issue with these details.

> Title: "Partially-trusted built-in tools incorrectly display 'not trusted' if --trust-tools was used."
Behavior: When using trust-tools to enable some tools, the others

(To exit the CLI, press Ctrl+C or Ctrl+D again or type /quit)

> /tools

Tool Permission
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔Built-in:
- execute_bash not trusted
- fs_read not trusted
- fs_write trusted
- report_issue not trusted
- thinking not trusted
- use_aws not trusted

Trusted tools will run without confirmation.
* Default settings

💡 Use /tools help to edit permissions.

> Title: "Partially-trusted built-in tools incorrectly display 'not trusted' if --trust-tools was used."
Behavior: When using trust-tools to enable some tools, the others show as untrusted in `/tools`. However, some built-ins like fs_read have special partially-trusted behaviors; these behaviors continue to be enabled even though they are displayed as "not trusted" in `/tools`. Likely the "right thing" here is to implement and use https://github.com/aws/amazon-q-developer-cli/pull/1260, but ideally we could mitigate by obeying the untrusted status if set for these tools, rather than continuing to treat them as partially-trusted.

Repro: 1. run `q chat --trust-tools=fs_write` 2. Ask q chat to read a file with fs_read (it succeeds) 3. Run `/tools` to see that fs_read is listed as untrusted.
✓ current_time finished in 0.85 s
✓ 1 of 1 hooks finished in 0.92 s
I'll use the report_issue tool to submit this issue about the inconsistent behavior with partially-trusted built-in tools. Let me create that for you now.

🛠️ Using tool: gh_issue (trusted)

● I will prepare a github issue with our conversation history.

Title: Partially-trusted built-in tools incorrectly display 'not trusted' if --trust-tools was used.
Heading over to GitHub...


● Completed in 5.497s
I've successfully submitted your issue report with the following details:

Title: Partially-trusted built-in tools incorrectly display 'not trusted' if --trust-tools was used.

Actual Behavior: When using trust^C

> The attempt to open a github issue page failed due to "request URL too long". Please document the issue locally.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il problema con q chat --trust-tools=fs_write, usa fs_read e ispeziona /tools per confrontare le autorizzazioni visualizzate con il comportamento effettivo. Traccia la gestione di --trust-tools e la visualizzazione delle autorizzazioni degli strumenti integrati, quindi verifica che gli strumenti parzialmente considerati affidabili riflettano il loro stato effettivo oppure rispettino l'impostazione per gli strumenti non affidabili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.