Skip to content

feat(security/tools): 为 file/grep/glob 接入统一结果安全过滤#157

Merged
minorcell merged 4 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-6
Apr 5, 2026
Merged

feat(security/tools): 为 file/grep/glob 接入统一结果安全过滤#157
minorcell merged 4 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-6

Conversation

@Cai-Tang-www

Copy link
Copy Markdown
Collaborator

Summary

  • file / grep / glob 引入统一路径结果过滤器,集中处理工作区边界、敏感路径、符号链接逃逸检查。
  • read_file 在读取前接入同源过滤规则,命中策略时返回结构化阻断错误。
  • grepglob 在候选结果阶段统一过滤,并补充统计元数据:matched_countfiltered_countreturned_countfiltered_reasons
  • 新增与增强测试覆盖:敏感路径过滤、symlink escape 过滤、原因码与统计元数据断言。

Test

  • go test ./internal/tools/filesystem/...
  • go test ./...

Closes #151
Refs #98

@minorcell minorcell merged commit 2c96389 into 1024XEngineer:main Apr 5, 2026
4 checks passed
@Cai-Tang-www Cai-Tang-www deleted the P0-6 branch April 5, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(security/tools): 为 file / grep / glob 工具接入统一安全检查

2 participants