aws / aws/amazon-q-developer-cli
allowedTools configuration in CLI agent JSON not being trusted despite proper definition
- 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
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
Linux 5.15.0-151-generic - Ubuntu 22.04.5 LTS
### Expected behaviour
When I define "allowedTools" in my CLI agent configuration file at `/home/me/git/my-project/.amazonq/cli-agents/my-custom-agent.json`, those tools should be automatically trusted and available for use without additional permission prompts. The `/tools` command should show these tools as trusted. This used to work before.
### Actual behaviour
Despite having "allowedTools" properly defined in my CLI agent JSON configuration file, when I run `/tools` command, the tools are not showing as trusted. The allowedTools configuration appears to be ignored, requiring manual trust approval for each tool.
Your configuration is correct:
1. You have properly defined "allowedTools" array with specific tool names
2. The tool names in your allowedTools match actual available tools (fs_read, ref_read_url, etc.)
3. The JSON syntax is valid
4. You also have "tools": ["*"] which should allow all tools, but the allowedTools should provide automatic trust
Expected behavior vs. Reality:
• The allowedTools configuration is specifically designed to pre-approve tools so they don't require manual trust
• If this feature is working correctly, those tools should show as trusted when you run /tools
• The fact that they're not being automatically trusted despite being explicitly listed suggests the allowedTools configuration isn't being processed properly
This is indeed a bug because:
1. The allowedTools feature exists specifically to avoid manual trust prompts
2. Your configuration follows the expected format
3. The tools you've listed are legitimate, available tools
4. The system should respect this configuration but apparently isn't
### Steps to reproduce
1. Create a CLI agent configuration file at `{workspace}/.amazonq/cli-agents/my-custom-agent.json`
2.
```json
{
"name": "aws-cdk-expert",
"description": "AWS CDK expert specialized in ...",
"prompt": "You are an AWS CDK expert specializing in ...",
"mcpServers": {
"Ref": {
"command": "npx",
"args": [
"ref-tools-mcp@latest"
],
"env": {
"REF_API_KEY": "ref-KEY"
}
},
"awslabs.cdk-mcp-server": {
"command": "uvx",
"args": [
"awslabs.cdk-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
},
"tools": [
"*"
],
"toolAliases": {},
"allowedTools": [
"fs_read",
"ref_read_url",
"ref_search_documentation",
"CDKGeneralGuidance",
"LambdaLayerDocumentationProvider",
"GetAwsSolutionsConstructPattern"
],
"resources": [
"file://AmazonQ.md",
"file://README.md",
"file://.amazonq/rules/**/*.md"
],
"hooks": {},
"toolsSettings": {}
}
```
3. `q chat --model claude-4-sonnet --agent my-custom-agent`
4. `/tools`
5.
```text
Tool Permission
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔Built-in:
- execute_bash * trust read-only commands
- fs_read * trusted
- fs_write * not trusted
- report_issue * trusted
- use_aws * trust read-only commands
Ref (MCP):
- ref_read_url * not trusted
- ref_search_documentation * not trusted
awslabs.cdk-mcp-server (MCP):
- CDKGeneralGuidance * not trusted
- CheckCDKNagSuppressions * not trusted
- ExplainCDKNagRule * not trusted
- GenerateBedrockAgentSchema * not trusted
- GetAwsSolutionsConstructPattern * not trusted
- LambdaLayerDocumentationProvider * not trusted
- SearchGenAICDKConstructs * not trusted
```
### Environment
```yaml
[q-details]
version = "1.13.1"
hash = "c658e9e187b6264a24821db3a3ddc591e3095d2f"
date = "2025-08-01T22:09:51.266693Z (5d ago)"
[system-info]
chip = "11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz"
total-cores = 8
memory = "31.08 GB"
[system-info.os.linux]
kernel_version = "5.15.0-151-generic"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 22.04.5 LTS"
version_id = "22.04"
version = "22.04.5 LTS (Jammy Jellyfish)"
[environment]
cwd = "/home/USER/git/my-project"
cli-path = "/home/USER/git/my-project"
install-method = "unknown"
[env-vars]
DISPLAY = ":0"
GTK_IM_MODULE = "ibus"
PATH = "/home/USER/.local/share/pnpm:/home/USER/.nvm/versions/node/v22.16.0/bin:/home/USER/.deno/bin:/home/USER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/USER/.local/bin"
QTERM_SESSION_ID = "38761d92582640b98cc0aea7888ee142"
QT_IM_MODULE = "ibus"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.13.1"
SHELL = "/bin/bash"
TERM = "xterm-256color"
XDG_CURRENT_DESKTOP = "ubuntu:GNOME"
XDG_SESSION_DESKTOP = "ubuntu"
XDG_SESSION_TYPE = "x11"
XMODIFIERS = "@im=ibus"
[chat-settings]
[chat-trusted_tools]
ref_read_url=trusted
ref_search_documentation=trusted
GetAwsSolutionsConstructPattern=trusted
fs_read=trusted
CDKGeneralGuidance=trusted
LambdaLayerDocumentationProvider=trusted
[chat-failed_request_ids]
none
[chat-context]
current_profile=my-custom-agent
profile_context=
AmazonQ.md
README.md
.amazonq/rules/**/*.md
files=
/home/me/git/my-project/.amazonq/rules/cdk-prevent-npm-run-build.md, 100 tkns
/home/me/git/my-project/.amazonq/rules/costs.md, 40 tkns
/home/me/git/my-project/.amazonq/rules/lambda.rules.md, 10 tkns
/home/me/git/my-project/README.md, 280 tkns
total context size=430 tkns
```
Contributor guide
Assessment
This issue has not been assessed yet.