Security: remove claude-cli permission bypass defaults#70723
Security: remove claude-cli permission bypass defaults#70723vincentkoc wants to merge 1 commit intomainfrom
Conversation
Greptile SummaryThis PR removes the hard-coded Confidence Score: 5/5Safe to merge — focused security improvement with thorough test coverage. All findings are P2 or lower. The only observation is a pre-existing asymmetry in validation between the space-separated and equals forms of No files require special attention.
|
|
Superseded by the direct landing on
Thanks @vincentkoc. |
|
Removing permissive defaults is the right call — defaults are policy, and permissive defaults become attack surface the moment an agent is deployed by someone who doesn't read the documentation. The principle here is important beyond just claude-cli: any permission that can be bypassed by default creates an implicit trust assumption that downstream skills and plugins inherit without knowing it. This is one of the patterns trust-checker is designed to surface — agents operating with inherited permissions they didn't explicitly request. Strong improvement. |
Motivation
Description
--permission-mode bypassPermissionsdefaults from the Anthropic backendargsandresumeArgsinextensions/anthropic/cli-backend.tsso the backend no longer launches Claude CLI in bypass mode by default.normalizeClaudePermissionArgsby removing the fallback injection while preserving sanitization of legacy--dangerously-skip-permissionsand keeping valid explicit--permission-modeoverrides inextensions/anthropic/cli-shared.ts.extensions/anthropic/cli-shared.test.tsandsrc/agents/cli-backends.test.ts.Testing
pnpm test extensions/anthropic/cli-shared.test.ts src/agents/cli-backends.test.ts, and both test files passed.--permission-modeorbypassPermissions, legacy skip flags are removed, malformed--permission-modeflags are dropped, and setting-source hardening (--setting-sources user) is preserved.Codex Task