feat:为本地文件工具扩展 Bash 模式与权限守卫#66
Merged
Merged
Conversation
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.
背景
BASH_AGENT_BASH_MODE此前仅限制Bash工具。本次将同一权限模型扩展至本地文件工具,确保 Bash、Go、Rust、C 四个运行时对文件访问采用一致的分类和拒绝策略。变更内容
Read、Write、Edit、Glob、Grep接入BASH_AGENT_BASH_MODE权限校验。Read、Grep、Glob使用读取探针。Write、Edit使用写入探针。Glob增加失败关闭保护:..路径段时,按系统读取检查。0000,保持失败关闭。行为示例
默认模式
0467下:/etc/hosts等系统文件。Glob未指定路径且模式为/etc/*或../*时拒绝执行。验证
git diff --checkmake test-c-classify:36 通过,0 失败make test-go:通过cargo test --manifest-path rust/Cargo.toml native_file_mode_guard_matches_bash:通过