You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a7666f8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(permissions): skip rm -rf prompts for /tmp and /temp paths (#315)
## Related Issue
Internal permission-policy exception for recursive force rm that targets
only temp directories.
## Problem
The dangerous-command guard asked for every `rm -rf`, including deletes
that target only `/tmp` or `/temp`. That blocked routine cleanup of temp
directories in Ask When Needed mode.
## What changed
Skip the confirmation prompt when every `rm -rf` operand is a literal
path under `/tmp` or `/temp` (segment-level prefix, no `..` escape).
Mixed, non-literal, or out-of-prefix targets still ask. `rm -rf --
/tmp/...` is included. The permission docs state the exception.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
---------
Co-authored-by: elkaix <melkholy@techmatrix.com>
Copy file name to clipboardExpand all lines: docs/configuration/config-files.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -513,7 +513,7 @@ api_key = "sk-xxx"
513
513
514
514
`permission` sets permission rules that are automatically loaded when a session starts, controlling whether the Agent needs user confirmation before calling a tool. Rules are written as a `[[permission.rules]]` array of tables, matched in order — the first matching rule takes effect.
515
515
516
-
The dangerous-command guard is enabled by default. In Always Ask and Ask When Needed modes, it requests confirmation for dangerous or unanalyzable `Bash` commands. Allow rules cannot bypass this guard. Never Ask mode and non-interactive execution skip the guard; explicit deny rules still apply. Set `dangerous_command_guard = false`, or `PYTHINKER_CODE_DANGEROUS_COMMAND_GUARD=false`, to disable it in other modes.
516
+
The dangerous-command guard is enabled by default. In Always Ask and Ask When Needed modes, it requests confirmation for dangerous or unanalyzable `Bash` commands. Allow rules cannot bypass this guard. Recursive force `rm` (`rm -rf`) of literal paths under `/tmp` or `/temp` that still resolve inside those directories does not require confirmation; mixed, non-literal, escaped, or out-of-prefix targets still do. If that resolution is unavailable, confirmation is required. Never Ask mode and non-interactive execution skip the guard; explicit deny rules still apply. Set `dangerous_command_guard = false`, or `PYTHINKER_CODE_DANGEROUS_COMMAND_GUARD=false`, to disable it in other modes.
0 commit comments