feat(agent-core-v2): drop the dangerous command guard in auto permission mode - #3529
Conversation
🦋 Changeset detectedLatest commit: c52de99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67270a217e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| 'This Bash command could not be analyzed and is blocked in auto permission mode. Rewrite it with a literal command name and arguments, or ask the user to run it themselves.', | ||
| }; | ||
| } | ||
| if (auto) return undefined; |
There was a problem hiding this comment.
Continue scanning after an unanalyzable command
In auto mode, a command list such as $CMD --force; shutdown is now approved: analyzeSource returns immediately on the first command's unanalyzable verdict, this line abstains, and the next policy (auto-mode-approve) approves the entire Bash invocation without inspecting the known-dangerous shutdown. Preserve the unanalyzable verdict while scanning the remaining commands and prioritize any dangerous verdict before allowing the policy chain to continue.
Useful? React with 👍 / 👎.
commit: |
Related Issue
None — internal permission-behavior adjustment.
Problem
In auto (Never Ask) permission mode, the built-in dangerous-command guard denied two classes of Bash commands outright: commands confirmed dangerous (
shutdown,rm -rf,dd of=/dev/...) and commands the static analyzer cannot fully analyze (parser failures, or non-literal names and arguments such as$CMD --forceorenv $FLAGS). Users who explicitly chose the fully unattended mode were still blocked by these denials.What changed
dangerous-command-askpermission policy no longer evaluates anything in auto mode; the policy chain falls through toauto-mode-approve, so dangerous and unanalyzable commands both run without interruption.[permission] dangerous_command_guard = falsestill disables that.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.