Accept all behavior for bash chains
Question
When an agent wants to run a back command, it asks for permission. There are three options:
- Accept once (Enter)
- Accept always (a)
- Reject (Esc) Although 1 and 3 are pretty clear, I find it difficult to understand what 2 actually means. The documentation on permissions seems to focus more on configuration level permissions.
For a command like cd directory && ls -lh, what would "Accept always" actually accept? Is this for the entire chain, so that anything starting with cd directory is fine? Or is this for each component path, so that cd directory and ls -lh are fine? How would this generalize to new chains? After accepting cd directory && ls -lh and cd other_directory && rm -rf *, can the agent then also decide to run cd directory && rm -rf *? Without this kind of explanation it seems that the "Accept always" option is pretty limited.
This issue might be a duplicate of existing issues. Please check:
- #3419: Requests an "Accept for Session" option to address confusion around the "always" permission scope - very similar to your question about what "Accept always" actually means
- #1813: Discusses auto-accept/yolo mode switching, which relates to understanding permission scopes and behaviors
- #2521: Discusses safety concerns with the current "accept always" system and proposes improvements to make permission behavior clearer
Feel free to ignore if none of these address your specific case.
This is about missing documentation, not about the accept always behavior itself. Hence the above github-actions comments do not apply.
@igordertigor we use tree sitter to parse out the commands so accept always would whitelist:
"cd *" "ls *"
In the event of something like:
"git log"
an always approve would whitelist "git log *"
but it wouldn't whitelist "git commit ...." etc
Thank you! That's very useful. Will that become part of the documentation at some point?
I'm happy to add it if you need help.
that would be amazing actually thank u @igordertigor
@rekram1-node can you give me a pointer where to find the documentation code?
Yes, all docs are in packages/web/
You can look for .mdx files in particular
You can run the docs locally:
bun i cd packages/web bun run dev
then visit url in ur browser
There is now a pull request for my documentation changes at #5340 . When writing this down, I noticed that I actually might not have fully understood your answer, @rekram1-node . So, I guess this is to some extent also a validation that I understood everything correctly.