kiro-cli chat is not honoring tools / commands mentioned in ~/.kiro/settings/mcp.json or ~/.kiro/agents/default.json
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
Amazon Linux 2
Kiro Version
2.0.0
Bug Description
I have added tools Specific & commands specific things in ~/.kiro/settings/mcp.json, I am using kiro-cli chat, but cli is not working, but when i do alias kc='kiro-cli chat --trust-tools "read,write,aws,report"' in my ~/.bash_profile file, it works.
{
"autoApprove": [
"read",
"write",
"shell",
"aws"
],
"toolsSettings": {
"shell": {
"allowedCommands": [
"git .*",
"ls .*",
"cat .*",
"ls .*",
"pwd",
"echo .*",
"find .*",
"grep .*",
"cd .*"
],
"deniedCommands": [
".*rm -rf.*",
"sudo .*",
".*> /dev/sda.*"
]
},
"read": {
"allowedPaths": ["*"]
},
"write": {
"allowedPaths": ["*"]
}
}
}
Steps to Reproduce
- create the mentioned file in path
~/.kiro/settings/mcp.json - start kiro-cli
- run the commands mentioned in "allowedCommands"
- ls -l
-
17% > ls -l I will run the following command: ls -l (using tool: shell) Purpose: List files in current directory Allow this action? Use 't' to trust (always allow) the 'shell' tool for the session. [y/n/t]: 17% >
Expected Behavior
- ls -l should run, instead of asking to Allow this action?
Conversation ID
No response
Additional Context
No response
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #5376: Bug Report: execute_bash Tool Blocking All Commands (92% similar)
- #4743: Trusted Commands is not working. (92% similar)
- #6461: Temporary command approval / Per project approvals (85% similar)
- #6189: allowedCommands and "Run and Trust" don't match multiline commands (85% similar)
- #6055: Skills allowed-tools Frontmatter Not Working for Workspace-Level Skills (85% similar)
- #5873: MCP tools not injected into LLM tool list for workspace-defined agents (.kiro/agents/*.json) (85% similar)
- #5710: Agent config with both
hooksandtoolsSettingsfails to deserialize (85% similar) - #5476: Weird issue about tools not available in chat session (85% similar)
- #5071: Feature Request: Subagent tool approval improvements (85% similar)
What happens next?
- ⏰ This issue will be automatically closed in 3 days
- 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
- 💬 Comment on the original issue if you have additional information
Why is this marked as duplicate? Both report the execute_bash/shell tool not respecting configuration settings and blocking commands despite proper allowedCommands configuration. Same core problem with tool permissions not being honored from config files.
This is more sort of IDE - https://github.com/kirodotdev/Kiro/issues/4743. but on cli, so not sure both are different cases, and IDE reads from different path for config and cli reads from different path.
Thank you for your feedback! 🙏
The duplicate label has been removed and this issue has been sent back for maintainer review.
A maintainer will review this issue shortly.
Hi @stm29, thanks for filing this — you're right that this is CLI-specific and not a duplicate of #4743.
The issue is that ~/.kiro/settings/mcp.json is only for defining MCP server configurations (the mcpServers block). The fields you're using — toolsSettings, allowedCommands — are agent configuration fields that belong in an agent config file, not in mcp.json.
Additionally, autoApprove isn't a recognized field in the CLI agent config schema. The CLI equivalent is allowedTools.
To fix this, create a global agent config file at ~/.kiro/agents/default.json:
{
"name": "default",
"tools": ["*"],
"allowedTools": [
"read",
"write",
"shell",
"aws"
],
"toolsSettings": {
"shell": {
"allowedCommands": [
"git .*",
"ls .*",
"cat .*",
"pwd",
"echo .*",
"find .*",
"grep .*"
],
"deniedCommands": [
".*rm -rf.*",
"sudo .*",
".*> /dev/sda.*"
]
},
"write": {
"allowedPaths": ["**"]
},
"read": {
"allowedPaths": ["**"]
}
}
}
Then switch to it with /agent swap default, or it should load automatically if it's your only agent.
Your ~/.kiro/settings/mcp.json should only contain MCP server definitions.
The reason --trust-tools "read,write,aws,report" works is that it directly sets the allowed tools at runtime, bypassing the config file entirely.
Thanks it worked. /agents load default is the done which worked.
default, or it should load automatically if it's your only agent.
So if multiple agents configurations ( ~/.kiro/agents/{some_2_3_configurations}.json ) are there it won't load default.json by default?
Once answered feel free to close this
Glad loading the agent fixed it. Closing this since the question is answered. If this still happens, please reopen this issue or open a new one with your Kiro version, steps to reproduce, and any error message.