fix(agent): make Auto Mode auto-approve edits and shell commands#2970
Merged
Conversation
Auto Mode advertised hands-off, classifier-based approval but its allow-set (`AUTO_ALLOWED_TOOLS.auto`) only contained the base read/search/web/agent tools. Bash, BashOutput, KillShell, Edit, Write, and NotebookEdit fell through `canUseTool` to a manual permission prompt on every call, so users on Auto Mode were still asked to approve each edit and command. Add WRITE_TOOLS and BASH_TOOLS to the auto allow-set so the mode runs hands-off as advertised. MCP tools stay gated separately (do_not_use is denied, needs_approval still prompts), so auto remains narrower than bypassPermissions. The "model classifier" wording in the mode description is also corrected to describe the actual behavior, since the SDK's canUseTool arbiter can't re-defer to the classifier for these tools. Generated-By: PostHog Code Task-Id: 0add1c68-e7b5-4ef4-9221-508ff13108e0
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
charlesvien
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A customer reported PostHog Code "asking for lots of permissions allow this and that even when I have auto mode on." Auto Mode is labelled "Use a model classifier to approve/deny permission prompts", implying hands-off approval, but its allow-set (
AUTO_ALLOWED_TOOLS.auto) only contained the base read/search/web/agent tools.Bash,BashOutput,KillShell,Edit,Write, andNotebookEditfell throughcanUseToolto a manual prompt on every call, so users had to babysit each edit and shell command despite the mode promising the opposite.Why: The mode's behavior didn't match what it advertises, which read as broken and drove a frustrated paying-customer ticket. (The broader complaints in that ticket — delays, errors, chat not starting — are upstream LLM-gateway capacity degradation and not fixable in this repo.)
Changes
WRITE_TOOLSandBASH_TOOLSto theautoallow-set so Auto Mode auto-approves file edits and shell commands hands-off. MCP tools stay gated separately (do_not_usedenied,needs_approvalstill prompts), so auto remains narrower thanbypassPermissions.canUseToolarbiter can't re-defer to the SDK classifier for these tools.How did you test this?
permission-handlers.test.tsverifying Auto Mode auto-allowsBash/BashOutput/KillShell/Edit/Write/NotebookEditwithout prompting, and that Default Mode still prompts for them.vitest runon the touched test files (permission-handlers: 25 passed, execution-mode: 2 passed).pnpm --filter @posthog/agent typecheckclean;biome lintclean on changed files.Automatic notifications
Created with PostHog Code from an inbox report.