IDE Trust Command feature is too simplistic for sophisticated commands
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
linux
Kiro Version
0.11.132
Bug Description
Linux and Windows;
Consister the command created by the AI during a remodel
"
for f in
src/services/TreeService.test.ts
src/services/ContentTransformationService.test.ts
src/services/DerivedContentCreator.test.ts
src/services/OllamaResponseProcessor.test.ts
src/services/PresentationViewService.test.ts
src/services/PresentationViewService.property.test.ts
src/services/PerformanceOptimizationService.test.ts
src/services/URLRendering.test.ts
src/services/TestHarnessHandler.test.ts
src/controllers/TransformationController.test.ts
src/controllers/DerivedContentPresentationStrategy.integration.test.ts
src/controllers/ErrorResponseConsistency.test.ts
src/tests/PresentationLayerIntegration.test.ts
src/tests/PresentationLayerPropertyBased.test.ts
src/tests/DualInterfaceConsistency.test.ts
src/tests/ErrorHandling.test.ts
src/tests/mocks/MockBatchServer.test.ts
src/repositories/ContentSourceRepository.test.ts
src/repositories/UnifiedParticipantRepository.test.ts; do
if [ -f "$f" ]; then echo "EXISTS: $f"; else echo "MISSING: $f"; fi
done
"
Firstly, it makes no sense to trust the command since it will never appear again; there will be some name or order change.
Secondly, this is going to stuff my trusted command list with stale cruft.
Thirdly, I can't really just permit "for *" since who knows what is going on.
Finally, the meat of the command is just a measly "echo". That is perfectly fine.
But I have to nurse this execution along.
Perhaps a black list - like no "rm" or "curl". Probably a complex regex string would work, but I am not going to do it.
This is similar to another request, but not quite the same motivation
Steps to Reproduce
This depends on the commands generated by AI. the complex ones come from refactoring
Expected Behavior
In this case, I would like to permit command atoms, like "echo" while preventing "rm"
Conversation ID
00b3c915-99c9-4949-a76e-f000da08daf0
Additional Context
No response
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #7440: Shell commands printed on the screen should highlight untrusted commands before asking the user if they should be trusted (85% similar)
- #7133: execute_bash got full trust permissions from another tool approval (85% similar)
- #6461: Temporary command approval / Per project approvals (85% similar)
- #6189: allowedCommands and "Run and Trust" don't match multiline commands (85% similar)
- #6153: Allow env vars in allowedCommands (85% similar)
- #5732: Feature request: Allow
datecommand when autoAllowReadonly is enabled (85% similar) - #5376: Bug Report: execute_bash Tool Blocking All Commands (85% similar)
- #5071: Feature Request: Subagent tool approval improvements (85% similar)
- #4962: Allow trustedCommands wildcards in the middle of command strings and within command words (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 issues address the trust system for shell commands being too simplistic. The new issue complains about having to trust complex commands that will never appear again and wanting to allow safe commands like 'echo' while blocking dangerous ones. Issue #7440 requests highlighting untrusted commands and mentions trusting safe commands like 'echo' while being cautious about others. Both seek more granular control over command trust.
This is similar to #7440 and several of the others - It is a different use case.
They all indicate that the "trusted Command" feature is basic unfit for the current state of the art. It needs a serious rethink to be useful as the AI is proposing more sophistcated commands. It will become a serious non-AI limitation to the usefulness of Kiro.
We are beyond - I want to see every edit the model does, but frankly, I do want to see "curl", "rm", software installs.
If you fix this, folks will be ABLE to burn more tokens, and be happy about it.
I am sure that any and all authors and interveners in the listed similar bug reports would love to participate in a brainstorming on how to make this top notch.
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.
I think this is similar to [https://github.com/kirodotdev/Kiro/issues/4962].
Some commands could be steered to trustable commands. For example git -C /my/project status or cd /my/project && git status is more complex than just git status, so perhaps (1) the Kiro tool calls could have a separate parameter to set the cwd so it's not in the command itself and (2) Kiro would be discouraged from writing in the former style. Changing the tool call is a Kiro-level change (not something Kiro users can do).
Secondly, the Kiro parser could be smarter to decompose compound commands like cd /my/project && git status, so that cd * and git status could independently be Always Approved_ in all workspaces.
Kiro users can use AGENTS.md with something like
- Instead of high-cardinality commands like
git -C /my/project statusorcd /my/project && git statusthat contain project paths, try to usegit status, so I can add the latter to the trust list, which supports only the most rudimentary pattern matching. This saves me time reviewing commands. - Instead of running
python -c "{tons of code}"which sometimes takes multiple iterations, write to a filename that reflects the safety level such as (e.g. "investigate_database_read_only.py" vs "migrate_and_drop_prod_database.sql"). Try to re-use the same filename, so I can add it to the trusted commands list.