aws / aws/amazon-q-developer-cli

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

Open
#2,065 0 comments 0 reactions 0 assignees View on GitHub
🎨 UI
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.